summaryrefslogtreecommitdiff
path: root/src/scan.l
diff options
context:
space:
mode:
authorDemi Obenour <demiobenour@gmail.com>2017-05-03 13:45:11 -0400
committerWill Estes <westes575@gmail.com>2017-05-03 16:13:39 -0400
commitba530cd52fa2d69ddf7194459445a19fc9648014 (patch)
treee85da4ba9ba8415a344d52961ae040ce9c46f363 /src/scan.l
parentb1c2957b3fb9081acf58606e669eca0a7aea9377 (diff)
scanner: Check for 0 bracecount when EOL ends quoted literal.
This can happen in the case of // comments (which Flex doesn't handle specially).
Diffstat (limited to 'src/scan.l')
-rw-r--r--src/scan.l4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/scan.l b/src/scan.l
index abe47f4..66db864 100644
--- a/src/scan.l
+++ b/src/scan.l
@@ -919,7 +919,7 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */
{NL} {
++linenum;
ACTION_ECHO;
- if (bracelevel == 0 || (doing_codeblock && indented_code)) {
+ if (bracelevel <= 0 || (doing_codeblock && indented_code)) {
if ( doing_rule_action )
add_action( "\tYY_BREAK]""]\n" );
@@ -964,7 +964,7 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */
<ACTION_STRING,CHARACTER_CONSTANT>{
(\\\n)* ACTION_ECHO;
\\(\\\n)*. ACTION_ECHO;
- {NL} ++linenum; ACTION_ECHO; BEGIN(ACTION);
+ {NL} ++linenum; ACTION_ECHO; if (bracelevel <= 0) { BEGIN(SECT2); } else { BEGIN(ACTION); }
. ACTION_ECHO;
}