From: Vern Paxson Date: Thu, 9 Dec 1993 13:57:23 +0000 (+0000) Subject: Fixed bug in treating '$' as variable trailing context X-Git-Tag: flex-2-5-5b~268 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d865c176c6e5bf6768dbc4577595cdfe20d0baab;p=flex Fixed bug in treating '$' as variable trailing context --- diff --git a/parse.y b/parse.y index beb6e11..b3f517f 100644 --- a/parse.y +++ b/parse.y @@ -364,6 +364,13 @@ rule : re2 re | re '$' { + headcnt = 0; + trailcnt = 1; + rulelen = 1; + varlength = false; + + current_state_type = STATE_TRAILING_CONTEXT; + if ( trlcontxt ) { synerr( "trailing context used twice" ); @@ -375,16 +382,13 @@ rule : re2 re /* See the comment in the rule for "re2 re" * above. */ - if ( ! varlength || headcnt != 0 ) - warn( + warn( "trailing context made variable due to preceding '|' action" ); - /* Mark as variable. */ varlength = true; - headcnt = 0; } - if ( lex_compat || (varlength && headcnt == 0) ) + if ( lex_compat || varlength ) { /* Again, see the comment in the rule for * "re2 re" above. @@ -394,15 +398,6 @@ rule : re2 re variable_trail_rule = true; } - else - { - if ( ! varlength ) - headcnt = rulelen; - - ++rulelen; - trailcnt = 1; - } - trlcontxt = true; eps = mkstate( SYM_EPSILON );