From 0130b304296a266c1ebe3d135e64c936047dd66b Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 3 Oct 2014 13:28:32 +1000 Subject: [PATCH] parsergen: revise rule for NEWLINE forcing reduce 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 --- csrc/parsergen.mdc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/csrc/parsergen.mdc b/csrc/parsergen.mdc index aa173e6..48c4d62 100644 --- a/csrc/parsergen.mdc +++ b/csrc/parsergen.mdc @@ -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; } -- 2.43.0