]> ocean-lang.org Git - ocean/commitdiff
parsergen: work-around for indent parsing problem.
authorNeilBrown <neilb@suse.de>
Sun, 15 Jun 2014 08:44:14 +0000 (18:44 +1000)
committerNeilBrown <neilb@suse.de>
Sun, 15 Jun 2014 08:44:14 +0000 (18:44 +1000)
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 <neil@brown.name>
csrc/parsergen.mdc

index 47cbfc2e48c641ebf49c081ff95346110561cb02..b94bd3bbc8ff823180d0030a07191c82f8f72462 100644 (file)
@@ -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'