summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--match.c3
-rw-r--r--match.h1
-rw-r--r--parser.y9
3 files changed, 7 insertions, 6 deletions
diff --git a/match.c b/match.c
index 15bb7e79..3a1024e9 100644
--- a/match.c
+++ b/match.c
@@ -61,6 +61,7 @@ val lines_k, chars_k;
val text_s, choose_s, gather_s, do_s, mdo_s, mod_s, modlast_s;
val line_s, data_s, fuzz_s, load_s;
val include_s, close_s, require_s, in_package_s;
+val else_s, elif_s;
val longest_k, shortest_k, greedy_k;
val vars_k, lists_k, resolve_k;
val append_k, into_k, var_k, list_k, tlist_k, string_k, env_k, counter_k;
@@ -4775,6 +4776,8 @@ static void syms_init(void)
close_s = intern(lit("close"), user_package);
require_s = intern(lit("require"), user_package);
in_package_s = intern(lit("in-package"), user_package);
+ else_s = intern(lit("else"), user_package);
+ elif_s = intern(lit("elif"), user_package);
longest_k = intern(lit("longest"), keyword_package);
shortest_k = intern(lit("shortest"), keyword_package);
greedy_k = intern(lit("greedy"), keyword_package);
diff --git a/match.h b/match.h
index be5145fe..467112a8 100644
--- a/match.h
+++ b/match.h
@@ -27,6 +27,7 @@
extern val text_s, choose_s, gather_s, do_s, mdo_s, require_s, in_package_s;
extern val close_s, load_s, include_s, mod_s, modlast_s, line_s;
+extern val else_s, elif_s;
extern val counter_k, vars_k, lists_k, env_k, var_k, into_k, named_k;
val match_expand_keyword_args(val elem);
val match_expand_elem(val elem);
diff --git a/parser.y b/parser.y
index 3e0be699..29814d79 100644
--- a/parser.y
+++ b/parser.y
@@ -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"); }