]> granicus.if.org Git - flex/commitdiff
Omitting parens for named rules in trailing context.
authorJohn Millaway <john43@users.sourceforge.net>
Tue, 14 Feb 2006 19:28:53 +0000 (19:28 +0000)
committerJohn Millaway <john43@users.sourceforge.net>
Tue, 14 Feb 2006 19:28:53 +0000 (19:28 +0000)
scan.l

diff --git a/scan.l b/scan.l
index fced0b875c455a46efa8c8134db12a39ffdff79b..fe9a0fc5018d7ceb32434e7c081bc4b49c45cb8e 100644 (file)
--- 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);