Skip to content

Commit

Permalink
fixes #1048
Browse files Browse the repository at this point in the history
should check for old loopend before looking to start the next loop
  • Loading branch information
increpare committed Feb 9, 2025
1 parent 005920f commit 5639eaf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -2434,6 +2434,10 @@ function printRules(state) {
var discardcount = 0;
for (var i = 0; i < state.rules.length; i++) {
var rule = state.rules[i];
if (loopEnd !== -1 && loopEnd < rule.lineNumber) {
output += "ENDLOOP<br>";
loopEnd = -1;
}
if (loopIndex < state.loops.length) {
if (state.loops[loopIndex][0] < rule.lineNumber) {
output += "STARTLOOP<br>";
Expand All @@ -2444,10 +2448,6 @@ function printRules(state) {
}
}
}
if (loopEnd !== -1 && loopEnd < rule.lineNumber) {
output += "ENDLOOP<br>";
loopEnd = -1;
}
if (rule.hasOwnProperty('discard')) {
discardcount++;
} else {
Expand Down

0 comments on commit 5639eaf

Please sign in to comment.