Added '@' check to islabelname
authorLukas Krickl <lukas@krickl.dev>
Sun, 3 Dec 2023 20:58:29 +0000 (21:58 +0100)
committerLukas Krickl <lukas@krickl.dev>
Sun, 3 Dec 2023 20:58:29 +0000 (21:58 +0100)
src/ulas.c
tests/t0.s

index 97d25399ff6cc82bfb3e11d97ad37ec56e9a3dfd..5ca228fe3de2858e658196f913e2cc6e28a8f469 100644 (file)
@@ -208,6 +208,10 @@ int ulas_isname(const char *tok, unsigned long n) {
 }
 
 int ulas_islabelname(const char *tok, unsigned long n) {
+  if (tok[0] == '@' && n > 0) {
+    tok+=1;
+    n--;
+  }
   return tok[n - 1] == ':' && ulas_isname(tok, n - 1);
 }
 
index cf5efec084d14a4e87ef9a9e5735e6c07f93ec93..4abdad79eceeebb3a2288908bd0327bedd9d3940 100644 (file)
@@ -74,3 +74,4 @@ l1:
   bit 0, [hl]
 
   ld bc, l1 + 1
+@local1: