diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2021-08-21 16:18:56 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2021-08-21 16:19:49 +0900 |
commit | 94e2400aa8e6017165ab22ba5f2f70a6d0682f63 (patch) | |
tree | 83949f605bd729c83f8295db47aa065ad96e65bf /driver/parser_test.go | |
parent | Fix indents of a tree (diff) | |
download | cotia-94e2400aa8e6017165ab22ba5f2f70a6d0682f63.tar.gz cotia-94e2400aa8e6017165ab22ba5f2f70a6d0682f63.tar.xz |
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.
Diffstat (limited to 'driver/parser_test.go')
-rw-r--r-- | driver/parser_test.go | 24 |
1 files changed, 12 insertions, 12 deletions
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 |