]> ocean-lang.org Git - ocean/commitdiff
parsergen: remove special case of newline conflicts
authorNeilBrown <neil@brown.name>
Fri, 5 Mar 2021 10:26:55 +0000 (21:26 +1100)
committerNeilBrown <neil@brown.name>
Wed, 10 Mar 2021 01:00:32 +0000 (12:00 +1100)
newlines are no longer interesting in avoiding conflicts, so remove the
special case handling.

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

index 0f4bf1f4eb301b3ed9a5109b0307e8ee95d77871..c80bc9dd0b35780a02b60a62b988ff6e3ecfa505 100644 (file)
@@ -1775,11 +1775,6 @@ terminals to items where that terminal could be shifted and another
 which maps terminals to items that could be reduced when the terminal
 is in look-ahead.  We report when we get conflicts between the two.
 
-As a special case, if we find a SHIFT/REDUCE conflict, on the NEWLINE
-terminal, we ignore it.  NEWLINES are handled specially with its own
-rules for when to shift and when to reduce.  Conflicts are expected,
-but handled internally.
-
        static int conflicts_slr(struct grammar *g, enum grammar_type type)
        {
                int i;
@@ -1831,7 +1826,7 @@ but handled internally.
                                int k;
                                for (k = 0; k < la.cnt; k++) {
                                        int pos = symset_find(&shifts, la.syms[k]);
-                                       if (pos >= 0 && la.syms[k] != TK_newline) {
+                                       if (pos >= 0) {
                                                printf("  State %d has SHIFT/REDUCE conflict on ", i);
                                                cnt++;
                                                        prtxt(g->symtab[la.syms[k]]->name);