From: John Millaway Date: Tue, 14 Feb 2006 19:28:53 +0000 (+0000) Subject: Omitting parens for named rules in trailing context. X-Git-Tag: flex-2-5-33~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2eeca899c860ec186eecadadee7742e985334d01;p=flex Omitting parens for named rules in trailing context. --- diff --git a/scan.l b/scan.l index fced0b8..fe9a0fc 100644 --- a/scan.l +++ b/scan.l @@ -35,6 +35,7 @@ #include "flexdef.h" #include "parse.h" extern bool tablesverify, tablesext; +extern int trlcontxt; /* Set in parse.y for each rule. */ #define ACTION_ECHO add_action( yytext ) #define ACTION_IFDEF(def, should_define) \ @@ -613,7 +614,7 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ if ( lex_compat || nmdefptr[0] == '^' || (len > 0 && nmdefptr[len - 1] == '$') - || end_is_ws) + || (end_is_ws && trlcontxt)) { /* don't use ()'s after all */ PUT_BACK_STRING((char *) nmdefptr, 0);