From caddd61f178307b746ee6cb4ed47834ddca68dc3 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Thu, 26 Mar 2020 22:36:40 +0100 Subject: [PATCH] Remove "column 1" restriction for local labels Because a local symbol is necessarily a label, the disambiguation is not necessary. This is a first step towards fixing #457. --- src/asm/asmy.y | 5 ++--- src/asm/lexer.c | 8 ++------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/asm/asmy.y b/src/asm/asmy.y index e0eaeae6..945af5bd 100644 --- a/src/asm/asmy.y +++ b/src/asm/asmy.y @@ -555,7 +555,6 @@ static void strsubUTF8(char *dest, const char *src, uint32_t pos, uint32_t len) %left NEG /* negation -- unary minus */ %token T_LABEL -%token T_LOCAL_LABEL %type scoped_label %type scoped_label_bare %token T_ID @@ -671,12 +670,12 @@ line : label scoped_label_bare : T_LABEL { warning(WARNING_OBSOLETE, "Non-local labels without a colon are deprecated"); } - | T_LOCAL_LABEL + | T_LOCAL_ID ; scoped_label : T_LABEL ':' { strcpy($$, $1); } - | T_LOCAL_LABEL ':' { + | T_LOCAL_ID ':' { strcpy($$, $1); } ; diff --git a/src/asm/lexer.c b/src/asm/lexer.c index ac2fbd64..f8e86b49 100644 --- a/src/asm/lexer.c +++ b/src/asm/lexer.c @@ -905,12 +905,8 @@ scanagain: if (type == T_ID && strchr(yylval.tzSym, '.')) type = T_LOCAL_ID; - if (linestart) { - if (type == T_ID) - return T_LABEL; - if (type == T_LOCAL_ID) - return T_LOCAL_LABEL; - } + if (linestart && type == T_ID) + return T_LABEL; return type; }