diff options
author | john43 <john43> | 2006-03-27 22:04:15 +0000 |
---|---|---|
committer | john43 <john43> | 2006-03-27 22:04:15 +0000 |
commit | 590ce51c80396e72204432429a6e6d1b43d9976a (patch) | |
tree | db100df053c41f003a0ae0f41434047454641c59 /parse.y | |
parent | 495e52d480580b0a82af2c0b4438fc3f9dbd6a1a (diff) | |
download | flex-590ce51c80396e72204432429a6e6d1b43d9976a.tar.gz |
Implemented dot-all syntax.
Added test for dot-all syntax in test suite.
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 31 |
1 files changed, 22 insertions, 9 deletions
@@ -105,13 +105,14 @@ char *alloca (); /* Bletch, ^^^^ that was ugly! */ -int pat, scnum, eps, headcnt, trailcnt, anyccl, lastchar, i, rulelen; +int pat, scnum, eps, headcnt, trailcnt, lastchar, i, rulelen; int trlcontxt, xcluflg, currccl, cclsorted, varlength, variable_trail_rule; int *scon_stk; int scon_stk_ptr; static int madeany = false; /* whether we've made the '.' character class */ +static int ccldot, cclany; int previous_continued_action; /* whether the previous rule's action was '|' */ #define format_warn3(fmt, a1, a2) \ @@ -728,21 +729,33 @@ singleton : singleton '*' if ( ! madeany ) { /* Create the '.' character class. */ - anyccl = cclinit(); - ccladd( anyccl, '\n' ); - cclnegate( anyccl ); + ccldot = cclinit(); + ccladd( ccldot, '\n' ); + cclnegate( ccldot ); - if ( useecs ) - mkeccl( ccltbl + cclmap[anyccl], - ccllen[anyccl], nextecm, - ecgroup, csize, csize ); + if ( useecs ) + mkeccl( ccltbl + cclmap[ccldot], + ccllen[ccldot], nextecm, + ecgroup, csize, csize ); + + /* Create the (?s:'.') character class. */ + cclany = cclinit(); + cclnegate( cclany ); + + if ( useecs ) + mkeccl( ccltbl + cclmap[cclany], + ccllen[cclany], nextecm, + ecgroup, csize, csize ); madeany = true; } ++rulelen; - $$ = mkstate( -anyccl ); + if (sf_dot_all()) + $$ = mkstate( -cclany ); + else + $$ = mkstate( -ccldot ); } | fullccl |