aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2022-06-13 00:47:45 +0900
committerRyo Nihei <nihei.dev@gmail.com>2022-06-13 00:47:45 +0900
commit4b2cf7bc03efe6c4fc0b19ca5da071583bdcb900 (patch)
treeb68645aec68fe642de11992cda1b2f6123d6b6d4
parentProhibit using a pattern in an alternative (diff)
downloadurubu-4b2cf7bc03efe6c4fc0b19ca5da071583bdcb900.tar.gz
urubu-4b2cf7bc03efe6c4fc0b19ca5da071583bdcb900.tar.xz
Support testing token's texts in vartan-test command
-rw-r--r--spec/test/parser.go66
-rw-r--r--spec/test/parser_test.go182
-rw-r--r--spec/test/tree-report.json2
-rw-r--r--spec/test/tree.json2
-rw-r--r--spec/test/tree.vartan62
-rw-r--r--spec/test/tree_lexer.go516
-rw-r--r--spec/test/tree_parser.go168
-rw-r--r--spec/test/tree_semantic_action.go22
-rw-r--r--tester/tester.go6
-rw-r--r--tester/tester_test.go93
10 files changed, 926 insertions, 193 deletions
diff --git a/spec/test/parser.go b/spec/test/parser.go
index f255381..b6e0e2b 100644
--- a/spec/test/parser.go
+++ b/spec/test/parser.go
@@ -10,7 +10,9 @@ import (
"fmt"
"io"
"regexp"
+ "strconv"
"strings"
+ "unicode/utf8"
)
type TreeDiff struct {
@@ -32,15 +34,23 @@ type Tree struct {
Offset int
Kind string
Children []*Tree
+ Lexeme string
}
-func NewTree(kind string, children ...*Tree) *Tree {
+func NewNonTerminalTree(kind string, children ...*Tree) *Tree {
return &Tree{
Kind: kind,
Children: children,
}
}
+func NewTerminalNode(kind string, lexeme string) *Tree {
+ return &Tree{
+ Kind: kind,
+ Lexeme: lexeme,
+ }
+}
+
func (t *Tree) Fill() *Tree {
for i, c := range t.Children {
c.Parent = t
@@ -96,6 +106,12 @@ func DiffTree(expected, actual *Tree) []*TreeDiff {
newTreeDiff(expected, actual, msg),
}
}
+ if expected.Lexeme != actual.Lexeme {
+ msg := fmt.Sprintf("unexpected lexeme: expected '%v' but got '%v'", expected.Lexeme, actual.Lexeme)
+ return []*TreeDiff{
+ newTreeDiff(expected, actual, msg),
+ }
+ }
if len(actual.Children) != len(expected.Children) {
msg := fmt.Sprintf("unexpected node count: expected %v but got %v", len(expected.Children), len(actual.Children))
return []*TreeDiff{
@@ -218,7 +234,11 @@ func parseTree(src io.Reader) (*Tree, error) {
}
return nil, errors.New(b.String())
}
- return genTree(tb.Tree()).Fill(), nil
+ t, err := genTree(tb.Tree())
+ if err != nil {
+ return nil, err
+ }
+ return t.Fill(), nil
}
func formatSyntaxError(synErr *SyntaxError, gram Grammar) []byte {
@@ -251,13 +271,49 @@ func formatSyntaxError(synErr *SyntaxError, gram Grammar) []byte {
return b.Bytes()
}
-func genTree(node *Node) *Tree {
+func genTree(node *Node) (*Tree, error) {
+ if len(node.Children) == 2 && node.Children[1].KindName == "string" {
+ var lexeme string
+ str := node.Children[1].Children[0]
+ switch str.KindName {
+ case "raw_string":
+ lexeme = str.Children[0].Text
+ case "interpreted_string":
+ var b strings.Builder
+ for _, c := range str.Children {
+ switch c.KindName {
+ case "escaped_seq":
+ b.WriteString(strings.TrimPrefix(`\`, c.Text))
+ case "escape_char":
+ return nil, fmt.Errorf("incomplete escape sequence")
+ case "codepoint_expr":
+ n, err := strconv.ParseInt(c.Children[0].Text, 16, 64)
+ if err != nil {
+ return nil, err
+ }
+ if !utf8.ValidRune(rune(n)) {
+ return nil, fmt.Errorf("invalid code point: %v", c.Children[0].Text)
+ }
+ b.WriteRune(rune(n))
+ default:
+ b.WriteString(c.Text)
+ }
+ }
+ lexeme = b.String()
+ }
+ return NewTerminalNode(node.Children[0].Text, lexeme), nil
+ }
+
var children []*Tree
if len(node.Children) > 1 {
children = make([]*Tree, len(node.Children)-1)
for i, c := range node.Children[1:] {
- children[i] = genTree(c)
+ var err error
+ children[i], err = genTree(c)
+ if err != nil {
+ return nil, err
+ }
}
}
- return NewTree(node.Children[0].Text, children...)
+ return NewNonTerminalTree(node.Children[0].Text, children...), nil
}
diff --git a/spec/test/parser_test.go b/spec/test/parser_test.go
index 979202e..7a8984e 100644
--- a/spec/test/parser_test.go
+++ b/spec/test/parser_test.go
@@ -13,12 +13,12 @@ func TestTree_Format(t *testing.T) {
(c))
(d)
(e))`
- tree := NewTree("a",
- NewTree("b",
- NewTree("c"),
+ tree := NewNonTerminalTree("a",
+ NewNonTerminalTree("b",
+ NewNonTerminalTree("c"),
),
- NewTree("d"),
- NewTree("e"),
+ NewNonTerminalTree("d"),
+ NewNonTerminalTree("e"),
)
actual := string(tree.Format())
if actual != expected {
@@ -33,157 +33,157 @@ func TestDiffTree(t *testing.T) {
different bool
}{
{
- t1: NewTree("a"),
- t2: NewTree("a"),
+ t1: NewNonTerminalTree("a"),
+ t2: NewNonTerminalTree("a"),
},
{
- t1: NewTree("a",
- NewTree("b"),
+ t1: NewNonTerminalTree("a",
+ NewNonTerminalTree("b"),
),
- t2: NewTree("a",
- NewTree("b"),
+ t2: NewNonTerminalTree("a",
+ NewNonTerminalTree("b"),
),
},
{
- t1: NewTree("a",
- NewTree("b"),
- NewTree("c"),
- NewTree("d"),
+ t1: NewNonTerminalTree("a",
+ NewNonTerminalTree("b"),
+ NewNonTerminalTree("c"),
+ NewNonTerminalTree("d"),
),
- t2: NewTree("a",
- NewTree("b"),
- NewTree("c"),
- NewTree("d"),
+ t2: NewNonTerminalTree("a",
+ NewNonTerminalTree("b"),
+ NewNonTerminalTree("c"),
+ NewNonTerminalTree("d"),
),
},
{
- t1: NewTree("a",
- NewTree("b",
- NewTree("c"),
+ t1: NewNonTerminalTree("a",
+ NewNonTerminalTree("b",
+ NewNonTerminalTree("c"),
),
- NewTree("d",
- NewTree("d"),
+ NewNonTerminalTree("d",
+ NewNonTerminalTree("d"),
),
),
- t2: NewTree("a",
- NewTree("b",
- NewTree("c"),
+ t2: NewNonTerminalTree("a",
+ NewNonTerminalTree("b",
+ NewNonTerminalTree("c"),
),
- NewTree("d",
- NewTree("d"),
+ NewNonTerminalTree("d",
+ NewNonTerminalTree("d"),
),
),
},
{
- t1: NewTree("_"),
- t2: NewTree("a"),
+ t1: NewNonTerminalTree("_"),
+ t2: NewNonTerminalTree("a"),
},
{
- t1: NewTree("a",
- NewTree("_"),
+ t1: NewNonTerminalTree("a",
+ NewNonTerminalTree("_"),
),
- t2: NewTree("a",
- NewTree("b"),
+ t2: NewNonTerminalTree("a",
+ NewNonTerminalTree("b"),
),
},
{
- t1: NewTree("_",
- NewTree("b"),
+ t1: NewNonTerminalTree("_",
+ NewNonTerminalTree("b"),
),
- t2: NewTree("a",
- NewTree("b"),
+ t2: NewNonTerminalTree("a",
+ NewNonTerminalTree("b"),
),
},
{
- t1: NewTree("a"),
- t2: NewTree("b"),
+ t1: NewNonTerminalTree("a"),
+ t2: NewNonTerminalTree("b"),
different: true,
},
{
- t1: NewTree("a",
- NewTree("b"),
+ t1: NewNonTerminalTree("a",
+ NewNonTerminalTree("b"),
),
- t2: NewTree("a"),
+ t2: NewNonTerminalTree("a"),
different: true,
},
{
- t1: NewTree("a"),
- t2: NewTree("a",
- NewTree("b"),
+ t1: NewNonTerminalTree("a"),
+ t2: NewNonTerminalTree("a",
+ NewNonTerminalTree("b"),
),
different: true,
},
{
- t1: NewTree("a",
- NewTree("b"),
+ t1: NewNonTerminalTree("a",
+ NewNonTerminalTree("b"),
),
- t2: NewTree("a",
- NewTree("c"),
+ t2: NewNonTerminalTree("a",
+ NewNonTerminalTree("c"),
),
different: true,
},
{
- t1: NewTree("a",
- NewTree("b"),
- NewTree("c"),
- NewTree("d"),
+ t1: NewNonTerminalTree("a",
+ NewNonTerminalTree("b"),
+ NewNonTerminalTree("c"),
+ NewNonTerminalTree("d"),
),
- t2: NewTree("a",
- NewTree("b"),
- NewTree("c"),
+ t2: NewNonTerminalTree("a",
+ NewNonTerminalTree("b"),
+ NewNonTerminalTree("c"),
),
different: true,
},
{
- t1: NewTree("a",
- NewTree("b"),
- NewTree("c"),
+ t1: NewNonTerminalTree("a",
+ NewNonTerminalTree("b"),
+ NewNonTerminalTree("c"),
),
- t2: NewTree("a",
- NewTree("b"),
- NewTree("c"),
- NewTree("d"),
+ t2: NewNonTerminalTree("a",
+ NewNonTerminalTree("b"),
+ NewNonTerminalTree("c"),
+ NewNonTerminalTree("d"),
),
different: true,
},
{
- t1: NewTree("a",
- NewTree("b",
- NewTree("c"),
+ t1: NewNonTerminalTree("a",
+ NewNonTerminalTree("b",
+ NewNonTerminalTree("c"),
),
),
- t2: NewTree("a",
- NewTree("b",
- NewTree("d"),
+ t2: NewNonTerminalTree("a",
+ NewNonTerminalTree("b",
+ NewNonTerminalTree("d"),
),
),
different: true,
},
{
- t1: NewTree("a",
- NewTree("_"),
- NewTree("c"),
+ t1: NewNonTerminalTree("a",
+ NewNonTerminalTree("_"),
+ NewNonTerminalTree("c"),
),
- t2: NewTree("a",
- NewTree("b"),
- NewTree("x"),
+ t2: NewNonTerminalTree("a",
+ NewNonTerminalTree("b"),
+ NewNonTerminalTree("x"),
),
different: true,
},
{
- t1: NewTree("_"),
- t2: NewTree("a",
- NewTree("b"),
+ t1: NewNonTerminalTree("_"),
+ t2: NewNonTerminalTree("a",
+ NewNonTerminalTree("b"),
),
different: true,
},
{
- t1: NewTree("a",
- NewTree("_"),
+ t1: NewNonTerminalTree("a",
+ NewNonTerminalTree("_"),
),
- t2: NewTree("a",
- NewTree("b",
- NewTree("c"),
+ t2: NewNonTerminalTree("a",
+ NewNonTerminalTree("b",
+ NewNonTerminalTree("c"),
),
),
different: true,
@@ -217,7 +217,7 @@ foo
tc: &TestCase{
Description: "test",
Source: []byte("foo"),
- Output: NewTree("foo").Fill(),
+ Output: NewNonTerminalTree("foo").Fill(),
},
},
{
@@ -236,7 +236,7 @@ foo
tc: &TestCase{
Description: "\ntest\n",
Source: []byte("\nfoo\n"),
- Output: NewTree("foo").Fill(),
+ Output: NewNonTerminalTree("foo").Fill(),
},
},
// The length of a part delimiter may be greater than 3.
@@ -251,7 +251,7 @@ foo
tc: &TestCase{
Description: "\ntest",
Source: []byte("foo"),
- Output: NewTree("foo").Fill(),
+ Output: NewNonTerminalTree("foo").Fill(),
},
},
// The description part may be empty.
@@ -264,7 +264,7 @@ foo
tc: &TestCase{
Description: "",
Source: []byte("foo"),
- Output: NewTree("foo").Fill(),
+ Output: NewNonTerminalTree("foo").Fill(),
},
},
// The source part may be empty.
@@ -277,7 +277,7 @@ foo
tc: &TestCase{
Description: "test",
Source: []byte{},
- Output: NewTree("foo").Fill(),
+ Output: NewNonTerminalTree("foo").Fill(),
},
},
// NOTE: If there is a delimiter at the end of a test case, we really want to make it a syntax error,
@@ -293,7 +293,7 @@ foo
tc: &TestCase{
Description: "test",
Source: []byte("foo"),
- Output: NewTree("foo").Fill(),
+ Output: NewNonTerminalTree("foo").Fill(),
},
},
{
diff --git a/spec/test/tree-report.json b/spec/test/tree-report.json
index 71cdf0e..ac91d03 100644
--- a/spec/test/tree-report.json
+++ b/spec/test/tree-report.json
@@ -1 +1 @@
-{"class":"LALR(1)","terminals":[null,{"number":1,"name":"\u003ceof\u003e","anonymous":false,"alias":"","pattern":"","prec":0,"assoc":""},{"number":2,"name":"error","anonymous":false,"alias":"","pattern":"","prec":0,"assoc":""},{"number":3,"name":"ws","anonymous":false,"alias":"","pattern":"","prec":0,"assoc":""},{"number":4,"name":"l_paren","anonymous":false,"alias":"(","pattern":"","prec":1,"assoc":""},{"number":5,"name":"r_paren","anonymous":false,"alias":")","pattern":"","prec":0,"assoc":""},{"number":6,"name":"identifier","anonymous":false,"alias":"","pattern":"","prec":0,"assoc":""}],"non_terminals":[null,{"number":1,"name":"tree'"},{"number":2,"name":"tree"},{"number":3,"name":"tree_list"}],"productions":[null,{"number":1,"lhs":1,"rhs":[-2],"prec":0,"assoc":""},{"number":2,"lhs":2,"rhs":[4,6,-3,5],"prec":0,"assoc":""},{"number":3,"lhs":2,"rhs":[4,2,5],"prec":0,"assoc":""},{"number":4,"lhs":3,"rhs":[-3,-2],"prec":0,"assoc":""},{"number":5,"lhs":3,"rhs":[-2],"prec":0,"assoc":""},{"number":6,"lhs":3,"rhs":[],"prec":2,"assoc":""}],"states":[{"number":0,"kernel":[{"production":1,"dot":0}],"shift":[{"symbol":4,"state":2}],"reduce":null,"goto":[{"symbol":2,"state":1}],"sr_conflict":[],"rr_conflict":[]},{"number":1,"kernel":[{"production":1,"dot":1}],"shift":null,"reduce":[{"look_ahead":[1],"production":1}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":2,"kernel":[{"production":2,"dot":1},{"production":3,"dot":1}],"shift":[{"symbol":2,"state":3},{"symbol":6,"state":4}],"reduce":null,"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":3,"kernel":[{"production":3,"dot":2}],"shift":[{"symbol":5,"state":5}],"reduce":null,"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":4,"kernel":[{"production":2,"dot":2}],"shift":[{"symbol":4,"state":2}],"reduce":[{"look_ahead":[5,1],"production":6}],"goto":[{"symbol":2,"state":6},{"symbol":3,"state":7}],"sr_conflict":[{"symbol":4,"state":2,"production":6,"adopted_state":2,"adopted_production":null,"resolved_by":1}],"rr_conflict":[]},{"number":5,"kernel":[{"production":3,"dot":3}],"shift":null,"reduce":[{"look_ahead":[4,5,1],"production":3}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":6,"kernel":[{"production":5,"dot":1}],"shift":null,"reduce":[{"look_ahead":[4,5],"production":5}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":7,"kernel":[{"production":2,"dot":3},{"production":4,"dot":1}],"shift":[{"symbol":4,"state":2},{"symbol":5,"state":9}],"reduce":null,"goto":[{"symbol":2,"state":8}],"sr_conflict":[],"rr_conflict":[]},{"number":8,"kernel":[{"production":4,"dot":2}],"shift":null,"reduce":[{"look_ahead":[4,5],"production":4}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":9,"kernel":[{"production":2,"dot":4}],"shift":null,"reduce":[{"look_ahead":[4,5,1],"production":2}],"goto":null,"sr_conflict":[],"rr_conflict":[]}]} \ No newline at end of file
+{"terminals":[null,{"number":1,"name":"\u003ceof\u003e","anonymous":false,"alias":"","pattern":"","prec":0,"assoc":""},{"number":2,"name":"error","anonymous":false,"alias":"","pattern":"","prec":0,"assoc":""},{"number":3,"name":"ws","anonymous":false,"alias":"","pattern":"","prec":0,"assoc":""},{"number":4,"name":"l_paren","anonymous":false,"alias":"(","pattern":"","prec":1,"assoc":""},{"number":5,"name":"r_paren","anonymous":false,"alias":")","pattern":"","prec":0,"assoc":""},{"number":6,"name":"identifier","anonymous":false,"alias":"","pattern":"","prec":0,"assoc":""},{"number":7,"name":"raw_string_open","anonymous":false,"alias":"","pattern":"","prec":0,"assoc":""},{"number":8,"name":"raw_string_body","anonymous":false,"alias":"","pattern":"","prec":0,"assoc":""},{"number":9,"name":"raw_string_close","anonymous":false,"alias":"","pattern":"","prec":0,"assoc":""},{"number":10,"name":"interpreted_string_open","anonymous":false,"alias":"\"","pattern":"","prec":0,"assoc":""},{"number":11,"name":"interpreted_seq","anonymous":false,"alias":"","pattern":"","prec":0,"assoc":""},{"number":12,"name":"codepoint_prefix","anonymous":false,"alias":"\\u","pattern":"","prec":0,"assoc":""},{"number":13,"name":"l_brace","anonymous":false,"alias":"{","pattern":"","prec":0,"assoc":""},{"number":14,"name":"r_brace","anonymous":false,"alias":"}","pattern":"","prec":0,"assoc":""},{"number":15,"name":"hex_digits","anonymous":false,"alias":"","pattern":"","prec":0,"assoc":""},{"number":16,"name":"escaped_seq","anonymous":false,"alias":"","pattern":"","prec":0,"assoc":""},{"number":17,"name":"escape_char","anonymous":false,"alias":"\\","pattern":"","prec":0,"assoc":""},{"number":18,"name":"interpreted_string_close","anonymous":false,"alias":"\"","pattern":"","prec":0,"assoc":""}],"non_terminals":[null,{"number":1,"name":"tree'"},{"number":2,"name":"tree"},{"number":3,"name":"tree_list"},{"number":4,"name":"string"},{"number":5,"name":"raw_string"},{"number":6,"name":"opt_raw_string_body"},{"number":7,"name":"interpreted_string"},{"number":8,"name":"opt_interpreted_string_body"},{"number":9,"name":"interpreted_string_body"},{"number":10,"name":"interpreted_string_elem"},{"number":11,"name":"codepoint_expr"}],"productions":[null,{"number":1,"lhs":1,"rhs":[-2],"prec":0,"assoc":""},{"number":2,"lhs":2,"rhs":[4,6,-3,5],"prec":0,"assoc":""},{"number":3,"lhs":2,"rhs":[4,6,-4,5],"prec":0,"assoc":""},{"number":4,"lhs":2,"rhs":[4,2,5],"prec":0,"assoc":""},{"number":5,"lhs":3,"rhs":[-3,-2],"prec":0,"assoc":""},{"number":6,"lhs":3,"rhs":[-2],"prec":0,"assoc":""},{"number":7,"lhs":3,"rhs":[],"prec":2,"assoc":""},{"number":8,"lhs":4,"rhs":[-5],"prec":0,"assoc":""},{"number":9,"lhs":4,"rhs":[-7],"prec":0,"assoc":""},{"number":10,"lhs":5,"rhs":[7,-6,9],"prec":0,"assoc":""},{"number":11,"lhs":6,"rhs":[8],"prec":0,"assoc":""},{"number":12,"lhs":6,"rhs":[],"prec":0,"assoc":""},{"number":13,"lhs":7,"rhs":[10,-8,18],"prec":0,"assoc":""},{"number":14,"lhs":7,"rhs":[10,2,18],"prec":0,"assoc":""},{"number":15,"lhs":8,"rhs":[-9],"prec":0,"assoc":""},{"number":16,"lhs":8,"rhs":[],"prec":0,"assoc":""},{"number":17,"lhs":9,"rhs":[-9,-10],"prec":0,"assoc":""},{"number":18,"lhs":9,"rhs":[-10],"prec":0,"assoc":""},{"number":19,"lhs":10,"rhs":[11],"prec":0,"assoc":""},{"number":20,"lhs":10,"rhs":[13],"prec":0,"assoc":""},{"number":21,"lhs":10,"rhs":[14],"prec":0,"assoc":""},{"number":22,"lhs":10,"rhs":[15],"prec":0,"assoc":""},{"number":23,"lhs":10,"rhs":[16],"prec":0,"assoc":""},{"number":24,"lhs":10,"rhs":[17],"prec":0,"assoc":""},{"number":25,"lhs":10,"rhs":[-11],"prec":0,"assoc":""},{"number":26,"lhs":11,"rhs":[12,13,15,14],"prec":0,"assoc":""}],"states":[{"number":0,"kernel":[{"production":1,"dot":0}],"shift":[{"symbol":4,"state":2}],"reduce":null,"goto":[{"symbol":2,"state":1}],"sr_conflict":[],"rr_conflict":[]},{"number":1,"kernel":[{"production":1,"dot":1}],"shift":null,"reduce":[{"look_ahead":[1],"production":1}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":2,"kernel":[{"production":2,"dot":1},{"production":3,"dot":1},{"production":4,"dot":1}],"shift":[{"symbol":2,"state":3},{"symbol":6,"state":4}],"reduce":null,"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":3,"kernel":[{"production":4,"dot":2}],"shift":[{"symbol":5,"state":5}],"reduce":null,"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":4,"kernel":[{"production":2,"dot":2},{"production":3,"dot":2}],"shift":[{"symbol":4,"state":2},{"symbol":7,"state":11},{"symbol":10,"state":12}],"reduce":[{"look_ahead":[5,1],"production":7}],"goto":[{"symbol":2,"state":6},{"symbol":3,"state":7},{"symbol":4,"state":8},{"symbol":5,"state":9},{"symbol":7,"state":10}],"sr_conflict":[{"symbol":4,"state":2,"production":7,"adopted_state":2,"adopted_production":null,"resolved_by":1}],"rr_conflict":[]},{"number":5,"kernel":[{"production":4,"dot":3}],"shift":null,"reduce":[{"look_ahead":[4,5,1],"production":4}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":6,"kernel":[{"production":6,"dot":1}],"shift":null,"reduce":[{"look_ahead":[4,5],"production":6}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":7,"kernel":[{"production":2,"dot":3},{"production":5,"dot":1}],"shift":[{"symbol":4,"state":2},{"symbol":5,"state":14}],"reduce":null,"goto":[{"symbol":2,"state":13}],"sr_conflict":[],"rr_conflict":[]},{"number":8,"kernel":[{"production":3,"dot":3}],"shift":[{"symbol":5,"state":15}],"reduce":null,"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":9,"kernel":[{"production":8,"dot":1}],"shift":null,"reduce":[{"look_ahead":[5],"production":8}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":10,"kernel":[{"production":9,"dot":1}],"shift":null,"reduce":[{"look_ahead":[5],"production":9}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":11,"kernel":[{"production":10,"dot":1}],"shift":[{"symbol":8,"state":17}],"reduce":[{"look_ahead":[4,5,9,1],"production":12}],"goto":[{"symbol":6,"state":16}],"sr_conflict":[],"rr_conflict":[]},{"number":12,"kernel":[{"production":13,"dot":1},{"production":14,"dot":1}],"shift":[{"symbol":2,"state":22},{"symbol":11,"state":23},{"symbol":12,"state":24},{"symbol":13,"state":25},{"symbol":14,"state":26},{"symbol":15,"state":27},{"symbol":16,"state":28},{"symbol":17,"state":29}],"reduce":[{"look_ahead":[4,5,18,1],"production":16}],"goto":[{"symbol":8,"state":18},{"symbol":9,"state":19},{"symbol":10,"state":20},{"symbol":11,"state":21}],"sr_conflict":[],"rr_conflict":[]},{"number":13,"kernel":[{"production":5,"dot":2}],"shift":null,"reduce":[{"look_ahead":[4,5],"production":5}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":14,"kernel":[{"production":2,"dot":4}],"shift":null,"reduce":[{"look_ahead":[4,5,1],"production":2}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":15,"kernel":[{"production":3,"dot":4}],"shift":null,"reduce":[{"look_ahead":[4,5,1],"production":3}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":16,"kernel":[{"production":10,"dot":2}],"shift":[{"symbol":9,"state":30}],"reduce":null,"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":17,"kernel":[{"production":11,"dot":1}],"shift":null,"reduce":[{"look_ahead":[9],"production":11}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":18,"kernel":[{"production":13,"dot":2}],"shift":[{"symbol":18,"state":31}],"reduce":null,"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":19,"kernel":[{"production":15,"dot":1},{"production":17,"dot":1}],"shift":[{"symbol":11,"state":23},{"symbol":12,"state":24},{"symbol":13,"state":25},{"symbol":14,"state":26},{"symbol":15,"state":27},{"symbol":16,"state":28},{"symbol":17,"state":29}],"reduce":[{"look_ahead":[18],"production":15}],"goto":[{"symbol":11,"state":21},{"symbol":10,"state":32}],"sr_conflict":[],"rr_conflict":[]},{"number":20,"kernel":[{"production":18,"dot":1}],"shift":null,"reduce":[{"look_ahead":[4,5,11,12,13,14,15,16,17,18,1],"production":18}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":21,"kernel":[{"production":25,"dot":1}],"shift":null,"reduce":[{"look_ahead":[4,5,11,12,13,14,15,16,17,18,1],"production":25}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":22,"kernel":[{"production":14,"dot":2}],"shift":[{"symbol":18,"state":33}],"reduce":null,"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":23,"kernel":[{"production":19,"dot":1}],"shift":null,"reduce":[{"look_ahead":[4,5,11,12,13,14,15,16,17,18,1],"production":19}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":24,"kernel":[{"production":26,"dot":1}],"shift":[{"symbol":13,"state":34}],"reduce":null,"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":25,"kernel":[{"production":20,"dot":1}],"shift":null,"reduce":[{"look_ahead":[4,5,11,12,13,14,15,16,17,18,1],"production":20}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":26,"kernel":[{"production":21,"dot":1}],"shift":null,"reduce":[{"look_ahead":[4,5,11,12,13,14,15,16,17,18,1],"production":21}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":27,"kernel":[{"production":22,"dot":1}],"shift":null,"reduce":[{"look_ahead":[4,5,11,12,13,14,15,16,17,18,1],"production":22}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":28,"kernel":[{"production":23,"dot":1}],"shift":null,"reduce":[{"look_ahead":[4,5,11,12,13,14,15,16,17,18,1],"production":23}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":29,"kernel":[{"production":24,"dot":1}],"shift":null,"reduce":[{"look_ahead":[4,5,11,12,13,14,15,16,17,18,1],"production":24}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":30,"kernel":[{"production":10,"dot":3}],"shift":null,"reduce":[{"look_ahead":[4,5,1],"production":10}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":31,"kernel":[{"production":13,"dot":3}],"shift":null,"reduce":[{"look_ahead":[4,5,1],"production":13}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":32,"kernel":[{"production":17,"dot":2}],"shift":null,"reduce":[{"look_ahead":[4,5,11,12,13,14,15,16,17,18,1],"production":17}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":33,"kernel":[{"production":14,"dot":3}],"shift":null,"reduce":[{"look_ahead":[4,5,1],"production":14}],"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":34,"kernel":[{"production":26,"dot":2}],"shift":[{"symbol":15,"state":35}],"reduce":null,"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":35,"kernel":[{"production":26,"dot":3}],"shift":[{"symbol":14,"state":36}],"reduce":null,"goto":null,"sr_conflict":[],"rr_conflict":[]},{"number":36,"kernel":[{"production":26,"dot":4}],"shift":null,"reduce":[{"look_ahead":[4,5,11,12,13,14,15,16,17,18,1],"production":26}],"goto":null,"sr_conflict":[],"rr_conflict":[]}]}
diff --git a/spec/test/tree.json b/spec/test/tree.json
index 8387bec..371ae12 100644
--- a/spec/test/tree.json
+++ b/spec/test/tree.json
@@ -1 +1 @@
-{"name":"tree","lexical_specification":{"lexer":"maleeni","maleeni":{"spec":{"name":"tree","initial_mode_id":1,"mode_names":["","default"],"kind_names":["","ws","l_paren","r_paren","identifier"],"kind_ids":[null,[0,1,2,3,4]],"compression_level":2,"specs":[null,{"kind_names":["","ws","l_paren","r_paren","identifier"],"push":[0,0,0,0,0],"pop":[0,0,0,0,0],"dfa":{"initial_state_id":1,"accepting_states":[0,0,1,4,2,3],"row_count":6,"col_count":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-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],"row_displacement":[0,0,189,75]},"row_nums":[0,1,2,3,0,0],"original_row_count":6,"original_col_count":256,"empty_value":0}}}]},"kind_to_terminal":[0,3,4,5,6],"terminal_to_kind":[0,0,0,1,2,3,4],"skip":[0,1,0,0,0],"kind_aliases":["","","","","(",")",""]}},"parsing_table":{"class":"lalr","action":[0,0,0,0,-2,0,0,0,1,0,0,0,0,0,0,0,-3,0,0,0,-4,0,0,0,0,0,-5,0,0,6,0,0,-2,6,0,0,3,0,0,3,3,0,0,0,0,0,5,5,0,0,0,0,0,-2,-9,0,0,0,0,0,4,4,0,0,2,0,0,2,2,0],"goto":[0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,7,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0],"state_count":10,"initial_state":0,"start_production":1,"lhs_symbols":[0,1,2,2,3,3,3],"alternative_symbol_counts":[0,1,4,3,2,1,0],"terminals":["","\u003ceof\u003e","error","ws","l_paren","r_paren","identifier"],"terminal_count":7,"non_terminals":["","tree'","tree","tree_list"],"non_terminal_count":4,"eof_symbol":1,"error_symbol":2,"error_trapper_states":[0,0,1,0,0,0,0,0,0,0],"recover_productions":[0,0,0,1,0,0,0]},"ast_action":{"entries":[null,null,[2,-3],[2],[-1,2],null,null]}}
+{"name":"tree","lexical_specification":{"lexer":"maleeni","maleeni":{"spec":{"name":"tree","initial_mode_id":1,"mode_names":["","default","raw_string","interpreted_string"],"kind_names":["","ws","l_paren","r_paren","identifier","raw_string_open","interpreted_string_open","raw_string_body","raw_string_close","interpreted_seq","codepoint_prefix","l_brace","r_brace","hex_digits","escaped_seq","escape_char","interpreted_string_close"],"kind_ids":[null,[0,1,2,3,4,5,6],[0,7,8],[0,9,10,11,12,13,14,15,16]],"compression_level":2,"specs":[null,{"kind_names":["","ws","l_paren","r_paren","identifier","raw_string_open","interpreted_string_open"],"push":[0,0,0,0,0,2,3],"pop":[0,0,0,0,0,0,0],"dfa":{"initial_state_id":1,"accepting_states":[0,0,1,4,2,3,5,6],"row_count":8,"col_count":256,"transition":{"unique_entries":{"original_row_count":4,"original_col_count":256,"empty_value":0,"entries":[0,0,0,0,0,0,0,0,0,2,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,7,0,0,0,0,6,4,5,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,3,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,3,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],"row_displacement":[0,0,189,75]},"row_nums":[0,1,2,3,0,0,0,0],"original_row_count":8,"original_col_count":256,"empty_value":0}}},{"kind_names":["","raw_string_body","raw_string_close"],"push":[0,0,0],"pop":[0,0,1],"dfa":{"initial_state_id":1,"accepting_states":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2],"row_count":40,"col_count":256,"transition":{"unique_entries":{"original_row_count":24,"original_col_count":256,"empty_value":0,"entries":[20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,39,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,5,5,5,5,5,5,5,5,5,5,5,5,7,9,9,11,14,14,14,17,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,0,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,0,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,0,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,24,24,24,24,24,24,24,24,24,24,24,24,26,28,28,30,33,33,33,36,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,0,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"bounds":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,-1,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,-1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,-1,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,-1,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],"row_displacement":[0,0,246,1194,362,1258,426,1114,490,554,618,1355,682,245,1259,746,1323,810,1162,874,938,1002,1371,1066]},"row_nums":[0,1,2,3,2,4,2,5,2,6,2,7,8,2,9,10,2,11,12,2,13,2,14,2,15,2,16,2,17,2,18,19,2,20,21,2,22,23,2,0],"original_row_count":40,"original_col_count":256,"empty_value":0}}},{"kind_names":["","interpreted_seq","codepoint_prefix","l_brace","r_brace","hex_digits","escaped_seq","escape_char","interpreted_string_close"],"push":[0,0,0,0,0,0,0,0,0],"pop":[0,0,0,0,0,0,0,0,1],"dfa":{"initial_state_id":1,"accepting_states":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,5,2,3,4,6,8],"row_count":46,"col_count":256,"transition":{"unique_entries":{"original_row_count":26,"original_col_count":256,"empty_value":0,"entries":[20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,45,20,20,20,20,20,20,20,20,20,20,20,20,20,40,40,40,40,40,40,40,40,40,40,20,20,20,20,20,20,20,40,40,40,40,40,40,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,39,20,20,20,20,40,40,40,40,40,40,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,42,20,43,20,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,5,5,5,5,5,5,5,5,5,5,5,5,7,9,9,11,14,14,14,17,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,0,20,20,20,20,20,20,20,20,20,20,20,20,20,0,0,0,0,0,0,0,0,0,0,20,20,20,20,20,20,20,0,0,0,0,0,0,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,0,20,20,20,20,0,0,0,0,0,0,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,0,20,0,20,20,0,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,0,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,24,24,24,24,24,24,24,24,24,24,24,24,26,28,28,30,33,33,33,36,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,0,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,40,40,40,40,40,40,40,40,40,40,0,0,0,0,0,0,0,40,40,40,40,40,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,40,40,40,40,40,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"bounds":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,-1,13,13,13,13,13,13,13,13,13,13,13,13,13,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,13,13,13,13,13,13,13,-1,-1,-1,-1,-1,-1,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,-1,13,13,13,13,-1,-1,-1,-1,-1,-1,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,-1,13,-1,13,13,-1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,-1,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,-1,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,25,25,25,25,25,25,25,25,25,25,-1,-1,-1,-1,-1,-1,-1,25,25,25,25,25,25,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,25,25,25,25,25,25,24,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,24,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,24,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],"row_displacement":[0,0,246,1194,362,1258,426,1114,490,554,618,1436,682,245,1259,746,1323,810,1162,874,938,1002,1452,1066,1504,1435]},"row_nums":[0,1,2,3,2,4,2,5,2,6,2,7,8,2,9,10,2,11,12,2,13,2,14,2,15,2,16,2,17,2,18,19,2,20,21,2,22,23,2,24,25,0,0,0,0,0],"original_row_count":46,"original_col_count":256,"empty_value":0}}}]},"kind_to_terminal":[0,3,4,5,6,7,10,8,9,11,12,13,14,15,16,17,18],"skip":[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"kind_aliases":["","","","","(",")","","","","","\"","","\\u","{","}","","","\\","\""]}},"parsing_table":{"action":[0,0,0,0,-2,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"state_count":37,"initial_state":0,"start_production":1,"lhs_symbols":[0,1,2,2,2,3,3,3,4,4,5,6,6,7,7,8,8,9,9,10,10,10,10,10,10,10,11],"alternative_symbol_counts":[0,1,4,4,3,2,1,0,1,1,3,1,0,3,3,1,0,2,1,1,1,1,1,1,1,1,4],"terminals":["","\u003ceof\u003e","error","ws","l_paren","r_paren","identifier","raw_string_open","raw_string_body","raw_string_close","interpreted_string_open","interpreted_seq","codepoint_prefix","l_brace","r_brace","hex_digits","escaped_seq","escape_char","interpreted_string_close"],"terminal_count":19,"non_terminals":["","tree'","tree","tree_list","string","raw_string","opt_raw_string_body","interpreted_string","opt_interpreted_string_body","interpreted_string_body","interpreted_string_elem","codepoint_expr"],"non_terminal_count":12,"eof_symbol":1,"error_symbol":2,"error_trapper_states":[0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"recover_productions":[0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]},"ast_action":{"entries":[null,null,[2,-3],[2,3],[2],[-1,2],null,null,null,null,[-2],null,null,[-2],[2],[-1],null,[-1,-2],[-1],null,null,null,null,null,null,null,[3]]}}
diff --git a/spec/test/tree.vartan b/spec/test/tree.vartan
index 139014d..aa8f733 100644
--- a/spec/test/tree.vartan
+++ b/spec/test/tree.vartan
@@ -7,6 +7,7 @@
tree
: l_paren identifier tree_list r_paren #ast identifier tree_list...
+ | l_paren identifier string r_paren #ast identifier string
| l_paren error r_paren #recover #ast error
;
tree_list
@@ -14,6 +15,41 @@ tree_list
| tree
| #prec $empty_tree
;
+string
+ : raw_string
+ | interpreted_string
+ ;
+raw_string
+ : raw_string_open opt_raw_string_body raw_string_close #ast opt_raw_string_body...
+ ;
+opt_raw_string_body
+ : raw_string_body
+ |
+ ;
+interpreted_string
+ : interpreted_string_open opt_interpreted_string_body interpreted_string_close #ast opt_interpreted_string_body...
+ | interpreted_string_open error interpreted_string_close #recover #ast error
+ ;
+opt_interpreted_string_body
+ : interpreted_string_body #ast interpreted_string_body...
+ |
+ ;
+interpreted_string_body
+ : interpreted_string_body interpreted_string_elem #ast interpreted_string_body... interpreted_string_elem...
+ | interpreted_string_elem #ast interpreted_string_elem...
+ ;
+interpreted_string_elem
+ : interpreted_seq
+ | l_brace
+ | r_brace
+ | hex_digits
+ | escaped_seq
+ | escape_char
+ | codepoint_expr
+ ;
+codepoint_expr
+ : codepoint_prefix l_brace hex_digits r_brace #ast hex_digits
+ ;
ws #skip
: "[\u{0009}\u{000A}\u{000D}\u{0020}]+";
@@ -23,3 +59,29 @@ r_paren
: ')';
identifier
: "[0-9A-Za-z_]+";
+
+raw_string_open #push raw_string
+ : "'";
+raw_string_body #mode raw_string
+ : "[^']+";
+raw_string_close #mode raw_string #pop
+ : "'";
+
+interpreted_string_open #push interpreted_string
+ : '"';
+interpreted_seq #mode interpreted_string
+ : "[^\"\\{}0-9A-Fa-f]+";
+codepoint_prefix #mode interpreted_string
+ : '\u';
+l_brace #mode interpreted_string
+ : '{';
+r_brace #mode interpreted_string
+ : '}';
+hex_digits #mode interpreted_string
+ : "[0-9A-Fa-f]+";
+escaped_seq #mode interpreted_string
+ : "\\[\"\\]";
+escape_char #mode interpreted_string
+ : '\';
+interpreted_string_close #mode interpreted_string #pop
+ : '"';
diff --git a/spec/test/tree_lexer.go b/spec/test/tree_lexer.go
index 931626f..18032f7 100644
--- a/spec/test/tree_lexer.go
+++ b/spec/test/tree_lexer.go
@@ -313,13 +313,17 @@ func (l *Lexer) unread(n int) {
}
const (
- ModeIDNil ModeID = 0
- ModeIDDefault ModeID = 1
+ ModeIDNil ModeID = 0
+ ModeIDDefault ModeID = 1
+ ModeIDRawString ModeID = 2
+ ModeIDInterpretedString ModeID = 3
)
const (
- ModeNameNil = ""
- ModeNameDefault = "default"
+ ModeNameNil = ""
+ ModeNameDefault = "default"
+ ModeNameRawString = "raw_string"
+ ModeNameInterpretedString = "interpreted_string"
)
// ModeIDToName converts a mode ID to a name.
@@ -329,24 +333,52 @@ func ModeIDToName(id ModeID) string {
return ModeNameNil
case ModeIDDefault:
return ModeNameDefault
+ case ModeIDRawString:
+ return ModeNameRawString
+ case ModeIDInterpretedString:
+ return ModeNameInterpretedString
}
return ""
}
const (
- KindIDNil KindID = 0
- KindIDWs KindID = 1
- KindIDLParen KindID = 2
- KindIDRParen KindID = 3
- KindIDIdentifier KindID = 4
+ KindIDNil KindID = 0
+ KindIDWs KindID = 1
+ KindIDLParen KindID = 2
+ KindIDRParen KindID = 3
+ KindIDIdentifier KindID = 4
+ KindIDRawStringOpen KindID = 5
+ KindIDInterpretedStringOpen KindID = 6
+ KindIDRawStringBody KindID = 7
+ KindIDRawStringClose KindID = 8
+ KindIDInterpretedSeq KindID = 9
+ KindIDCodepointPrefix KindID = 10
+ KindIDLBrace KindID = 11
+ KindIDRBrace KindID = 12
+ KindIDHexDigits KindID = 13
+ KindIDEscapedSeq KindID = 14
+ KindIDEscapeChar KindID = 15
+ KindIDInterpretedStringClose KindID = 16
)
const (
- KindNameNil = ""
- KindNameWs = "ws"
- KindNameLParen = "l_paren"
- KindNameRParen = "r_paren"
- KindNameIdentifier = "identifier"
+ KindNameNil = ""
+ KindNameWs = "ws"
+ KindNameLParen = "l_paren"
+ KindNameRParen = "r_paren"
+ KindNameIdentifier = "identifier"
+ KindNameRawStringOpen = "raw_string_open"
+ KindNameInterpretedStringOpen = "interpreted_string_open"
+ KindNameRawStringBody = "raw_string_body"
+ KindNameRawStringClose = "raw_string_close"
+ KindNameInterpretedSeq = "interpreted_seq"
+ KindNameCodepointPrefix = "codepoint_prefix"
+ KindNameLBrace = "l_brace"
+ KindNameRBrace = "r_brace"
+ KindNameHexDigits = "hex_digits"
+ KindNameEscapedSeq = "escaped_seq"
+ KindNameEscapeChar = "escape_char"
+ KindNameInterpretedStringClose = "interpreted_string_close"
)
// KindIDToName converts a kind ID to a name.
@@ -362,6 +394,30 @@ func KindIDToName(id KindID) string {
return KindNameRParen
case KindIDIdentifier:
return KindNameIdentifier
+ case KindIDRawStringOpen:
+ return KindNameRawStringOpen
+ case KindIDInterpretedStringOpen:
+ return KindNameInterpretedStringOpen
+ case KindIDRawStringBody:
+ return KindNameRawStringBody
+ case KindIDRawStringClose:
+ return KindNameRawStringClose
+ case KindIDInterpretedSeq:
+ return KindNameInterpretedSeq
+ case KindIDCodepointPrefix:
+ return KindNameCodepointPrefix
+ case KindIDLBrace:
+ return KindNameLBrace
+ case KindIDRBrace:
+ return KindNameRBrace
+ case KindIDHexDigits:
+ return KindNameHexDigits
+ case KindIDEscapedSeq:
+ return KindNameEscapedSeq
+ case KindIDEscapeChar:
+ return KindNameEscapeChar
+ case KindIDInterpretedStringClose:
+ return KindNameInterpretedStringClose
}
return ""
}
@@ -391,27 +447,52 @@ func NewLexSpec() *lexSpec {
pop: [][]bool{
nil,
{
- false, false, false, false, false,
+ false, false, false, false, false, false, false,
+ },
+ {
+ false, false, true,
+ },
+ {
+ false, false, false, false, false, false, false, false, true,
},
},
push: [][]ModeID{
nil,
{
- 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 2, 3,
+ },
+ {
+ 0, 0, 0,
+ },
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0,
},
},
modeNames: []string{
ModeNameNil,
ModeNameDefault,
+ ModeNameRawString,
+ ModeNameInterpretedString,
},
initialStates: []StateID{
0,
1,
+ 1,
+ 1,
},
acceptances: [][]ModeKindID{
nil,
{
- 0, 0, 1, 4, 2, 3,
+ 0, 0, 1, 4, 2, 3, 5, 6,
+ },
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
+ },
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,
+ 5, 2, 3, 4, 6, 8,
},
},
kindIDs: [][]KindID{
@@ -422,6 +503,24 @@ func NewLexSpec() *lexSpec {
KindIDLParen,
KindIDRParen,
KindIDIdentifier,
+ KindIDRawStringOpen,
+ KindIDInterpretedStringOpen,
+ },
+ {
+ KindIDNil,
+ KindIDRawStringBody,
+ KindIDRawStringClose,
+ },
+ {
+ KindIDNil,
+ KindIDInterpretedSeq,
+ KindIDCodepointPrefix,
+ KindIDLBrace,
+ KindIDRBrace,
+ KindIDHexDigits,
+ KindIDEscapedSeq,
+ KindIDEscapeChar,
+ KindIDInterpretedStringClose,
},
},
kindNames: []string{
@@ -430,6 +529,18 @@ func NewLexSpec() *lexSpec {
KindNameLParen,
KindNameRParen,
KindNameIdentifier,
+ KindNameRawStringOpen,
+ KindNameInterpretedStringOpen,
+ KindNameRawStringBody,
+ KindNameRawStringClose,
+ KindNameInterpretedSeq,
+ KindNameCodepointPrefix,
+ KindNameLBrace,
+ KindNameRBrace,
+ KindNameHexDigits,
+ KindNameEscapedSeq,
+ KindNameEscapeChar,
+ KindNameInterpretedStringClose,
},
initialModeID: ModeIDDefault,
modeIDNil: ModeIDNil,
@@ -439,7 +550,16 @@ func NewLexSpec() *lexSpec {
rowNums: [][]int{
nil,
{
- 0, 1, 2, 3, 0, 0,
+ 0, 1, 2, 3, 0, 0, 0, 0,
+ },
+ {
+ 0, 1, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 8, 2, 9, 10, 2, 11, 12, 2,
+ 13, 2, 14, 2, 15, 2, 16, 2, 17, 2, 18, 19, 2, 20, 21, 2, 22, 23, 2, 0,
+ },
+ {
+ 0, 1, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 8, 2, 9, 10, 2, 11, 12, 2,
+ 13, 2, 14, 2, 15, 2, 16, 2, 17, 2, 18, 19, 2, 20, 21, 2, 22, 23, 2, 24,
+ 25, 0, 0, 0, 0, 0,
},
},
rowDisplacements: [][]int{
@@ -447,12 +567,20 @@ func NewLexSpec() *lexSpec {
{
0, 0, 189, 75,
},
+ {
+ 0, 0, 246, 1194, 362, 1258, 426, 1114, 490, 554, 618, 1355, 682, 245, 1259, 746, 1323, 810, 1162, 874,
+ 938, 1002, 1371, 1066,
+ },
+ {
+ 0, 0, 246, 1194, 362, 1258, 426, 1114, 490, 554, 618, 1436, 682, 245, 1259, 746, 1323, 810, 1162, 874,
+ 938, 1002, 1452, 1066, 1504, 1435,
+ },
},
bounds: [][]int{
nil,
{
-1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 1,
1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1,
-1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1,
@@ -475,12 +603,186 @@ func NewLexSpec() *lexSpec {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1,
},
+ {
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, -1, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13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
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -1, 14,
+ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1,
+ },
+ {
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, -1,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 13, 13, 13, 13, 13, 13, 13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 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -1, 14,
+ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, -1, -1, -1, -1, -1, -1, -1,
+ 25, 25, 25, 25, 25, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 25, 25, 25, 25, 25, 25, 24, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 24, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ },
},
entries: [][]StateID{
nil,
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 7, 0, 0, 0, 0, 6,
4, 5, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0,
0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 3, 0, 3, 3, 3,
@@ -503,6 +805,180 @@ func NewLexSpec() *lexSpec {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
},
+ {
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 39,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 9, 9,
+ 11, 14, 14, 14, 17, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 0, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 26, 28, 28, 30, 33, 33, 33, 36, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 29, 29,
+ 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+ 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+ 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+ 29, 29, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 38, 38, 38, 38, 38, 38,
+ 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
+ 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
+ 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 0, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0,
+ },
+ {
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 45, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 20, 20,
+ 20, 20, 20, 20, 20, 40, 40, 40, 40, 40, 40, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 39, 20, 20, 20, 20, 40, 40, 40,
+ 40, 40, 40, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 42, 20, 43, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 9, 9,
+ 11, 14, 14, 14, 17, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 20, 20,
+ 20, 20, 0, 0, 0, 0, 0, 0, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 0, 20, 0, 20, 20, 0, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 26, 28, 28, 30, 33, 33, 33, 36, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 29, 29,
+ 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+ 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+ 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+ 29, 29, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 38, 38, 38, 38, 38, 38,
+ 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
+ 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
+ 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 0, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 0, 0, 0, 0, 0, 0, 0,
+ 40, 40, 40, 40, 40, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 40, 40, 40, 40, 40, 44, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 44, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ },
},
originalColCounts: nil,
}
diff --git a/spec/test/tree_parser.go b/spec/test/tree_parser.go
index 567e3b0..bcbe382 100644
--- a/spec/test/tree_parser.go
+++ b/spec/test/tree_parser.go
@@ -7,9 +7,6 @@ import (
)
type Grammar interface {
- // Class returns a class of grammar.
- Class() string
-
// InitialState returns the initial state of a parser.
InitialState() int
@@ -90,7 +87,7 @@ type SyntaxError struct {
type ParserOption func(p *Parser) error
-// DisableLAC disables LAC (lookahead correction). When the grammar has the LALR class, LAC is enabled by default.
+// DisableLAC disables LAC (lookahead correction). LAC is enabled by default.
func DisableLAC() ParserOption {
return func(p *Parser) error {
p.disableLAC = true
@@ -123,10 +120,6 @@ func NewParser(toks TokenStream, gram Grammar, opts ...ParserOption) (*Parser, e
stateStack: &stateStack{},
}
- if p.gram.Class() != "lalr" {
- p.disableLAC = true
- }
-
for _, opt := range opts {
err := opt(p)
if err != nil {
@@ -443,32 +436,97 @@ type grammarImpl struct {
func NewGrammar() *grammarImpl {
return &grammarImpl{
recoverProductions: []int{
- 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 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 1, 1, 1, 1, 4,
},
errorTrapperStates: []int{
- 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
},
nonTerminals: []string{
"",
"tree'",
"tree",
"tree_list",
+ "string",
+ "raw_string",
+ "opt_raw_string_body",
+ "interpreted_string",
+ "opt_interpreted_string_body",
+ "interpreted_string_body",
+ "interpreted_string_elem",
+ "codepoint_expr",
},
lhsSymbols: []int{
- 0, 1, 2, 2, 3, 3, 3,
+ 0, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10,
+ 10, 10, 10, 10, 10, 10, 11,
},
terminals: []string{
"",
@@ -478,6 +536,18 @@ func NewGrammar() *grammarImpl {
"l_paren",
"r_paren",
"identifier",
+ "raw_string_open",
+ "raw_string_body",
+ "raw_string_close",
+ "interpreted_string_open",
+ "interpreted_seq",
+ "codepoint_prefix",
+ "l_brace",
+ "r_brace",
+ "hex_digits",
+ "escaped_seq",
+ "escape_char",
+ "interpreted_string_close",
},
terminalAliases: []string{
"",
@@ -487,6 +557,18 @@ func NewGrammar() *grammarImpl {
"(",
")",
"",
+ "",
+ "",
+ "",
+ "\"",
+ "",
+ "\\u",
+ "{",
+ "}",
+ "",
+ "",
+ "\\",
+ "\"",
},
astActions: [][]int{
nil,
@@ -495,6 +577,9 @@ func NewGrammar() *grammarImpl {
2, -3,
},
{
+ 2, 3,
+ },
+ {
2,
},
{
@@ -502,14 +587,43 @@ func NewGrammar() *grammarImpl {
},
nil,
nil,
+ nil,
+ nil,
+ {
+ -2,
+ },
+ nil,
+ nil,
+ {
+ -2,
+ },
+ {
+ 2,
+ },
+ {
+ -1,
+ },
+ nil,
+ {
+ -1, -2,
+ },
+ {
+ -1,
+ },
+ nil,
+ nil,
+ nil,
+ nil,
+ nil,
+ nil,
+ nil,
+ {
+ 3,
+ },
},
}
}
-func (g *grammarImpl) Class() string {
- return "lalr"
-}
-
func (g *grammarImpl) InitialState() int {
return 0
}
@@ -523,11 +637,11 @@ func (g *grammarImpl) RecoverProduction(prod int) bool {
}
func (g *grammarImpl) Action(state int, terminal int) int {
- return g.action[state*7+terminal]
+ return g.action[state*19+terminal]
}
func (g *grammarImpl) GoTo(state int, lhs int) int {
- return g.goTo[state*4+lhs]
+ return g.goTo[state*12+lhs]
}
func (g *grammarImpl) AlternativeSymbolCount(prod int) int {
@@ -535,7 +649,7 @@ func (g *grammarImpl) AlternativeSymbolCount(prod int) int {
}
func (g *grammarImpl) TerminalCount() int {
- return 7
+ return 19
}
func (g *grammarImpl) ErrorTrapperState(state int) bool {
@@ -601,11 +715,11 @@ func (t *vToken) Position() (int, int) {
}
var kindToTerminal = []int{
- 0, 3, 4, 5, 6,
+ 0, 3, 4, 5, 6, 7, 10, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18,
}
var skip = []int{
- 0, 1, 0, 0, 0,
+ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}
type tokenStream struct {
diff --git a/spec/test/tree_semantic_action.go b/spec/test/tree_semantic_action.go
index 9e240c2..c426183 100644
--- a/spec/test/tree_semantic_action.go
+++ b/spec/test/tree_semantic_action.go
@@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"io"
+ "strconv"
)
// SemanticActionSet is a set of semantic actions a parser calls.
@@ -271,6 +272,19 @@ func (n *Node) MarshalJSON() ([]byte, error) {
KindName: n.KindName,
})
case NodeTypeTerminal:
+ if n.KindName == "" {
+ return json.Marshal(struct {
+ Type NodeType `json:"type"`
+ Text string `json:"text"`
+ Row int `json:"row"`
+ Col int `json:"col"`
+ }{
+ Type: n.Type,
+ Text: n.Text,
+ Row: n.Row,
+ Col: n.Col,
+ })
+ }
return json.Marshal(struct {
Type NodeType `json:"type"`
KindName string `json:"kind_name"`
@@ -325,9 +339,13 @@ func printTree(w io.Writer, node *Node, ruledLine string, childRuledLinePrefix s
switch node.Type {
case NodeTypeError:
- fmt.Fprintf(w, "%v!%v\n", ruledLine, node.KindName)
+ fmt.Fprintf(w, "%v%v\n", ruledLine, node.KindName)
case NodeTypeTerminal:
- fmt.Fprintf(w, "%v%v %#v\n", ruledLine, node.KindName, node.Text)
+ if node.KindName == "" {
+ fmt.Fprintf(w, "%v<anonymous> %v\n", ruledLine, strconv.Quote(node.Text))
+ } else {
+ fmt.Fprintf(w, "%v%v %v\n", ruledLine, node.KindName, strconv.Quote(node.Text))
+ }
case NodeTypeNonTerminal:
fmt.Fprintf(w, "%v%v\n", ruledLine, node.KindName)
diff --git a/tester/tester.go b/tester/tester.go
index a39026a..187e36c 100644
--- a/tester/tester.go
+++ b/tester/tester.go
@@ -166,6 +166,10 @@ func runTest(g *gspec.CompiledGrammar, c *TestCaseWithMetadata) *TestResult {
}
func ConvertSyntaxTreeToTestableTree(dTree *driver.Node) *tspec.Tree {
+ if dTree.Text != "" {
+ return tspec.NewTerminalNode(dTree.KindName, dTree.Text)
+ }
+
var children []*tspec.Tree
if len(dTree.Children) > 0 {
children = make([]*tspec.Tree, len(dTree.Children))
@@ -173,5 +177,5 @@ func ConvertSyntaxTreeToTestableTree(dTree *driver.Node) *tspec.Tree {
children[i] = ConvertSyntaxTreeToTestableTree(c)
}
}
- return tspec.NewTree(dTree.KindName, children...)
+ return tspec.NewNonTerminalTree(dTree.KindName, children...)
}
diff --git a/tester/tester_test.go b/tester/tester_test.go
index 957d739..fb007ca 100644
--- a/tester/tester_test.go
+++ b/tester/tester_test.go
@@ -1,6 +1,7 @@
package tester
import (
+ "fmt"
"strings"
"testing"
@@ -58,7 +59,7 @@ Test
foo bar baz
---
(s
- (foo) (bar) (baz))
+ (foo 'foo') (bar 'bar') (baz 'baz'))
`,
},
{
@@ -69,7 +70,7 @@ Test
foo ? baz
---
(s
- (foo) (error) (baz))
+ (foo 'foo') (error) (baz 'baz'))
`,
},
{
@@ -116,55 +117,57 @@ foo foo foo
---
(s
(foos
- (foo) (foo) (foo)))
+ (foo 'foo') (foo 'foo') (foo 'foo')))
`,
},
}
- for _, tt := range tests {
- ast, err := gspec.Parse(strings.NewReader(tt.grammarSrc))
- if err != nil {
- t.Fatal(err)
- }
- b := grammar.GrammarBuilder{
- AST: ast,
- }
- g, err := b.Build()
- if err != nil {
- t.Fatal(err)
- }
- cg, _, err := grammar.Compile(g)
- if err != nil {
- t.Fatal(err)
- }
- c, err := tspec.ParseTestCase(strings.NewReader(tt.testSrc))
- if err != nil {
- t.Fatal(err)
- }
- tester := &Tester{
- Grammar: cg,
- Cases: []*TestCaseWithMetadata{
- {
- TestCase: c,
- },
- },
- }
- rs := tester.Run()
- if tt.error {
- errOccurred := false
- for _, r := range rs {
- if r.Error != nil {
- errOccurred = true
- }
+ for i, tt := range tests {
+ t.Run(fmt.Sprintf("#%v", i), func(t *testing.T) {
+ ast, err := gspec.Parse(strings.NewReader(tt.grammarSrc))
+ if err != nil {
+ t.Fatal(err)
+ }
+ b := grammar.GrammarBuilder{
+ AST: ast,
+ }
+ g, err := b.Build()
+ if err != nil {
+ t.Fatal(err)
+ }
+ cg, _, err := grammar.Compile(g)
+ if err != nil {
+ t.Fatal(err)
}
- if !errOccurred {
- t.Fatal("this test must fail, but it passed")
+ c, err := tspec.ParseTestCase(strings.NewReader(tt.testSrc))
+ if err != nil {
+ t.Fatal(err)
}
- } else {
- for _, r := range rs {
- if r.Error != nil {
- t.Fatalf("unexpected error occurred: %v", r.Error)
+ tester := &Tester{
+ Grammar: cg,
+ Cases: []*TestCaseWithMetadata{
+ {
+ TestCase: c,
+ },
+ },
+ }
+ rs := tester.Run()
+ if tt.error {
+ errOccurred := false
+ for _, r := range rs {
+ if r.Error != nil {
+ errOccurred = true
+ }
+ }
+ if !errOccurred {
+ t.Fatal("this test must fail, but it passed")
+ }
+ } else {
+ for _, r := range rs {
+ if r.Error != nil {
+ t.Fatalf("unexpected error occurred: %v", r.Error)
+ }
}
}
- }
+ })
}
}