summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y16
1 files changed, 13 insertions, 3 deletions
diff --git a/parser.y b/parser.y
index 21b6945d..661200dd 100644
--- a/parser.y
+++ b/parser.y
@@ -125,7 +125,7 @@ INLINE val expand_form_ver(val form, int ver)
%token <val> NUMBER METANUM
%token <val> HASH_N_EQUALS HASH_N_HASH
-%token <chr> REGCHAR REGTOKEN LITCHAR SPLICE
+%token <chr> REGCHAR REGTOKEN LITCHAR SPLICE OLD_AT
%token <chr> CONSDOT LAMBDOT UREFDOT OREFDOT UOREFDOT
%type <val> spec hash_semi_or_n_expr hash_semi_or_i_expr
@@ -160,13 +160,13 @@ INLINE val expand_form_ver(val form, int ver)
%right OUTPUT REPEAT REP FIRST LAST EMPTY DEFINE IF ELIF ELSE
%right SPACE TEXT NUMBER METANUM HASH_N_EQUALS HASH_N_HASH HASH_B_QUOTE
%nonassoc '[' ']' '(' ')'
-%left '-' ',' '\'' '^' SPLICE '@'
+%left '-' ',' '\'' '^' SPLICE OLD_AT
%left '|' '/'
%left '&'
%right '~' '*' '?' '+' '%'
%right DOTDOT
%right '.' CONSDOT LAMBDOT UREFDOT OREFDOT UOREFDOT REGCHAR REGTOKEN LITCHAR
-%right OLD_DOTDOT
+%right OLD_DOTDOT '@'
%%
@@ -954,6 +954,15 @@ meta : '@' n_expr { if (consp($2))
yybadtok(yychar, lit("meta expression")); }
;
+meta : OLD_AT n_expr { if (consp($2))
+ $$ = rl(cons(expr_s, cons($2, nil)), num($1));
+ else
+ $$ = rl(cons(var_s, cons($2, nil)),
+ num($1)); }
+ | OLD_AT error { $$ = nil;
+ yybadtok(yychar, lit("meta expression")); }
+ ;
+
dwim : '[' '.' n_exprs ']' { val a = car($3);
val ur = uref_helper(parser, a);
$$ = rlcp_tree(cons(dwim_s,
@@ -1989,6 +1998,7 @@ void yybadtoken(parser_t *parser, int tok, val context)
case WSPLICE: problem = lit("#*\""); break;
case QWORDS: problem = lit("#`"); break;
case QWSPLICE: problem = lit("#*`"); break;
+ case OLD_AT: problem = lit("@"); break;
}
if (problem != 0)