summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2010-01-17 07:46:04 -0800
committerKaz Kylheku <kaz@kylheku.com>2010-01-17 07:46:04 -0800
commit4e02ef614f9fd4930aab031cf8512c8607c0d2e9 (patch)
tree8a90b2a40e798bbf37f785fdb14b923209dc256a /parser.y
parenta6b27700fd31e51c24547e3e678feb79a03ae88e (diff)
downloadtxr-4e02ef614f9fd4930aab031cf8512c8607c0d2e9.tar.gz
txr-4e02ef614f9fd4930aab031cf8512c8607c0d2e9.tar.bz2
txr-4e02ef614f9fd4930aab031cf8512c8607c0d2e9.zip
* parser.y (regterm, regclass): Relocate handling
of empty [] into regterm, via empty derivation.
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/parser.y b/parser.y
index a3154201..db3ff2c7 100644
--- a/parser.y
+++ b/parser.y
@@ -469,9 +469,8 @@ regbranch : regterm { $$ = cons($1, nil); }
;
regterm : '[' regclass ']' { $$ = cons(set_s, $2); }
- | '[' ']' { $$ = cons(set_s, nil); }
- | '[' '^' regclass ']' { $$ = cons(cset_s, $3); }
- | '[' '^' ']' { $$ = wild_s; }
+ | '[' '^' regclass ']' { $$ = if3(nullp($3), wild_s,
+ cons(cset_s, $3)); }
| '.' { $$ = wild_s; }
| '^' { $$ = chr('^'); }
| ']' { $$ = chr(']'); }
@@ -492,6 +491,7 @@ regterm : '[' regclass ']' { $$ = cons(set_s, $2); }
regclass : regclassterm { $$ = cons($1, nil); }
| regclassterm regclass { $$ = cons($1, $2); }
+ | /* empty */ { $$ = nil; }
;
regclassterm : regrange { $$ = $1; }