From 265ff8f87dc7392fdf701f811eb2bf54d7bc6678 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Fri, 3 Feb 2023 10:52:35 +0800 Subject: Finally produced the first correct forest Finally the prototype parser has produced the first correct forest. It is my first time to generate a correct forest, in fact, ever since the beginning of this project. --- grammar/src/left_closure.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'grammar/src/left_closure.rs') diff --git a/grammar/src/left_closure.rs b/grammar/src/left_closure.rs index 39461f0..ddee28d 100644 --- a/grammar/src/left_closure.rs +++ b/grammar/src/left_closure.rs @@ -25,9 +25,11 @@ impl Grammar { GrammarState::AfterComputeFirst, )) } - GrammarState::AfterLeftClosure - | GrammarState::AfterNFA - | GrammarState::AfterComputeFirst => {} + GrammarState::AfterComputeFirst => { + self.state = GrammarState::AfterLeftClosure; + } + + _ => {} } let non_len = self.non_num(); -- cgit v1.2.3-18-g5258