aboutsummaryrefslogtreecommitdiff
path: root/driver/parser_test.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-08-21 16:18:56 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-08-21 16:19:49 +0900
commit94e2400aa8e6017165ab22ba5f2f70a6d0682f63 (patch)
tree83949f605bd729c83f8295db47aa065ad96e65bf /driver/parser_test.go
parentFix indents of a tree (diff)
downloadcotia-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.go24
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