From eaaed5a7c6622d97618452c5bae1012d0e0e7f94 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 2 Oct 2014 21:01:41 +1000 Subject: [PATCH] parsergen: fix handling of TK_in during parse. Now that an 'in' it always considered to be *after* a symbol, we want to apply 'in' token to the current top-of-stack, not to the 'next' frame. Signed-off-by: NeilBrown --- csrc/parsergen.mdc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/csrc/parsergen.mdc b/csrc/parsergen.mdc index f99d318..d6feb8a 100644 --- a/csrc/parsergen.mdc +++ b/csrc/parsergen.mdc @@ -2659,8 +2659,11 @@ since the last state which could have been at the start of a line. parser_trace(trace, &p, &next, tk, states, non_term, config->known_count); if (next.sym == TK_in) { - next.indents = 1; - next.since_newline = 0; + tos->indents += 1; + tos->since_newline = 0; + tos->since_indent = 0; + if (!states[tos->state].starts_line) + tos->newline_permitted = 0; free(tk); tk = NULL; parser_trace_action(trace, "Record"); -- 2.43.0