From: NeilBrown Date: Fri, 5 Mar 2021 10:26:55 +0000 (+1100) Subject: parsergen: remove special case of newline conflicts X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=commitdiff_plain;h=a8b0f01a492fcd046196fec0ac3e9b5b50d1de4b parsergen: remove special case of newline conflicts newlines are no longer interesting in avoiding conflicts, so remove the special case handling. Signed-off-by: NeilBrown --- diff --git a/csrc/parsergen.mdc b/csrc/parsergen.mdc index 0f4bf1f..c80bc9d 100644 --- a/csrc/parsergen.mdc +++ b/csrc/parsergen.mdc @@ -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);