From: NeilBrown Date: Thu, 2 Oct 2014 11:01:41 +0000 (+1000) Subject: parsergen: fix handling of TK_in during parse. X-Git-Tag: workingparser~15 X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=commitdiff_plain;h=eaaed5a7c6622d97618452c5bae1012d0e0e7f94 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 --- 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");