diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2022-03-28 01:30:49 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2022-03-28 01:45:11 +0900 |
commit | 1746609e248151d575f6e3913ad5023fd421bfff (patch) | |
tree | 9312ac986191b3798125e2d3cc41518601d9b9e2 | |
parent | Follow golangci-lint (diff) | |
download | urubu-1746609e248151d575f6e3913ad5023fd421bfff.tar.gz urubu-1746609e248151d575f6e3913ad5023fd421bfff.tar.xz |
Simplify the syntax of #ast directive
This change allows using the simple syntax of the directive like `#ast $1 $3...` instead of `#ast #(foo $1 $3...)`.
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | README.md | 8 | ||||
-rw-r--r-- | driver/parser_test.go | 23 | ||||
-rw-r--r-- | grammar/grammar.go | 59 | ||||
-rw-r--r-- | spec/lexer.go | 6 | ||||
-rw-r--r-- | spec/lexer_test.go | 4 | ||||
-rw-r--r-- | spec/lexspec.json | 8 | ||||
-rw-r--r-- | spec/parser.go | 56 | ||||
-rw-r--r-- | spec/parser_test.go | 106 | ||||
-rw-r--r-- | spec/syntax_error.go | 18 | ||||
-rw-r--r-- | spec/vartan_lexer.go | 74 |
11 files changed, 131 insertions, 233 deletions
@@ -1 +1 @@ -spec/clspec.json +spec/clexspec.json @@ -38,14 +38,14 @@ expr | func_call | integer | id - | '(' expr ')' #ast #(expr $2) + | '(' expr ')' #ast $2 ; func_call - : id '(' args ')' #ast #(func_call $1 $3) - | id '(' ')' #ast #(func_call $1) + : id '(' args ')' #ast $1 $3 + | id '(' ')' #ast $1 ; args - : args ',' expr #ast #(args $1... $3) + : args ',' expr #ast $1... $3 | expr ; diff --git a/driver/parser_test.go b/driver/parser_test.go index 89d0e79..3f67bf2 100644 --- a/driver/parser_test.go +++ b/driver/parser_test.go @@ -322,10 +322,10 @@ fragment words: "[A-Za-z\u{0020}]+"; %name test list - : "\[" elems "]" #ast #(list $2...) + : "\[" elems "]" #ast $2... ; elems - : elems "," id #ast #(elems $1... $3) + : elems "," id #ast $1... $3 | id ; whitespace: "\u{0020}+" #skip; @@ -353,21 +353,6 @@ id: "[A-Za-z]+"; termNode("id", "Langly"), ), }, - // The first element of a tree structure must be the same ID as an LHS of a production. - { - specSrc: ` -%name test - -s - : foo #ast #(start $1) - ; -foo - : bar - ; -bar: "bar"; -`, - specErr: true, - }, // An ast action cannot be applied to a terminal symbol. { specSrc: ` @@ -377,7 +362,7 @@ s : foo ; foo - : "foo" #ast #(s $1...) + : "foo" #ast $1... ; `, specErr: true, @@ -388,7 +373,7 @@ foo %name test s - : foo #ast #(s $1...) + : foo #ast $1... ; foo: "foo"; `, diff --git a/grammar/grammar.go b/grammar/grammar.go index 7dbd0ed..9d1933b 100644 --- a/grammar/grammar.go +++ b/grammar/grammar.go @@ -759,69 +759,68 @@ func (b *GrammarBuilder) genProductionsAndActions(root *spec.RootNode, symTabAnd dir := alt.Directive switch dir.Name { case "ast": - if len(dir.Parameters) != 1 || dir.Parameters[0].Tree == nil { + if len(dir.Parameters) == 0 { b.errs = append(b.errs, &verr.SpecError{ Cause: semErrDirInvalidParam, - Detail: "'ast' directive needs a tree parameter", + Detail: "'ast' directive needs at least one symbol position parameter", Row: dir.Pos.Row, Col: dir.Pos.Col, }) continue LOOP_RHS } - param := dir.Parameters[0] - lhsText, ok := symTab.toText(p.lhs) - if !ok || param.Tree.Name != lhsText { - b.errs = append(b.errs, &verr.SpecError{ - Cause: semErrDirInvalidParam, - Detail: fmt.Sprintf("a name of a tree structure must be the same ID as an LHS of a production; LHS: %v", lhsText), - Row: param.Pos.Row, - Col: param.Pos.Col, - }) - continue LOOP_RHS - } - astAct := make([]*astActionEntry, len(param.Tree.Children)) - for i, c := range param.Tree.Children { - if c.Position > len(alt.Elements) { + astAct := make([]*astActionEntry, len(dir.Parameters)) + for i, param := range dir.Parameters { + if param.SymbolPosition == nil { + b.errs = append(b.errs, &verr.SpecError{ + Cause: semErrDirInvalidParam, + Detail: "'ast' directive can take only symbol position parameters", + Row: dir.Pos.Row, + Col: dir.Pos.Col, + }) + continue LOOP_RHS + } + symPos := param.SymbolPosition + if symPos.Position > len(alt.Elements) { b.errs = append(b.errs, &verr.SpecError{ Cause: semErrDirInvalidParam, - Detail: fmt.Sprintf("a position must be less than or equal to the length of an alternativ (%v)", len(alt.Elements)), - Row: c.Pos.Row, - Col: c.Pos.Col, + Detail: fmt.Sprintf("a symbol position must be less than or equal to the length of an alternativ (%v)", len(alt.Elements)), + Row: symPos.Pos.Row, + Col: symPos.Pos.Col, }) continue LOOP_RHS } - if c.Expansion { - offset := c.Position - 1 + if symPos.Expansion { + offset := symPos.Position - 1 elem := alt.Elements[offset] if elem.Pattern != "" { b.errs = append(b.errs, &verr.SpecError{ Cause: semErrDirInvalidParam, - Detail: fmt.Sprintf("the expansion symbol cannot be applied to a pattern ($%v: %v)", c.Position, elem.Pattern), - Row: c.Pos.Row, - Col: c.Pos.Col, + Detail: fmt.Sprintf("the expansion symbol cannot be applied to a pattern ($%v: %v)", symPos.Position, elem.Pattern), + Row: symPos.Pos.Row, + Col: symPos.Pos.Col, }) continue LOOP_RHS } elemSym, ok := symTab.toSymbol(elem.ID) if !ok { // If the symbol was not found, it's a bug. - return nil, fmt.Errorf("a symbol corresponding to a position ($%v: %v) was not found", c.Position, elem.ID) + return nil, fmt.Errorf("a symbol corresponding to a position ($%v: %v) was not found", symPos.Position, elem.ID) } if elemSym.isTerminal() { b.errs = append(b.errs, &verr.SpecError{ Cause: semErrDirInvalidParam, - Detail: fmt.Sprintf("the expansion symbol cannot be applied to a terminal symbol ($%v: %v)", c.Position, elem.ID), - Row: c.Pos.Row, - Col: c.Pos.Col, + Detail: fmt.Sprintf("the expansion symbol cannot be applied to a terminal symbol ($%v: %v)", symPos.Position, elem.ID), + Row: symPos.Pos.Row, + Col: symPos.Pos.Col, }) continue LOOP_RHS } } astAct[i] = &astActionEntry{ - position: c.Position, - expansion: c.Expansion, + position: symPos.Position, + expansion: symPos.Expansion, } } astActs[p.id] = astAct diff --git a/spec/lexer.go b/spec/lexer.go index ba64925..d1cb67d 100644 --- a/spec/lexer.go +++ b/spec/lexer.go @@ -24,8 +24,6 @@ const ( tokenKindOr = tokenKind("|") tokenKindSemicolon = tokenKind(";") tokenKindDirectiveMarker = tokenKind("#") - tokenKindTreeNodeOpen = tokenKind("#(") - tokenKindTreeNodeClose = tokenKind(")") tokenKindPosition = tokenKind("$") tokenKindExpantion = tokenKind("...") tokenKindMetaDataMarker = tokenKind("%") @@ -273,10 +271,6 @@ func (l *lexer) lexAndSkipWSs() (*token, error) { return newSymbolToken(tokenKindSemicolon, newPosition(tok.Row+1, tok.Col+1)), nil case KindIDDirectiveMarker: return newSymbolToken(tokenKindDirectiveMarker, newPosition(tok.Row+1, tok.Col+1)), nil - case KindIDTreeNodeOpen: - return newSymbolToken(tokenKindTreeNodeOpen, newPosition(tok.Row+1, tok.Col+1)), nil - case KindIDTreeNodeClose: - return newSymbolToken(tokenKindTreeNodeClose, newPosition(tok.Row+1, tok.Col+1)), nil case KindIDPosition: // Remove '$' character and convert to an integer. num, err := strconv.Atoi(string(tok.Lexeme)[1:]) diff --git a/spec/lexer_test.go b/spec/lexer_test.go index 43b192f..08939ee 100644 --- a/spec/lexer_test.go +++ b/spec/lexer_test.go @@ -40,7 +40,7 @@ func TestLexer_Run(t *testing.T) { }{ { caption: "the lexer can recognize all kinds of tokens", - src: `id"terminal"'string':|;#()$1...#%`, + src: `id"terminal"'string':|;$1...#%`, tokens: []*token{ idTok("id"), termPatTok("terminal"), @@ -48,8 +48,6 @@ func TestLexer_Run(t *testing.T) { symTok(tokenKindColon), symTok(tokenKindOr), symTok(tokenKindSemicolon), - symTok(tokenKindTreeNodeOpen), - symTok(tokenKindTreeNodeClose), posTok(1), symTok(tokenKindExpantion), symTok(tokenKindDirectiveMarker), diff --git a/spec/lexspec.json b/spec/lexspec.json index 8175f99..a60624e 100644 --- a/spec/lexspec.json +++ b/spec/lexspec.json @@ -106,14 +106,6 @@ "pattern": ";" }, { - "kind": "tree_node_open", - "pattern": "#\\(" - }, - { - "kind": "tree_node_close", - "pattern": "\\)" - }, - { "kind": "position", "pattern": "$(0|[1-9][0-9]*)" }, diff --git a/spec/parser.go b/spec/parser.go index 7f3d8f7..a453538 100644 --- a/spec/parser.go +++ b/spec/parser.go @@ -49,19 +49,13 @@ type DirectiveNode struct { } type ParameterNode struct { - ID string - String string - Tree *TreeStructNode - Pos Position + ID string + String string + SymbolPosition *SymbolPositionNode + Pos Position } -type TreeStructNode struct { - Name string - Children []*TreeChildNode - Pos Position -} - -type TreeChildNode struct { +type SymbolPositionNode struct { Position int Expansion bool Pos Position @@ -449,41 +443,17 @@ func (p *parser) parseParameter() *ParameterNode { String: p.lastTok.text, Pos: p.lastTok.pos, } - case p.consume(tokenKindTreeNodeOpen): - if !p.consume(tokenKindID) { - raiseSyntaxError(p.pos.Row, synErrTreeInvalidFirstElem) - } - name := p.lastTok.text - namePos := p.lastTok.pos - - var children []*TreeChildNode - for { - if !p.consume(tokenKindPosition) { - break - } - - child := &TreeChildNode{ - Position: p.lastTok.num, - Pos: p.lastTok.pos, - } - if p.consume(tokenKindExpantion) { - child.Expansion = true - } - - children = append(children, child) + case p.consume(tokenKindPosition): + symPos := &SymbolPositionNode{ + Position: p.lastTok.num, + Pos: p.lastTok.pos, } - - if !p.consume(tokenKindTreeNodeClose) { - raiseSyntaxError(p.pos.Row, synErrTreeUnclosed) + if p.consume(tokenKindExpantion) { + symPos.Expansion = true } - return &ParameterNode{ - Tree: &TreeStructNode{ - Name: name, - Children: children, - Pos: namePos, - }, - Pos: namePos, + SymbolPosition: symPos, + Pos: symPos.Pos, } } diff --git a/spec/parser_test.go b/spec/parser_test.go index d20f6f9..154aea0 100644 --- a/spec/parser_test.go +++ b/spec/parser_test.go @@ -62,30 +62,24 @@ func TestParse(t *testing.T) { ID: id, } } - treeParam := func(name string, children ...*TreeChildNode) *ParameterNode { + symPosParam := func(symPos *SymbolPositionNode) *ParameterNode { return &ParameterNode{ - Tree: &TreeStructNode{ - Name: name, - Children: children, - }, + SymbolPosition: symPos, } } - withParamPos := func(param *ParameterNode, pos Position) *ParameterNode { - param.Pos = pos - return param - } - pos := func(pos int) *TreeChildNode { - return &TreeChildNode{ - Position: pos, + symPos := func(symPos int, exp bool) *SymbolPositionNode { + return &SymbolPositionNode{ + Position: symPos, + Expansion: exp, } } - exp := func(c *TreeChildNode) *TreeChildNode { - c.Expansion = true - return c + withSymPosPos := func(symPos *SymbolPositionNode, pos Position) *SymbolPositionNode { + symPos.Pos = pos + return symPos } - withTreeChildPos := func(child *TreeChildNode, pos Position) *TreeChildNode { - child.Pos = pos - return child + withParamPos := func(param *ParameterNode, pos Position) *ParameterNode { + param.Pos = pos + return param } id := func(id string) *ElementNode { return &ElementNode{ @@ -389,11 +383,11 @@ s: foo; foo: "foo"; caption: "a grammar can contain 'ast' directives", src: ` s - : foo bar_list #ast #(s $1 $2) + : foo bar_list #ast $1 $2 ; bar_list - : bar_list bar #ast #(bar_list $1... $2) - | bar #ast #(bar_list $1) + : bar_list bar #ast $1... $2 + | bar #ast $1 ; foo: "foo"; bar: "bar"; @@ -403,17 +397,17 @@ bar: "bar"; prod("s", withAltDir( alt(id("foo"), id("bar_list")), - dir("ast", treeParam("s", pos(1), pos(2))), + dir("ast", symPosParam(symPos(1, false)), symPosParam(symPos(2, false))), ), ), prod("bar_list", withAltDir( alt(id("bar_list"), id("bar")), - dir("ast", treeParam("bar_list", exp(pos(1)), pos(2))), + dir("ast", symPosParam(symPos(1, true)), symPosParam(symPos(2, false))), ), withAltDir( alt(id("bar")), - dir("ast", treeParam("bar_list", pos(1))), + dir("ast", symPosParam(symPos(1, false))), ), ), }, @@ -428,31 +422,11 @@ bar: "bar"; }, }, { - caption: "the first element of a tree structure must be an ID", - src: ` -s - : foo #ast #($1) - ; -foo: "foo"; -`, - synErr: synErrTreeInvalidFirstElem, - }, - { - caption: "a tree structure must be closed by ')'", - src: ` -s - : foo #ast #(s $1 - ; -foo: "foo"; -`, - synErr: synErrTreeUnclosed, - }, - { caption: "an AST has node positions", src: ` #mode default exp - : exp "\+" id #ast #(exp $1 $2) + : exp "\+" id #ast $1 $2 | id ; whitespace: "\u{0020}+" #skip; @@ -476,9 +450,15 @@ fragment number: "[0-9]"; withDirPos( dir("ast", withParamPos( - treeParam("exp", - withTreeChildPos(pos(1), newPos(4)), - withTreeChildPos(pos(2), newPos(4))), + symPosParam( + withSymPosPos(symPos(1, false), newPos(4)), + ), + newPos(4), + ), + withParamPos( + symPosParam( + withSymPosPos(symPos(2, false), newPos(4)), + ), newPos(4), ), ), @@ -774,27 +754,21 @@ func testParameter(t *testing.T, param, expected *ParameterNode, checkPosition b if param.ID != expected.ID { t.Fatalf("unexpected ID parameter; want: %v, got: %v", expected.ID, param.ID) } - if expected.Tree == nil && param.Tree != nil { - t.Fatalf("unexpected tree parameter; want: nil, got: %+v", param.Tree) + if param.String != expected.String { + t.Fatalf("unexpected string parameter; want: %v, got: %v", expected.ID, param.ID) } - if expected.Tree != nil { - if param.Tree == nil { - t.Fatalf("unexpected tree parameter; want: %+v, got: nil", expected.Tree) - } - if param.Tree.Name != expected.Tree.Name { - t.Fatalf("unexpected node name; want: %v, got: %v", expected.Tree.Name, param.Tree.Name) + if expected.SymbolPosition == nil && param.SymbolPosition != nil { + t.Fatalf("unexpected symbol position parameter; want: nil, got: %+v", param.SymbolPosition) + } + if expected.SymbolPosition != nil { + if param.SymbolPosition == nil { + t.Fatalf("unexpected symbol position parameter; want: %+v, got: nil", expected.SymbolPosition) } - if len(param.Tree.Children) != len(expected.Tree.Children) { - t.Fatalf("unexpected children; want: %v, got: %v", expected.Tree.Children, param.Tree.Children) + if param.SymbolPosition.Position != expected.SymbolPosition.Position { + t.Fatalf("unexpected symbol position; want: %v, got: %v", expected.SymbolPosition.Position, param.SymbolPosition.Position) } - for i, c := range param.Tree.Children { - e := expected.Tree.Children[i] - if c.Position != e.Position || c.Expansion != e.Expansion { - t.Fatalf("unexpected child; want: %+v, got: %+v", e, c) - } - if checkPosition { - testPosition(t, c.Pos, e.Pos) - } + if checkPosition { + testPosition(t, param.Pos, expected.Pos) } } if checkPosition { diff --git a/spec/syntax_error.go b/spec/syntax_error.go index a35a90c..ae65b35 100644 --- a/spec/syntax_error.go +++ b/spec/syntax_error.go @@ -25,14 +25,12 @@ var ( synErrZeroPos = newSyntaxError("a position must be greater than or equal to 1") // syntax errors - synErrInvalidToken = newSyntaxError("invalid token") - synErrNoProductionName = newSyntaxError("a production name is missing") - synErrNoColon = newSyntaxError("the colon must precede alternatives") - synErrNoSemicolon = newSyntaxError("the semicolon is missing at the last of an alternative") - synErrNoDirectiveName = newSyntaxError("a directive needs a name") - synErrProdDirNoNewline = newSyntaxError("a production directive must be followed by a newline") - synErrSemicolonNoNewline = newSyntaxError("a semicolon must be followed by a newline") - synErrFragmentNoPattern = newSyntaxError("a fragment needs one pattern element") - synErrTreeInvalidFirstElem = newSyntaxError("the first element of a tree structure must be an ID") - synErrTreeUnclosed = newSyntaxError("unclosed tree structure") + synErrInvalidToken = newSyntaxError("invalid token") + synErrNoProductionName = newSyntaxError("a production name is missing") + synErrNoColon = newSyntaxError("the colon must precede alternatives") + synErrNoSemicolon = newSyntaxError("the semicolon is missing at the last of an alternative") + synErrNoDirectiveName = newSyntaxError("a directive needs a name") + synErrProdDirNoNewline = newSyntaxError("a production directive must be followed by a newline") + synErrSemicolonNoNewline = newSyntaxError("a semicolon must be followed by a newline") + synErrFragmentNoPattern = newSyntaxError("a fragment needs one pattern element") ) diff --git a/spec/vartan_lexer.go b/spec/vartan_lexer.go index d282e04..063e429 100644 --- a/spec/vartan_lexer.go +++ b/spec/vartan_lexer.go @@ -353,19 +353,17 @@ const ( KindIDColon KindID = 8 KindIDOr KindID = 9 KindIDSemicolon KindID = 10 - KindIDTreeNodeOpen KindID = 11 - KindIDTreeNodeClose KindID = 12 - KindIDPosition KindID = 13 - KindIDExpansion KindID = 14 - KindIDDirectiveMarker KindID = 15 - KindIDMetadataMarker KindID = 16 - KindIDPattern KindID = 17 - KindIDTerminalClose KindID = 18 - KindIDEscapeSymbol KindID = 19 - KindIDCharSeq KindID = 20 - KindIDEscapedQuot KindID = 21 - KindIDEscapedBackSlash KindID = 22 - KindIDStringLiteralClose KindID = 23 + KindIDPosition KindID = 11 + KindIDExpansion KindID = 12 + KindIDDirectiveMarker KindID = 13 + KindIDMetadataMarker KindID = 14 + KindIDPattern KindID = 15 + KindIDTerminalClose KindID = 16 + KindIDEscapeSymbol KindID = 17 + KindIDCharSeq KindID = 18 + KindIDEscapedQuot KindID = 19 + KindIDEscapedBackSlash KindID = 20 + KindIDStringLiteralClose KindID = 21 ) const ( @@ -380,8 +378,6 @@ const ( KindNameColon = "colon" KindNameOr = "or" KindNameSemicolon = "semicolon" - KindNameTreeNodeOpen = "tree_node_open" - KindNameTreeNodeClose = "tree_node_close" KindNamePosition = "position" KindNameExpansion = "expansion" KindNameDirectiveMarker = "directive_marker" @@ -420,10 +416,6 @@ func KindIDToName(id KindID) string { return KindNameOr case KindIDSemicolon: return KindNameSemicolon - case KindIDTreeNodeOpen: - return KindNameTreeNodeOpen - case KindIDTreeNodeClose: - return KindNameTreeNodeClose case KindIDPosition: return KindNamePosition case KindIDExpansion: @@ -475,7 +467,7 @@ func NewLexSpec() *lexSpec { pop: [][]bool{ nil, { - false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, }, { false, false, true, false, @@ -487,7 +479,7 @@ func NewLexSpec() *lexSpec { push: [][]ModeID{ nil, { - 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, 0, 0, 0, 0, 0, }, { 0, 0, 0, 0, @@ -512,8 +504,8 @@ func NewLexSpec() *lexSpec { nil, { 0, 0, 1, 2, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 4, 5, 15, 0, 13, 0, 0, 2, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 16, + 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 4, 5, 0, 11, 0, 0, 2, 6, 7, + 8, 9, 10, 11, 12, 13, 14, }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -541,8 +533,6 @@ func NewLexSpec() *lexSpec { KindIDColon, KindIDOr, KindIDSemicolon, - KindIDTreeNodeOpen, - KindIDTreeNodeClose, KindIDPosition, KindIDExpansion, KindIDDirectiveMarker, @@ -575,8 +565,6 @@ func NewLexSpec() *lexSpec { KindNameColon, KindNameOr, KindNameSemicolon, - KindNameTreeNodeOpen, - KindNameTreeNodeClose, KindNamePosition, KindNameExpansion, KindNameDirectiveMarker, @@ -598,8 +586,8 @@ func NewLexSpec() *lexSpec { nil, { 0, 1, 2, 3, 4, 5, 6, 7, 6, 8, 6, 9, 6, 10, 6, 11, 12, 6, 13, 14, - 6, 15, 16, 6, 17, 18, 19, 20, 21, 22, 23, 24, 24, 25, 26, 27, 28, 29, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, + 6, 15, 16, 6, 17, 18, 19, 20, 21, 22, 23, 24, 24, 25, 26, 27, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, }, { 0, 1, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 8, 2, 9, 10, 2, 11, 12, 2, @@ -617,7 +605,7 @@ func NewLexSpec() *lexSpec { nil, { 0, 236, 1574, 1575, 1576, 0, 237, 1323, 301, 1387, 365, 1291, 429, 493, 557, 1419, 621, 765, 840, 915, - 990, 1065, 1140, 1215, 1290, 1577, 1515, 1525, 1578, 1579, + 990, 1065, 1140, 1215, 1290, 1515, 1525, 1578, 1579, }, { 0, 0, 736, 2548, 852, 2612, 916, 2372, 980, 1044, 1108, 2839, 1172, 245, 2613, 1236, 2677, 1300, 2420, 1364, @@ -645,7 +633,7 @@ func NewLexSpec() *lexSpec { 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, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, @@ -710,10 +698,10 @@ func NewLexSpec() *lexSpec { 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 2, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 25, -1, -1, - -1, -1, -1, 4, 28, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 15, 15, 15, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 2, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 4, 27, 28, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -990,13 +978,13 @@ func NewLexSpec() *lexSpec { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 11, 13, 13, - 15, 18, 18, 18, 21, 2, 38, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 39, 33, 34, 48, 0, 40, 0, 45, 0, 0, - 0, 0, 36, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 43, 0, 0, 0, 0, + 15, 18, 18, 18, 21, 2, 37, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 38, 45, 33, 46, 0, 39, 0, 0, 0, 0, + 0, 0, 35, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 42, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 32, 0, 32, 32, 32, 32, 32, 24, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, - 42, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 41, 0, 0, 0, 0, 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, 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, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, @@ -1056,10 +1044,10 @@ func NewLexSpec() *lexSpec { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 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, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 46, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 2, 0, 38, 0, 0, 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, 44, 0, 0, - 0, 0, 0, 5, 37, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 22, 22, 22, 43, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 2, 0, 37, 0, 0, 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, 5, 36, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |