aboutsummaryrefslogtreecommitdiff
path: root/spec/parser_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'spec/parser_test.go')
-rw-r--r--spec/parser_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/parser_test.go b/spec/parser_test.go
index de2c6f7..3fe950f 100644
--- a/spec/parser_test.go
+++ b/spec/parser_test.go
@@ -34,6 +34,12 @@ func TestParse(t *testing.T) {
Parameters: params,
}
}
+ assign := func(params ...*ParameterNode) *DirectiveNode {
+ return &DirectiveNode{
+ Name: "assign",
+ Parameters: params,
+ }
+ }
prod := func(lhs string, alts ...*AlternativeNode) *ProductionNode {
return &ProductionNode{
LHS: lhs,
@@ -148,6 +154,7 @@ func TestParse(t *testing.T) {
#prec (
#left a b
#right c d
+ #assign e f
);
`,
ast: &RootNode{
@@ -191,6 +198,19 @@ func TestParse(t *testing.T) {
),
newPos(6),
),
+ withDirPos(
+ assign(
+ withParamPos(
+ idParam("e"),
+ newPos(7),
+ ),
+ withParamPos(
+ idParam("f"),
+ newPos(7),
+ ),
+ ),
+ newPos(7),
+ ),
),
newPos(4),
),