From 4d2ce55b40d7115581cab1a1e13000736f0c94d0 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 28 Jun 2019 19:36:49 +1000 Subject: [PATCH] parsergen: only non-terminals should make a state "starts_line" If a state is followed by NEWLINE, then it isn't starts_line - more like ends_line. It is only non-terminals containing NEWLINEs that cause a state to be starts_line. So move the test to after we stop looking at terminals. Signed-off-by: NeilBrown --- csrc/parsergen.mdc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csrc/parsergen.mdc b/csrc/parsergen.mdc index df73f51..fdbe0ea 100644 --- a/csrc/parsergen.mdc +++ b/csrc/parsergen.mdc @@ -1334,11 +1334,11 @@ into the go to set, so the item is ineffective. continue; if (symset_find(&done, s->num) < 0) { symset_add(&done, s->num, 0); - if (s->line_like) - is->starts_line = 1; } if (s->type != Nonterminal) continue; + if (s->line_like) + is->starts_line = 1; again = 1; if (type >= LALR) { // Need the LA set. -- 2.43.0