Fix an error recovery routine that seems to not run often master
authorNick Downing <nick@ndcode.org>
Thu, 21 Dec 2023 07:25:37 +0000 (18:25 +1100)
committerNick Downing <nick@ndcode.org>
Thu, 21 Dec 2023 07:31:00 +0000 (18:31 +1100)
ndcode/pilex/scan.l

index 7ab1839..b9f814e 100644 (file)
@@ -1469,6 +1469,7 @@ M4QEND      "]""]"
   (\\\n)*                      #add_action(yytext)
   \\(\\\n)*.                   #add_action(yytext)
   {NL} {
+    global doing_rule_action
     state.linenum += 1
     #add_action(yytext)
     if bracelevel <= 0:
@@ -1478,7 +1479,7 @@ M4QEND      "]""]"
         doing_rule_action = False # Nick added, error in the original?
         markup_pop() # t_def.AST.Text
         markup_pop() # t_def.AST.Section2.Rule.Action
-        return '\n'
+        return ord('\n')
     else:
       BEGIN(ACTION)
   }