From 94e2400aa8e6017165ab22ba5f2f70a6d0682f63 Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Sat, 21 Aug 2021 16:18:56 +0900 Subject: Resolve conflicts by default rules When a shift/reduce conflict occurred, we prioritize the shift action, and when a reduce/reduce conflict occurred, we prioritize the production defined earlier in the grammar file. --- driver/parser_test.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'driver/parser_test.go') diff --git a/driver/parser_test.go b/driver/parser_test.go index 0776232..d50ee85 100644 --- a/driver/parser_test.go +++ b/driver/parser_test.go @@ -10,22 +10,22 @@ import ( "github.com/nihei9/vartan/spec" ) -func TestParser_Parse(t *testing.T) { - termNode := func(kind string, text string, children ...*Node) *Node { - return &Node{ - KindName: kind, - Text: text, - Children: children, - } +func termNode(kind string, text string, children ...*Node) *Node { + return &Node{ + KindName: kind, + Text: text, + Children: children, } +} - nonTermNode := func(kind string, children ...*Node) *Node { - return &Node{ - KindName: kind, - Children: children, - } +func nonTermNode(kind string, children ...*Node) *Node { + return &Node{ + KindName: kind, + Children: children, } +} +func TestParser_Parse(t *testing.T) { tests := []struct { specSrc string src string -- cgit v1.2.3