From 7271e46bbcb11acf860c91eddfe12dd7eed5ccad Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Thu, 26 Aug 2021 23:16:09 +0900 Subject: Add error symbol and #recover directive to recover from an error state --- grammar/lr0_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'grammar/lr0_test.go') diff --git a/grammar/lr0_test.go b/grammar/lr0_test.go index 36c0957..4a613dd 100644 --- a/grammar/lr0_test.go +++ b/grammar/lr0_test.go @@ -52,7 +52,7 @@ id: "[A-Za-z_][0-9A-Za-z_]*"; t.Fatal(err) } - automaton, err = genLR0Automaton(gram.productionSet, gram.augmentedStartSymbol) + automaton, err = genLR0Automaton(gram.productionSet, gram.augmentedStartSymbol, gram.errorSymbol) if err != nil { t.Fatalf("failed to create a LR0 automaton: %v", err) } @@ -254,7 +254,7 @@ BAR: "bar"; t.Fatal(err) } - automaton, err = genLR0Automaton(gram.productionSet, gram.augmentedStartSymbol) + automaton, err = genLR0Automaton(gram.productionSet, gram.augmentedStartSymbol, gram.errorSymbol) if err != nil { t.Fatalf("failed to create a LR0 automaton: %v", err) } -- cgit v1.2.3