diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-04-10 06:47:46 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-04-10 06:47:46 -0700 |
commit | c8b4a77879213c8e3978feed1b92f3f4cdadb4d0 (patch) | |
tree | a2e98d7a0ca3b05146bee5dce01a96d49db37716 /parser.y | |
parent | c739fd374884676993c88f7a8e223988d622e5d6 (diff) | |
download | txr-c8b4a77879213c8e3978feed1b92f3f4cdadb4d0.tar.gz txr-c8b4a77879213c8e3978feed1b92f3f4cdadb4d0.tar.bz2 txr-c8b4a77879213c8e3978feed1b92f3f4cdadb4d0.zip |
parser: @(if) hack in output must use usr package.
* match.c (else_s, elif_s): New symbol variables.
(syms_init): Initialize new variable with interned symbols.
* match.h (else_s, elif_s): Declared.
* parser.y (not_a_clause): Refer to if_s, else_s and elif_s,
which are symbols in the usr package, instead of intering
symbols in whatever package is current.
Diffstat (limited to 'parser.y')
-rw-r--r-- | parser.y | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -1275,10 +1275,8 @@ not_a_clause : ALL { $$ = mkexp(all_s, nil, num(parser->lineno)); } | OR { $$ = mkexp(or_s, nil, num(parser->lineno)); } | TRY { $$ = mkexp(try_s, nil, num(parser->lineno)); } | FINALLY { $$ = mkexp(finally_s, nil, num(parser->lineno)); } - | ELSE { $$ = mkexp(intern(lit("else"), nil), - nil, num(parser->lineno)); } - | ELIF { $$ = mkexp(intern(lit("elif"), nil), - nil, num(parser->lineno)); } + | ELSE { $$ = mkexp(else_s, nil, num(parser->lineno)); } + | ELIF { $$ = mkexp(elif_s, nil, num(parser->lineno)); } | BLOCK exprs_opt ')' { $$ = mkexp(block_s, $2, nil); } | CHOOSE @@ -1294,8 +1292,7 @@ not_a_clause : ALL { $$ = mkexp(all_s, nil, num(parser->lineno)); } | CATCH exprs_opt ')' { $$ = mkexp(catch_s, $2, nil); } | IF - exprs_opt ')' { $$ = mkexp(intern(lit("if"), nil), - $2, nil); } + exprs_opt ')' { $$ = mkexp(if_s, $2, nil); } | OUTPUT exprs_opt ')' { yyerr("@(output) doesn't nest"); } |