summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2010-01-16 19:42:49 -0800
committerKaz Kylheku <kaz@kylheku.com>2010-01-16 19:42:49 -0800
commita6b27700fd31e51c24547e3e678feb79a03ae88e (patch)
tree5c3208331767b2ae329247c50652a60c9d9e61f4 /parser.y
parent4ff22034ebeeae2b245a1daa5413097d72dffbfb (diff)
downloadtxr-a6b27700fd31e51c24547e3e678feb79a03ae88e.tar.gz
txr-a6b27700fd31e51c24547e3e678feb79a03ae88e.tar.bz2
txr-a6b27700fd31e51c24547e3e678feb79a03ae88e.zip
Regex syntactic tweaks: support the [] syntax
to match no character and [^] as its complement, being synonymous with the wildcard dot.
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y2
1 files changed, 2 insertions, 0 deletions
diff --git a/parser.y b/parser.y
index 3bc6253a..a3154201 100644
--- a/parser.y
+++ b/parser.y
@@ -469,7 +469,9 @@ regbranch : regterm { $$ = cons($1, nil); }
;
regterm : '[' regclass ']' { $$ = cons(set_s, $2); }
+ | '[' ']' { $$ = cons(set_s, nil); }
| '[' '^' regclass ']' { $$ = cons(cset_s, $3); }
+ | '[' '^' ']' { $$ = wild_s; }
| '.' { $$ = wild_s; }
| '^' { $$ = chr('^'); }
| ']' { $$ = chr(']'); }