From: NeilBrown Date: Sun, 15 Jun 2014 08:44:14 +0000 (+1000) Subject: parsergen: work-around for indent parsing problem. X-Git-Tag: workingparser~27 X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=commitdiff_plain;h=f0665bd4c3455633f6a489f88464132490aacf37 parsergen: work-around for indent parsing problem. These was a problem with my reasoning about parsing indents. Resolving it properly will take a bit of work, but this little 'fix' handles an easy case for now. Signed-off-by: NeilBrown --- diff --git a/csrc/parsergen.mdc b/csrc/parsergen.mdc index 47cbfc2..b94bd3b 100644 --- a/csrc/parsergen.mdc +++ b/csrc/parsergen.mdc @@ -2600,7 +2600,7 @@ since the last state which could have been at the start of a line. if (p.next.sym == TK_out) { if (p.stack[p.tos-1].indents > p.stack[p.tos-1].starts_indented || (p.stack[p.tos-1].indents == 1 && - states[p.next.state].reduce_size > 1)) { + states[p.next.state].reduce_size != 1)) { p.stack[p.tos-1].indents -= 1; if (p.stack[p.tos-1].indents == p.stack[p.tos-1].starts_indented) { // no internal indent any more, reassess 'newline_permitted'