summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-02-18 16:23:05 -0800
committerKaz Kylheku <kaz@kylheku.com>2012-02-18 16:23:05 -0800
commit3b1e713d392d607a37e9f6d1520c4f9f584d014d (patch)
tree308f58c828cd0dddc01cbdb5962b85881a83cdc2 /parser.y
parentce6020f1f8248050bb17699cc229205e8cdbdf4e (diff)
downloadtxr-3b1e713d392d607a37e9f6d1520c4f9f584d014d.tar.gz
txr-3b1e713d392d607a37e9f6d1520c4f9f584d014d.tar.bz2
txr-3b1e713d392d607a37e9f6d1520c4f9f584d014d.zip
* parser.y (o_var): Remove productions from grammar by using exprs_opt.
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y16
1 files changed, 6 insertions, 10 deletions
diff --git a/parser.y b/parser.y
index 24f38fb0..7dc5d67b 100644
--- a/parser.y
+++ b/parser.y
@@ -636,16 +636,12 @@ o_var : IDENT { $$ = list(var_s, intern(string_own($1), nil),
nao); }
| IDENT o_elem { $$ = list(var_s, intern(string_own($1), nil),
$2, nao); }
- | '{' IDENT '}' { $$ = list(var_s, intern(string_own($2), nil),
- nao); }
- | '{' IDENT '}' o_elem { $$ = list(var_s, intern(string_own($2), nil),
- $4, nao); }
- | '{' IDENT exprs '}' { $$ = list(var_s, intern(string_own($2), nil),
- nil, $3, nao); }
- | '{' IDENT exprs '}' o_elem { $$ = list(var_s,
- intern(string_own($2), nil),
- $5, $3, nao); }
- | IDENT error { $$ = nil;
+ | '{' IDENT exprs_opt '}' { $$ = list(var_s, intern(string_own($2), nil),
+ nil, $3, nao); }
+ | '{' IDENT exprs_opt '}' o_elem
+ { $$ = list(var_s, intern(string_own($2), nil),
+ $5, $3, nao); }
+ | IDENT error { $$ = nil;
yybadtoken(yychar, lit("variable spec")); }
;