Only define @ and _NARG when they have values (#1073)

Fixes #1069

Co-authored-by: Eldred Habert <eldredhabert0@gmail.com>
This commit is contained in:
Rangi
2022-09-30 19:04:03 -04:00
committed by GitHub
parent 140c6b169e
commit 08545643cf
16 changed files with 62 additions and 26 deletions

View File

@@ -1462,9 +1462,7 @@ relocexpr_no_str : scoped_anon_id { rpn_Symbol(&$$, $1); }
| T_OP_DEF {
lexer_ToggleStringExpansion(false);
} T_LPAREN scoped_anon_id T_RPAREN {
struct Symbol const *sym = sym_FindScopedSymbol($4);
rpn_Number(&$$, !!sym);
rpn_Number(&$$, sym_FindScopedValidSymbol($4) != NULL);
lexer_ToggleStringExpansion(true);
}
@@ -1590,7 +1588,7 @@ string : T_STRING
freeStrFmtArgList(&$3);
}
| T_POP_SECTION T_LPAREN scoped_anon_id T_RPAREN {
struct Symbol *sym = sym_FindScopedSymbol($3);
struct Symbol *sym = sym_FindScopedValidSymbol($3);
if (!sym)
fatalerror("Unknown symbol \"%s\"\n", $3);