]> ocean-lang.org Git - ocean/commitdiff
parsergen: revise rule for NEWLINE forcing reduce
authorNeilBrown <neil@brown.name>
Fri, 3 Oct 2014 03:28:32 +0000 (13:28 +1000)
committerNeilBrown <neil@brown.name>
Fri, 3 Oct 2014 03:28:32 +0000 (13:28 +1000)
If the whole line is a single symbol, then it isn't appropriate
for a NEWLINE to force a reduce (it may be for an OUT, but as the
NEWLINE shifts (the OUT doesn't) we don't need to push so hard).

Signed-off-by: NeilBrown <neil@brown.name>
csrc/parsergen.mdc

index aa173e6ed49db9b4745d54b72d1095d19f0e0ee7..48c4d62c6fe58f44164ac1382121806ea1255c20 100644 (file)
@@ -2720,7 +2720,8 @@ since the last state which could have been at the start of a line.
                                        parser_trace_action(trace, "Discard");
                                        continue;
                                }
-                               if (states[tos->state].reduce_size >= 0 &&
+                               if (tos->since_newline > 1 &&
+                                   states[tos->state].reduce_size >= 0 &&
                                    states[tos->state].reduce_size <= tos->since_newline)
                                        goto force_reduce;
                        }