Add support of unnamed labels with @ (.localchar) prefix.

This commit is contained in:
Evgeny Vrublevsky
2023-06-03 16:33:18 +03:00
parent b993d88339
commit c500cb9086
4 changed files with 59 additions and 13 deletions

View File

@@ -707,6 +707,24 @@ static void OneLine (void)
NextTok ();
}
/* Handle @-style unnamed labels */
if (CurTok.Tok == TOK_ULABEL) {
if (CurTok.IVal != 0) {
Error ("Invalid unnamed label definition");
}
ULabDef ();
NextTok ();
/* Skip the colon. If NoColonLabels is enabled, allow labels without
** a colon if there is no whitespace before the identifier.
*/
if (CurTok.Tok == TOK_COLON) {
NextTok ();
} else if (CurTok.WS || !NoColonLabels) {
Error ("':' expected");
}
}
/* If the first token on the line is an identifier, check for a macro or
** an instruction.
*/