]> ocean-lang.org Git - ocean/commitdiff
parsergen: fix handling of TK_in during parse.
authorNeilBrown <neil@brown.name>
Thu, 2 Oct 2014 11:01:41 +0000 (21:01 +1000)
committerNeilBrown <neil@brown.name>
Thu, 2 Oct 2014 11:01:41 +0000 (21:01 +1000)
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 <neil@brown.name>
csrc/parsergen.mdc

index f99d318482d9f1b3568515a3c2d4440dc75b94aa..d6feb8a3d0ac51c7bb0e0713765bd68288f4d55f 100644 (file)
@@ -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");