From 2eeca899c860ec186eecadadee7742e985334d01 Mon Sep 17 00:00:00 2001 From: John Millaway Date: Tue, 14 Feb 2006 19:28:53 +0000 Subject: [PATCH] Omitting parens for named rules in trailing context. --- scan.l | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.40.0