diff options
author | Demi Obenour <demiobenour@gmail.com> | 2017-05-03 09:34:34 -0400 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2017-05-03 16:13:02 -0400 |
commit | b1c2957b3fb9081acf58606e669eca0a7aea9377 (patch) | |
tree | 3874980aed58dcf241e5da33989ea3911840c0d1 | |
parent | 8b746fa02556b7b99430f5e136c2a3684b5642ae (diff) |
scanner: when bracelevel is negative, treat as zero.
This really should never happen, but this at least fixes the
breakage on Verilator.
-rw-r--r-- | src/scan.l | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -940,16 +940,16 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ "'" ACTION_ECHO; BEGIN(CHARACTER_CONSTANT); \" ACTION_ECHO; BEGIN(ACTION_STRING); {NL} { - ++linenum; - ACTION_ECHO; - if (bracelevel == 0) { - if ( doing_rule_action ) - add_action( "\tYY_BREAK]""]\n" ); + ++linenum; + ACTION_ECHO; + if (bracelevel <= 0) { + if ( doing_rule_action ) + add_action( "\tYY_BREAK]""]\n" ); - doing_rule_action = false; - BEGIN(SECT2); - } - } + doing_rule_action = false; + BEGIN(SECT2); + } + } . ACTION_ECHO; } |