]> ocean-lang.org Git - ocean/blobdiff - csrc/parsergen.mdc
parsergen: be careful shifting TK_error
[ocean] / csrc / parsergen.mdc
index 905e8f8d125ca7432338059d84dae693ae3597fc..c25a87e1f621fd3ffa95d4a809c2276a235b2476 100644 (file)
@@ -2841,9 +2841,9 @@ one symbol for each line where newlines are allowed.
                        short indents = 0, start_of_line;
 
                        err_tk = tok_copy(*tk);
-                       while (shift(&p, TK_error, 0, 0,
-                                    err_tk, states) == 0
-                              && p.tos > 0)
+                       while (p.tos > 0 &&
+                              shift(&p, TK_error, 0, 0,
+                                    err_tk, states) == 0)
                                // discard this state
                                indents += pop(&p, 1, &start_of_line, do_free);
                        if (p.tos == 0) {