From e53639b61d06cb26a9baa124e7bc41cf83c51d57 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 3 Oct 2014 13:27:40 +1000 Subject: [PATCH] parsegen: pop was not computing start_of_line properly. In there is any line start in the sequence being popped, then the new symbol is considered to start a line. Signed-off-by: NeilBrown --- csrc/parsergen.mdc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/csrc/parsergen.mdc b/csrc/parsergen.mdc index 136cdf6..720f95f 100644 --- a/csrc/parsergen.mdc +++ b/csrc/parsergen.mdc @@ -2570,17 +2570,18 @@ removed. It is called _after_ we reduce a production, just before we void(*do_free)(short sym, void *asn)) { int i; - short indents; + short indents = 0; + int sol = 0; + p->tos -= num; - if (start_of_line) - *start_of_line = - !p->stack[p->tos].since_newline; - indents = 0; for (i = 0; i < num; i++) { + sol |= !p->stack[p->tos+1].since_newline; indents += p->stack[p->tos+i].indents; do_free(p->stack[p->tos+i].sym, p->asn_stack[p->tos+i]); } + if (start_of_line) + *start_of_line = sol; return indents; } -- 2.43.0