From b3ff3da5b9a5b75a00f608233ddc917f138c052c Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 3 Oct 2014 13:22:29 +1000 Subject: [PATCH] parsergen: fix handling of Newline in parse. The required handling for 'newline' when not ignored is: if the current state can REDUCE and the reduction length is no more symbols than the frames-since-start-of-line count, we REDUCE. 'can REDUCE' removes "reduce_size >= 0", not ">". 'not more symbols' means "reduce_size <= tos->since_newline", not "<". Signed-off-by: NeilBrown --- csrc/parsergen.mdc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csrc/parsergen.mdc b/csrc/parsergen.mdc index d6feb8a..f87d83f 100644 --- a/csrc/parsergen.mdc +++ b/csrc/parsergen.mdc @@ -2712,8 +2712,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 && - states[tos->state].reduce_size < tos->since_newline) + if (states[tos->state].reduce_size >= 0 && + states[tos->state].reduce_size <= tos->since_newline) goto force_reduce; } if (shift(&p, &next, tk, states)) { -- 2.43.0