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 <neil@brown.name>
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)) {