]> ocean-lang.org Git - ocean/commitdiff
parsergen: don't assume TK_newline in look-ahead for lineline
authorNeilBrown <neil@brown.name>
Sat, 22 Jun 2019 22:56:15 +0000 (08:56 +1000)
committerNeilBrown <neil@brown.name>
Sat, 22 Jun 2019 22:56:15 +0000 (08:56 +1000)
A linelike production might not have TK_newline in the look-ahead,
so don't assume it.  If it isn't there, make the look-ahead
set empty.

Signed-off-by: NeilBrown <neil@brown.name>
csrc/parsergen.mdc

index 2546d7632722a0673d4c78c83f6d924310390379..679fab6996de66a9fe267d914c654812f74771f3 100644 (file)
@@ -1348,7 +1348,8 @@ into the go to set, so the item is ineffective.
                        }
                        sn = save_set(g, LA);
                        LA = set_find(g, sn);
-                       symset_add(&LAnl, TK_newline, 0);
+                       if (symset_find(&LA, TK_newline))
+                               symset_add(&LAnl, TK_newline, 0);
                        snnl = save_set(g, LAnl);
                        LAnl = set_find(g, snnl);
                }