diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-02-18 16:23:05 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-02-18 16:23:05 -0800 |
commit | 3b1e713d392d607a37e9f6d1520c4f9f584d014d (patch) | |
tree | 308f58c828cd0dddc01cbdb5962b85881a83cdc2 /parser.y | |
parent | ce6020f1f8248050bb17699cc229205e8cdbdf4e (diff) | |
download | txr-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.y | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -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")); } ; |