From e65ace89842ea14fba67707eba5f5de9de8bf334 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 15 Apr 2018 14:47:40 +0300 Subject: [PATCH 01/25] merge token package into scanner package --- errors/error.go | 4 ++-- errors/error_test.go | 6 +++--- php5/parser.go | 5 ++--- php5/php5.go | 9 ++++----- php5/php5.y | 8 ++++---- php7/parser.go | 5 ++--- php7/php7.go | 9 ++++----- php7/php7.y | 8 ++++---- position/builder.go | 16 ++++++++-------- position/position_test.go | 28 ++++++++++++++-------------- scanner/lexer.go | 7 +++---- scanner/scanner_test.go | 5 ++--- {token => scanner}/token.go | 2 +- {token => scanner}/token_test.go | 6 +++--- 14 files changed, 56 insertions(+), 62 deletions(-) rename {token => scanner}/token.go (97%) rename {token => scanner}/token_test.go (81%) diff --git a/errors/error.go b/errors/error.go index 06ac931..0ac2023 100644 --- a/errors/error.go +++ b/errors/error.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/token" + "github.com/z7zmey/php-parser/scanner" ) // Error parsing error @@ -14,7 +14,7 @@ type Error struct { } // NewError creates and returns new Error -func NewError(msg string, t token.Token) *Error { +func NewError(msg string, t scanner.Token) *Error { return &Error{ Msg: msg, Pos: position.Position{ diff --git a/errors/error_test.go b/errors/error_test.go index 2892658..f5b1a47 100644 --- a/errors/error_test.go +++ b/errors/error_test.go @@ -7,7 +7,7 @@ import ( "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/errors" - "github.com/z7zmey/php-parser/token" + "github.com/z7zmey/php-parser/scanner" "github.com/kylelemons/godebug/pretty" ) @@ -26,7 +26,7 @@ func assertEqual(t *testing.T, expected interface{}, actual interface{}) { } func TestConstructor(t *testing.T) { - token := token.Token{ + token := scanner.Token{ Value: "test", StartLine: 1, EndLine: 2, @@ -50,7 +50,7 @@ func TestConstructor(t *testing.T) { } func TestPrint(t *testing.T) { - token := token.Token{ + token := scanner.Token{ Value: "test", StartLine: 1, EndLine: 2, diff --git a/php5/parser.go b/php5/parser.go index ffb9cc6..5df3681 100644 --- a/php5/parser.go +++ b/php5/parser.go @@ -8,10 +8,9 @@ import ( "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/scanner" - "github.com/z7zmey/php-parser/token" ) -func (lval *yySymType) Token(t token.Token) { +func (lval *yySymType) Token(t scanner.Token) { lval.token = t } @@ -19,7 +18,7 @@ func (lval *yySymType) Token(t token.Token) { type Parser struct { *scanner.Lexer path string - lastToken *token.Token + lastToken *scanner.Token positionBuilder *position.Builder errors []*errors.Error rootNode node.Node diff --git a/php5/php5.go b/php5/php5.go index c248a3f..523c6f8 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -16,14 +16,14 @@ import ( "github.com/z7zmey/php-parser/node/name" "github.com/z7zmey/php-parser/node/scalar" "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/token" + "github.com/z7zmey/php-parser/scanner" ) //line php5/php5.y:21 type yySymType struct { yys int node node.Node - token token.Token + token scanner.Token boolWithToken boolWithToken list []node.Node foreachVariable foreachVariable @@ -345,7 +345,6 @@ const yyErrCode = 2 const yyInitialStackSize = 16 //line php5/php5.y:3825 - type foreachVariable struct { node node.Node byRef bool @@ -353,12 +352,12 @@ type foreachVariable struct { type nodesWithEndToken struct { nodes []node.Node - endToken token.Token + endToken scanner.Token } type boolWithToken struct { value bool - token *token.Token + token *scanner.Token } type simpleIndirectReference struct { diff --git a/php5/php5.y b/php5/php5.y index f79ac9a..4a81af3 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -5,7 +5,7 @@ import ( "strings" "strconv" - "github.com/z7zmey/php-parser/token" + "github.com/z7zmey/php-parser/scanner" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/scalar" "github.com/z7zmey/php-parser/node/name" @@ -20,7 +20,7 @@ import ( %union{ node node.Node - token token.Token + token scanner.Token boolWithToken boolWithToken list []node.Node foreachVariable foreachVariable @@ -3831,12 +3831,12 @@ type foreachVariable struct { type nodesWithEndToken struct { nodes []node.Node - endToken token.Token + endToken scanner.Token } type boolWithToken struct { value bool - token *token.Token + token *scanner.Token } type simpleIndirectReference struct { diff --git a/php7/parser.go b/php7/parser.go index a8d3bd2..355189b 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -8,10 +8,9 @@ import ( "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/scanner" - "github.com/z7zmey/php-parser/token" ) -func (lval *yySymType) Token(t token.Token) { +func (lval *yySymType) Token(t scanner.Token) { lval.token = t } @@ -19,7 +18,7 @@ func (lval *yySymType) Token(t token.Token) { type Parser struct { *scanner.Lexer path string - lastToken *token.Token + lastToken *scanner.Token positionBuilder *position.Builder errors []*errors.Error rootNode node.Node diff --git a/php7/php7.go b/php7/php7.go index 891ad31..ee9c5e7 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -16,14 +16,14 @@ import ( "github.com/z7zmey/php-parser/node/name" "github.com/z7zmey/php-parser/node/scalar" "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/token" + "github.com/z7zmey/php-parser/scanner" ) //line php7/php7.y:21 type yySymType struct { yys int node node.Node - token token.Token + token scanner.Token boolWithToken boolWithToken list []node.Node foreachVariable foreachVariable @@ -345,7 +345,6 @@ const yyErrCode = 2 const yyInitialStackSize = 16 //line php7/php7.y:2635 - type foreachVariable struct { node node.Node byRef bool @@ -353,12 +352,12 @@ type foreachVariable struct { type nodesWithEndToken struct { nodes []node.Node - endToken token.Token + endToken scanner.Token } type boolWithToken struct { value bool - token *token.Token + token *scanner.Token } type altSyntaxNode struct { diff --git a/php7/php7.y b/php7/php7.y index 4b7b0f9..478ec97 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -5,7 +5,7 @@ import ( "strings" "strconv" - "github.com/z7zmey/php-parser/token" + "github.com/z7zmey/php-parser/scanner" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/scalar" "github.com/z7zmey/php-parser/node/name" @@ -20,7 +20,7 @@ import ( %union{ node node.Node - token token.Token + token scanner.Token boolWithToken boolWithToken list []node.Node foreachVariable foreachVariable @@ -2641,12 +2641,12 @@ type foreachVariable struct { type nodesWithEndToken struct { nodes []node.Node - endToken token.Token + endToken scanner.Token } type boolWithToken struct { value bool - token *token.Token + token *scanner.Token } type altSyntaxNode struct { diff --git a/position/builder.go b/position/builder.go index 2c2f990..1a98c2f 100644 --- a/position/builder.go +++ b/position/builder.go @@ -2,7 +2,7 @@ package position import ( "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/token" + "github.com/z7zmey/php-parser/scanner" ) // Builder provide functions to constuct positions @@ -99,7 +99,7 @@ func (b *Builder) NewNodePosition(n node.Node) *Position { } // NewTokenPosition returns new Position -func (b *Builder) NewTokenPosition(t token.Token) *Position { +func (b *Builder) NewTokenPosition(t scanner.Token) *Position { return &Position{ t.StartLine, t.EndLine, @@ -109,7 +109,7 @@ func (b *Builder) NewTokenPosition(t token.Token) *Position { } // NewTokensPosition returns new Position -func (b *Builder) NewTokensPosition(startToken token.Token, endToken token.Token) *Position { +func (b *Builder) NewTokensPosition(startToken scanner.Token, endToken scanner.Token) *Position { return &Position{ startToken.StartLine, endToken.EndLine, @@ -119,7 +119,7 @@ func (b *Builder) NewTokensPosition(startToken token.Token, endToken token.Token } // NewTokenNodePosition returns new Position -func (b *Builder) NewTokenNodePosition(t token.Token, n node.Node) *Position { +func (b *Builder) NewTokenNodePosition(t scanner.Token, n node.Node) *Position { return &Position{ t.StartLine, b.getNodeEndPos(n).endLine, @@ -129,7 +129,7 @@ func (b *Builder) NewTokenNodePosition(t token.Token, n node.Node) *Position { } // NewNodeTokenPosition returns new Position -func (b *Builder) NewNodeTokenPosition(n node.Node, t token.Token) *Position { +func (b *Builder) NewNodeTokenPosition(n node.Node, t scanner.Token) *Position { return &Position{ b.getNodeStartPos(n).startLine, t.EndLine, @@ -149,7 +149,7 @@ func (b *Builder) NewNodesPosition(startNode node.Node, endNode node.Node) *Posi } // NewNodeListTokenPosition returns new Position -func (b *Builder) NewNodeListTokenPosition(list []node.Node, t token.Token) *Position { +func (b *Builder) NewNodeListTokenPosition(list []node.Node, t scanner.Token) *Position { return &Position{ b.getListStartPos(list).startLine, t.EndLine, @@ -159,7 +159,7 @@ func (b *Builder) NewNodeListTokenPosition(list []node.Node, t token.Token) *Pos } // NewTokenNodeListPosition returns new Position -func (b *Builder) NewTokenNodeListPosition(t token.Token, list []node.Node) *Position { +func (b *Builder) NewTokenNodeListPosition(t scanner.Token, list []node.Node) *Position { return &Position{ t.StartLine, b.getListEndPos(list).endLine, @@ -179,7 +179,7 @@ func (b *Builder) NewNodeNodeListPosition(n node.Node, list []node.Node) *Positi } // NewOptionalListTokensPosition returns new Position -func (b *Builder) NewOptionalListTokensPosition(list []node.Node, t token.Token, endToken token.Token) *Position { +func (b *Builder) NewOptionalListTokensPosition(list []node.Node, t scanner.Token, endToken scanner.Token) *Position { if list == nil { return &Position{ t.StartLine, diff --git a/position/position_test.go b/position/position_test.go index 7cbc878..01f1985 100644 --- a/position/position_test.go +++ b/position/position_test.go @@ -6,13 +6,13 @@ import ( "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/token" + "github.com/z7zmey/php-parser/scanner" ) func TestNewTokenPosition(t *testing.T) { builder := position.Builder{} - tkn := token.NewToken([]byte(`foo`), 1, 1, 0, 3) + tkn := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) pos := builder.NewTokenPosition(tkn) @@ -24,8 +24,8 @@ func TestNewTokenPosition(t *testing.T) { func TestNewTokensPosition(t *testing.T) { builder := position.Builder{} - token1 := token.NewToken([]byte(`foo`), 1, 1, 0, 3) - token2 := token.NewToken([]byte(`foo`), 2, 2, 4, 6) + token1 := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) + token2 := scanner.NewToken([]byte(`foo`), 2, 2, 4, 6) pos := builder.NewTokensPosition(token1, token2) @@ -57,7 +57,7 @@ func TestNewNodePosition(t *testing.T) { } func TestNewTokenNodePosition(t *testing.T) { - tkn := token.NewToken([]byte(`foo`), 1, 1, 0, 3) + tkn := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) n := node.NewIdentifier("test node") p := &position.Positions{} @@ -81,7 +81,7 @@ func TestNewTokenNodePosition(t *testing.T) { func TestNewNodeTokenPosition(t *testing.T) { n := node.NewIdentifier("test node") - tkn := token.NewToken([]byte(`foo`), 2, 2, 10, 12) + tkn := scanner.NewToken([]byte(`foo`), 2, 2, 10, 12) p := &position.Positions{} p.AddPosition(n, &position.Position{ @@ -161,7 +161,7 @@ func TestNewNodesPosition(t *testing.T) { func TestNewNodeListTokenPosition(t *testing.T) { n1 := node.NewIdentifier("test node") n2 := node.NewIdentifier("test node") - tkn := token.NewToken([]byte(`foo`), 3, 3, 20, 22) + tkn := scanner.NewToken([]byte(`foo`), 3, 3, 20, 22) builder := position.Builder{ Positions: &position.Positions{ @@ -188,7 +188,7 @@ func TestNewNodeListTokenPosition(t *testing.T) { } func TestNewTokenNodeListPosition(t *testing.T) { - tkn := token.NewToken([]byte(`foo`), 1, 1, 0, 2) + tkn := scanner.NewToken([]byte(`foo`), 1, 1, 0, 2) n1 := node.NewIdentifier("test node") n2 := node.NewIdentifier("test node") @@ -254,8 +254,8 @@ func TestNewNodeNodeListPosition(t *testing.T) { func TestNewOptionalListTokensPosition(t *testing.T) { builder := position.Builder{} - token1 := token.NewToken([]byte(`foo`), 1, 1, 0, 3) - token2 := token.NewToken([]byte(`foo`), 2, 2, 4, 6) + token1 := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) + token2 := scanner.NewToken([]byte(`foo`), 2, 2, 4, 6) pos := builder.NewOptionalListTokensPosition(nil, token1, token2) @@ -292,8 +292,8 @@ func TestNewOptionalListTokensPosition2(t *testing.T) { }, } - token1 := token.NewToken([]byte(`foo`), 4, 4, 27, 29) - token2 := token.NewToken([]byte(`foo`), 5, 5, 30, 32) + token1 := scanner.NewToken([]byte(`foo`), 4, 4, 27, 29) + token2 := scanner.NewToken([]byte(`foo`), 5, 5, 30, 32) pos := builder.NewOptionalListTokensPosition([]node.Node{n2, n3}, token1, token2) @@ -334,7 +334,7 @@ func TestNilNodeListPos(t *testing.T) { } func TestNilNodeListTokenPos(t *testing.T) { - token1 := token.NewToken([]byte(`foo`), 1, 1, 0, 3) + token1 := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) builder := position.Builder{} @@ -367,7 +367,7 @@ func TestEmptyNodeListPos(t *testing.T) { } func TestEmptyNodeListTokenPos(t *testing.T) { - token1 := token.NewToken([]byte(`foo`), 1, 1, 0, 3) + token1 := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) builder := position.Builder{} diff --git a/scanner/lexer.go b/scanner/lexer.go index 0ddf176..d3b3b03 100644 --- a/scanner/lexer.go +++ b/scanner/lexer.go @@ -10,7 +10,6 @@ import ( "github.com/cznic/golex/lex" "github.com/z7zmey/php-parser/comment" - t "github.com/z7zmey/php-parser/token" ) // Allocate Character classes anywhere in [0x80, 0xFF]. @@ -431,7 +430,7 @@ const T_POW = 57481 // Lval parsers yySymType must implement this interface type Lval interface { - Token(tkn t.Token) + Token(tkn Token) } // Lexer php lexer @@ -509,7 +508,7 @@ func (l *Lexer) getCurrentState() int { return l.StateStack[len(l.StateStack)-1] } -func (l *Lexer) newToken(chars []lex.Char) t.Token { +func (l *Lexer) newToken(chars []lex.Char) Token { firstChar := chars[0] lastChar := chars[len(chars)-1] @@ -518,7 +517,7 @@ func (l *Lexer) newToken(chars []lex.Char) t.Token { startPos := int(firstChar.Pos()) endPos := int(lastChar.Pos()) - return t.NewToken(l.charsToBytes(chars), startLine, endLine, startPos, endPos).SetComments(l.Comments) + return NewToken(l.charsToBytes(chars), startLine, endLine, startPos, endPos).SetComments(l.Comments) } func (l *Lexer) addComment(c comment.Comment) { diff --git a/scanner/scanner_test.go b/scanner/scanner_test.go index 12b1bbd..6beed3c 100644 --- a/scanner/scanner_test.go +++ b/scanner/scanner_test.go @@ -8,7 +8,6 @@ import ( "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/scanner" - "github.com/z7zmey/php-parser/token" "github.com/kylelemons/godebug/pretty" ) @@ -27,10 +26,10 @@ func assertEqual(t *testing.T, expected interface{}, actual interface{}) { } type lval struct { - Tkn token.Token + Tkn scanner.Token } -func (lv *lval) Token(t token.Token) { +func (lv *lval) Token(t scanner.Token) { lv.Tkn = t } diff --git a/token/token.go b/scanner/token.go similarity index 97% rename from token/token.go rename to scanner/token.go index 0da6189..1154d6f 100644 --- a/token/token.go +++ b/scanner/token.go @@ -1,4 +1,4 @@ -package token +package scanner import ( "github.com/z7zmey/php-parser/comment" diff --git a/token/token_test.go b/scanner/token_test.go similarity index 81% rename from token/token_test.go rename to scanner/token_test.go index 5f61365..84173ca 100644 --- a/token/token_test.go +++ b/scanner/token_test.go @@ -1,4 +1,4 @@ -package token_test +package scanner_test import ( "reflect" @@ -6,11 +6,11 @@ import ( "github.com/z7zmey/php-parser/comment" - "github.com/z7zmey/php-parser/token" + "github.com/z7zmey/php-parser/scanner" ) func TestToken(t *testing.T) { - tkn := token.NewToken([]byte(`foo`), 1, 1, 0, 3) + tkn := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) c := []comment.Comment{ comment.NewPlainComment("test comment"), From c2f938e55c3abe0942347e4676c5731b0f7a5b3f Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 15 Apr 2018 15:55:33 +0300 Subject: [PATCH 02/25] merge DocComment and PlainComment --- comment/comment.go | 23 ++++++++++++----------- comment/comment_test.go | 6 +++--- comment/comments.go | 11 +++++++++++ comment/doc_comment.go | 17 ----------------- comment/plain_comment.go | 17 ----------------- php5/parser.go | 2 +- php7/parser.go | 2 +- scanner/lexer.go | 5 +++-- scanner/scanner.go | 14 +++++--------- scanner/scanner.l | 15 +++++---------- scanner/scanner_test.go | 32 ++++++++++++++++---------------- scanner/token.go | 6 +++--- scanner/token_test.go | 4 ++-- 13 files changed, 62 insertions(+), 92 deletions(-) create mode 100644 comment/comments.go delete mode 100644 comment/doc_comment.go delete mode 100644 comment/plain_comment.go diff --git a/comment/comment.go b/comment/comment.go index f65f067..c8713f2 100644 --- a/comment/comment.go +++ b/comment/comment.go @@ -1,16 +1,17 @@ package comment -import "github.com/z7zmey/php-parser/node" - -// Comment represents comment lines in the code -type Comment interface { - String() string +// Comment aggrigates information about comment /** +type Comment struct { + value string } -// Comments a collection of comment groups assigned to nodes -type Comments map[node.Node][]Comment - -// AddComments add comment group to the collection -func (c Comments) AddComments(node node.Node, comments []Comment) { - c[node] = append(c[node], comments...) +// NewComment - Comment constructor +func NewComment(value string) *Comment { + return &Comment{ + value, + } +} + +func (c *Comment) String() string { + return c.value } diff --git a/comment/comment_test.go b/comment/comment_test.go index a89b0e1..27980e9 100644 --- a/comment/comment_test.go +++ b/comment/comment_test.go @@ -10,9 +10,9 @@ import ( func TestComments(t *testing.T) { n := node.NewIdentifier("test") - commentGroup := []comment.Comment{ - comment.NewDocComment("/** hello world */"), - comment.NewPlainComment("// hello world"), + commentGroup := []*comment.Comment{ + comment.NewComment("/** hello world */"), + comment.NewComment("// hello world"), } comments := comment.Comments{} diff --git a/comment/comments.go b/comment/comments.go new file mode 100644 index 0000000..8ef687d --- /dev/null +++ b/comment/comments.go @@ -0,0 +1,11 @@ +package comment + +import "github.com/z7zmey/php-parser/node" + +// Comments a collection of comment groups assigned to nodes +type Comments map[node.Node][]*Comment + +// AddComments add comment group to the collection +func (c Comments) AddComments(node node.Node, comments []*Comment) { + c[node] = append(c[node], comments...) +} diff --git a/comment/doc_comment.go b/comment/doc_comment.go deleted file mode 100644 index c0b9a93..0000000 --- a/comment/doc_comment.go +++ /dev/null @@ -1,17 +0,0 @@ -package comment - -// DocComment represents comments that start /** -type DocComment struct { - value string -} - -// NewDocComment - DocComment constructor -func NewDocComment(value string) *DocComment { - return &DocComment{ - value, - } -} - -func (c *DocComment) String() string { - return c.value -} diff --git a/comment/plain_comment.go b/comment/plain_comment.go deleted file mode 100644 index 89371a8..0000000 --- a/comment/plain_comment.go +++ /dev/null @@ -1,17 +0,0 @@ -package comment - -// PlainComment represents comments that dont start /** -type PlainComment struct { - value string -} - -// NewPlainComment - PlainComment constructor -func NewPlainComment(value string) *PlainComment { - return &PlainComment{ - value, - } -} - -func (c *PlainComment) String() string { - return c.value -} diff --git a/php5/parser.go b/php5/parser.go index 5df3681..03a6f22 100644 --- a/php5/parser.go +++ b/php5/parser.go @@ -72,7 +72,7 @@ func (l *Parser) Parse() int { return yyParse(l) } -func (l *Parser) listGetFirstNodeComments(list []node.Node) []comment.Comment { +func (l *Parser) listGetFirstNodeComments(list []node.Node) []*comment.Comment { if len(list) == 0 { return nil } diff --git a/php7/parser.go b/php7/parser.go index 355189b..9c3b34b 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -72,7 +72,7 @@ func (l *Parser) Parse() int { return yyParse(l) } -func (l *Parser) listGetFirstNodeComments(list []node.Node) []comment.Comment { +func (l *Parser) listGetFirstNodeComments(list []node.Node) []*comment.Comment { if len(list) == 0 { return nil } diff --git a/scanner/lexer.go b/scanner/lexer.go index d3b3b03..e415f8e 100644 --- a/scanner/lexer.go +++ b/scanner/lexer.go @@ -438,7 +438,7 @@ type Lexer struct { *lex.Lexer StateStack []int PhpDocComment string - Comments []comment.Comment + Comments []*comment.Comment } // Rune2Class returns the rune integer id @@ -520,7 +520,8 @@ func (l *Lexer) newToken(chars []lex.Char) Token { return NewToken(l.charsToBytes(chars), startLine, endLine, startPos, endPos).SetComments(l.Comments) } -func (l *Lexer) addComment(c comment.Comment) { +func (l *Lexer) addComment(chars []lex.Char) { + c := comment.NewComment(string(l.charsToBytes(chars))) l.Comments = append(l.Comments, c) } diff --git a/scanner/scanner.go b/scanner/scanner.go index fde9daf..fc80d5e 100644 --- a/scanner/scanner.go +++ b/scanner/scanner.go @@ -12,7 +12,6 @@ import ( "bytes" "fmt" "github.com/cznic/golex/lex" - "github.com/z7zmey/php-parser/comment" ) const ( @@ -8311,15 +8310,12 @@ yyrule125: // \?\? yyrule126: // (#|[/][/]) { - tb := []rune{} - for _, chr := range l.Token() { - tb = append(tb, chr.Rune) - } + tb := l.Token() for { if c == -1 { break } - tb = append(tb, rune(c)) + tb = append(tb, l.Last) switch c { case '\r': c = l.Next() @@ -8342,7 +8338,7 @@ yyrule126: // (#|[/][/]) } break } - l.addComment(comment.NewPlainComment(string(tb))) + l.addComment(tb) goto yystate0 } yyrule127: // ([/][*])|([/][*][*]) @@ -8367,10 +8363,10 @@ yyrule127: // ([/][*])|([/][*][*]) lval.Token(l.newToken(l.Token())) if is_doc_comment { l.PhpDocComment = string(l.TokenBytes(nil)) - l.addComment(comment.NewDocComment(string(l.TokenBytes(nil)))) + l.addComment(l.Token()) // return T_DOC_COMMENT } else { - l.addComment(comment.NewPlainComment(string(l.TokenBytes(nil)))) + l.addComment(l.Token()) // return T_COMMENT } goto yystate0 diff --git a/scanner/scanner.l b/scanner/scanner.l index e3a105b..624d1b6 100644 --- a/scanner/scanner.l +++ b/scanner/scanner.l @@ -11,7 +11,6 @@ import ( "fmt" "bytes" "github.com/cznic/golex/lex" - "github.com/z7zmey/php-parser/comment" ) const ( @@ -253,18 +252,14 @@ NEW_LINE (\r|\n|\r\n) \>\> lval.Token(l.newToken(l.Token())); return T_SR \?\? lval.Token(l.newToken(l.Token())); return T_COALESCE (#|[/][/]) - tb := []rune{} - - for _, chr := range(l.Token()) { - tb = append(tb, chr.Rune) - } + tb := l.Token() for { if c == -1 { break } - tb = append(tb, rune(c)) + tb = append(tb, l.Last) switch c { case '\r': @@ -292,7 +287,7 @@ NEW_LINE (\r|\n|\r\n) break; } - l.addComment(comment.NewPlainComment(string(tb))) + l.addComment(tb) ([/][*])|([/][*][*]) tb := l.Token() @@ -318,10 +313,10 @@ NEW_LINE (\r|\n|\r\n) lval.Token(l.newToken(l.Token())) if is_doc_comment { l.PhpDocComment = string(l.TokenBytes(nil)) - l.addComment(comment.NewDocComment(string(l.TokenBytes(nil)))) + l.addComment(l.Token()) // return T_DOC_COMMENT } else { - l.addComment(comment.NewPlainComment(string(l.TokenBytes(nil)))) + l.addComment(l.Token()) // return T_COMMENT } diff --git a/scanner/scanner_test.go b/scanner/scanner_test.go index 6beed3c..b63afb5 100644 --- a/scanner/scanner_test.go +++ b/scanner/scanner_test.go @@ -872,8 +872,8 @@ func TestSlashAfterVariable(t *testing.T) { func TestCommentEnd(t *testing.T) { src := ` test` - expected := []comment.Comment{ - comment.NewPlainComment("//test"), + expected := []*comment.Comment{ + comment.NewComment("//test"), } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") @@ -959,8 +959,8 @@ func TestInlineComment(t *testing.T) { src := ` Date: Sun, 15 Apr 2018 21:39:26 +0300 Subject: [PATCH 03/25] save comment position --- comment/comment.go | 15 +++++- comment/comment_test.go | 18 ++++++- .../builder.go => parser/position_builder.go | 51 ++++++++++--------- .../position_builder_test.go | 37 +++++++------- php5/parser.go | 5 +- php7/parser.go | 5 +- position/position.go | 10 ++++ scanner/lexer.go | 14 ++++- scanner/scanner_test.go | 18 ++++--- scanner/token_test.go | 2 +- 10 files changed, 114 insertions(+), 61 deletions(-) rename position/builder.go => parser/position_builder.go (78%) rename position/position_test.go => parser/position_builder_test.go (93%) diff --git a/comment/comment.go b/comment/comment.go index c8713f2..3aa4958 100644 --- a/comment/comment.go +++ b/comment/comment.go @@ -1,17 +1,28 @@ package comment +import ( + "github.com/z7zmey/php-parser/position" +) + // Comment aggrigates information about comment /** type Comment struct { - value string + value string + position *position.Position } // NewComment - Comment constructor -func NewComment(value string) *Comment { +func NewComment(value string, pos *position.Position) *Comment { return &Comment{ value, + pos, } } func (c *Comment) String() string { return c.value } + +// Position returns comment position +func (c *Comment) Position() *position.Position { + return c.position +} diff --git a/comment/comment_test.go b/comment/comment_test.go index 27980e9..c9389e2 100644 --- a/comment/comment_test.go +++ b/comment/comment_test.go @@ -3,6 +3,8 @@ package comment_test import ( "testing" + "github.com/z7zmey/php-parser/position" + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" ) @@ -11,8 +13,8 @@ func TestComments(t *testing.T) { n := node.NewIdentifier("test") commentGroup := []*comment.Comment{ - comment.NewComment("/** hello world */"), - comment.NewComment("// hello world"), + comment.NewComment("/** hello world */", nil), + comment.NewComment("// hello world", nil), } comments := comment.Comments{} @@ -25,3 +27,15 @@ func TestComments(t *testing.T) { t.Errorf("expected and actual are not equal\n") } } + +func TestCommentPos(t *testing.T) { + expected := position.NewPosition(0, 0, 0, 0) + + comment := comment.NewComment("/** hello world */", expected) + + actual := comment.Position() + + if expected != actual { + t.Errorf("expected and actual are not equal\n") + } +} diff --git a/position/builder.go b/parser/position_builder.go similarity index 78% rename from position/builder.go rename to parser/position_builder.go index 1a98c2f..9f9260e 100644 --- a/position/builder.go +++ b/parser/position_builder.go @@ -1,13 +1,14 @@ -package position +package parser import ( "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/scanner" ) // Builder provide functions to constuct positions type Builder struct { - Positions *Positions + Positions *position.Positions } type startPos struct { @@ -79,8 +80,8 @@ func (b *Builder) getNodeEndPos(n node.Node) endPos { } // NewNodeListPosition returns new Position -func (b *Builder) NewNodeListPosition(list []node.Node) *Position { - return &Position{ +func (b *Builder) NewNodeListPosition(list []node.Node) *position.Position { + return &position.Position{ b.getListStartPos(list).startLine, b.getListEndPos(list).endLine, b.getListStartPos(list).startPos, @@ -89,8 +90,8 @@ func (b *Builder) NewNodeListPosition(list []node.Node) *Position { } // NewNodePosition returns new Position -func (b *Builder) NewNodePosition(n node.Node) *Position { - return &Position{ +func (b *Builder) NewNodePosition(n node.Node) *position.Position { + return &position.Position{ b.getNodeStartPos(n).startLine, b.getNodeEndPos(n).endLine, b.getNodeStartPos(n).startPos, @@ -99,8 +100,8 @@ func (b *Builder) NewNodePosition(n node.Node) *Position { } // NewTokenPosition returns new Position -func (b *Builder) NewTokenPosition(t scanner.Token) *Position { - return &Position{ +func (b *Builder) NewTokenPosition(t scanner.Token) *position.Position { + return &position.Position{ t.StartLine, t.EndLine, t.StartPos, @@ -109,8 +110,8 @@ func (b *Builder) NewTokenPosition(t scanner.Token) *Position { } // NewTokensPosition returns new Position -func (b *Builder) NewTokensPosition(startToken scanner.Token, endToken scanner.Token) *Position { - return &Position{ +func (b *Builder) NewTokensPosition(startToken scanner.Token, endToken scanner.Token) *position.Position { + return &position.Position{ startToken.StartLine, endToken.EndLine, startToken.StartPos, @@ -119,8 +120,8 @@ func (b *Builder) NewTokensPosition(startToken scanner.Token, endToken scanner.T } // NewTokenNodePosition returns new Position -func (b *Builder) NewTokenNodePosition(t scanner.Token, n node.Node) *Position { - return &Position{ +func (b *Builder) NewTokenNodePosition(t scanner.Token, n node.Node) *position.Position { + return &position.Position{ t.StartLine, b.getNodeEndPos(n).endLine, t.StartPos, @@ -129,8 +130,8 @@ func (b *Builder) NewTokenNodePosition(t scanner.Token, n node.Node) *Position { } // NewNodeTokenPosition returns new Position -func (b *Builder) NewNodeTokenPosition(n node.Node, t scanner.Token) *Position { - return &Position{ +func (b *Builder) NewNodeTokenPosition(n node.Node, t scanner.Token) *position.Position { + return &position.Position{ b.getNodeStartPos(n).startLine, t.EndLine, b.getNodeStartPos(n).startPos, @@ -139,8 +140,8 @@ func (b *Builder) NewNodeTokenPosition(n node.Node, t scanner.Token) *Position { } // NewNodesPosition returns new Position -func (b *Builder) NewNodesPosition(startNode node.Node, endNode node.Node) *Position { - return &Position{ +func (b *Builder) NewNodesPosition(startNode node.Node, endNode node.Node) *position.Position { + return &position.Position{ b.getNodeStartPos(startNode).startLine, b.getNodeEndPos(endNode).endLine, b.getNodeStartPos(startNode).startPos, @@ -149,8 +150,8 @@ func (b *Builder) NewNodesPosition(startNode node.Node, endNode node.Node) *Posi } // NewNodeListTokenPosition returns new Position -func (b *Builder) NewNodeListTokenPosition(list []node.Node, t scanner.Token) *Position { - return &Position{ +func (b *Builder) NewNodeListTokenPosition(list []node.Node, t scanner.Token) *position.Position { + return &position.Position{ b.getListStartPos(list).startLine, t.EndLine, b.getListStartPos(list).startPos, @@ -159,8 +160,8 @@ func (b *Builder) NewNodeListTokenPosition(list []node.Node, t scanner.Token) *P } // NewTokenNodeListPosition returns new Position -func (b *Builder) NewTokenNodeListPosition(t scanner.Token, list []node.Node) *Position { - return &Position{ +func (b *Builder) NewTokenNodeListPosition(t scanner.Token, list []node.Node) *position.Position { + return &position.Position{ t.StartLine, b.getListEndPos(list).endLine, t.StartPos, @@ -169,8 +170,8 @@ func (b *Builder) NewTokenNodeListPosition(t scanner.Token, list []node.Node) *P } // NewNodeNodeListPosition returns new Position -func (b *Builder) NewNodeNodeListPosition(n node.Node, list []node.Node) *Position { - return &Position{ +func (b *Builder) NewNodeNodeListPosition(n node.Node, list []node.Node) *position.Position { + return &position.Position{ b.getNodeStartPos(n).startLine, b.getListEndPos(list).endLine, b.getNodeStartPos(n).startPos, @@ -179,9 +180,9 @@ func (b *Builder) NewNodeNodeListPosition(n node.Node, list []node.Node) *Positi } // NewOptionalListTokensPosition returns new Position -func (b *Builder) NewOptionalListTokensPosition(list []node.Node, t scanner.Token, endToken scanner.Token) *Position { +func (b *Builder) NewOptionalListTokensPosition(list []node.Node, t scanner.Token, endToken scanner.Token) *position.Position { if list == nil { - return &Position{ + return &position.Position{ t.StartLine, endToken.EndLine, t.StartPos, @@ -189,7 +190,7 @@ func (b *Builder) NewOptionalListTokensPosition(list []node.Node, t scanner.Toke } } - return &Position{ + return &position.Position{ b.getListStartPos(list).startLine, endToken.EndLine, b.getListStartPos(list).startPos, diff --git a/position/position_test.go b/parser/position_builder_test.go similarity index 93% rename from position/position_test.go rename to parser/position_builder_test.go index 01f1985..6166967 100644 --- a/position/position_test.go +++ b/parser/position_builder_test.go @@ -1,16 +1,17 @@ -package position_test +package parser_test import ( "testing" "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/parser" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/scanner" ) func TestNewTokenPosition(t *testing.T) { - builder := position.Builder{} + builder := parser.Builder{} tkn := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) @@ -22,7 +23,7 @@ func TestNewTokenPosition(t *testing.T) { } func TestNewTokensPosition(t *testing.T) { - builder := position.Builder{} + builder := parser.Builder{} token1 := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) token2 := scanner.NewToken([]byte(`foo`), 2, 2, 4, 6) @@ -45,7 +46,7 @@ func TestNewNodePosition(t *testing.T) { EndPos: 3, }) - builder := position.Builder{ + builder := parser.Builder{ Positions: p, } @@ -68,7 +69,7 @@ func TestNewTokenNodePosition(t *testing.T) { EndPos: 12, }) - builder := position.Builder{ + builder := parser.Builder{ Positions: p, } @@ -91,7 +92,7 @@ func TestNewNodeTokenPosition(t *testing.T) { EndPos: 9, }) - builder := position.Builder{ + builder := parser.Builder{ Positions: p, } @@ -106,7 +107,7 @@ func TestNewNodeListPosition(t *testing.T) { n1 := node.NewIdentifier("test node") n2 := node.NewIdentifier("test node") - builder := position.Builder{ + builder := parser.Builder{ Positions: &position.Positions{ n1: &position.Position{ StartLine: 1, @@ -134,7 +135,7 @@ func TestNewNodesPosition(t *testing.T) { n1 := node.NewIdentifier("test node") n2 := node.NewIdentifier("test node") - builder := position.Builder{ + builder := parser.Builder{ Positions: &position.Positions{ n1: &position.Position{ StartLine: 1, @@ -163,7 +164,7 @@ func TestNewNodeListTokenPosition(t *testing.T) { n2 := node.NewIdentifier("test node") tkn := scanner.NewToken([]byte(`foo`), 3, 3, 20, 22) - builder := position.Builder{ + builder := parser.Builder{ Positions: &position.Positions{ n1: &position.Position{ StartLine: 1, @@ -192,7 +193,7 @@ func TestNewTokenNodeListPosition(t *testing.T) { n1 := node.NewIdentifier("test node") n2 := node.NewIdentifier("test node") - builder := position.Builder{ + builder := parser.Builder{ Positions: &position.Positions{ n1: &position.Position{ StartLine: 2, @@ -221,7 +222,7 @@ func TestNewNodeNodeListPosition(t *testing.T) { n2 := node.NewIdentifier("test node") n3 := node.NewIdentifier("test node") - builder := position.Builder{ + builder := parser.Builder{ Positions: &position.Positions{ n1: &position.Position{ StartLine: 1, @@ -252,7 +253,7 @@ func TestNewNodeNodeListPosition(t *testing.T) { } func TestNewOptionalListTokensPosition(t *testing.T) { - builder := position.Builder{} + builder := parser.Builder{} token1 := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) token2 := scanner.NewToken([]byte(`foo`), 2, 2, 4, 6) @@ -269,7 +270,7 @@ func TestNewOptionalListTokensPosition2(t *testing.T) { n2 := node.NewIdentifier("test node") n3 := node.NewIdentifier("test node") - builder := position.Builder{ + builder := parser.Builder{ Positions: &position.Positions{ n1: &position.Position{ StartLine: 1, @@ -303,7 +304,7 @@ func TestNewOptionalListTokensPosition2(t *testing.T) { } func TestNilNodePos(t *testing.T) { - builder := position.Builder{} + builder := parser.Builder{} pos := builder.NewNodesPosition(nil, nil) @@ -315,7 +316,7 @@ func TestNilNodePos(t *testing.T) { func TestNilNodeListPos(t *testing.T) { n1 := node.NewIdentifier("test node") - builder := position.Builder{ + builder := parser.Builder{ Positions: &position.Positions{ n1: &position.Position{ StartLine: 1, @@ -336,7 +337,7 @@ func TestNilNodeListPos(t *testing.T) { func TestNilNodeListTokenPos(t *testing.T) { token1 := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) - builder := position.Builder{} + builder := parser.Builder{} pos := builder.NewNodeListTokenPosition(nil, token1) @@ -348,7 +349,7 @@ func TestNilNodeListTokenPos(t *testing.T) { func TestEmptyNodeListPos(t *testing.T) { n1 := node.NewIdentifier("test node") - builder := position.Builder{ + builder := parser.Builder{ Positions: &position.Positions{ n1: &position.Position{ StartLine: 1, @@ -369,7 +370,7 @@ func TestEmptyNodeListPos(t *testing.T) { func TestEmptyNodeListTokenPos(t *testing.T) { token1 := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) - builder := position.Builder{} + builder := parser.Builder{} pos := builder.NewNodeListTokenPosition([]node.Node{}, token1) diff --git a/php5/parser.go b/php5/parser.go index 03a6f22..fd8fce3 100644 --- a/php5/parser.go +++ b/php5/parser.go @@ -6,6 +6,7 @@ import ( "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/errors" "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/parser" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/scanner" ) @@ -19,7 +20,7 @@ type Parser struct { *scanner.Lexer path string lastToken *scanner.Token - positionBuilder *position.Builder + positionBuilder *parser.Builder errors []*errors.Error rootNode node.Node comments comment.Comments @@ -63,7 +64,7 @@ func (l *Parser) Parse() int { l.rootNode = nil l.comments = comment.Comments{} l.positions = position.Positions{} - l.positionBuilder = &position.Builder{ + l.positionBuilder = &parser.Builder{ Positions: &l.positions, } diff --git a/php7/parser.go b/php7/parser.go index 9c3b34b..4529c35 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -6,6 +6,7 @@ import ( "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/errors" "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/parser" "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/scanner" ) @@ -19,7 +20,7 @@ type Parser struct { *scanner.Lexer path string lastToken *scanner.Token - positionBuilder *position.Builder + positionBuilder *parser.Builder errors []*errors.Error rootNode node.Node comments comment.Comments @@ -63,7 +64,7 @@ func (l *Parser) Parse() int { l.rootNode = nil l.comments = comment.Comments{} l.positions = position.Positions{} - l.positionBuilder = &position.Builder{ + l.positionBuilder = &parser.Builder{ Positions: &l.positions, } diff --git a/position/position.go b/position/position.go index f619e7b..0ca3c80 100644 --- a/position/position.go +++ b/position/position.go @@ -14,6 +14,16 @@ type Position struct { EndPos int } +// NewPosition Position constructor +func NewPosition(StartLine int, EndLine int, StartPos int, EndPos int) *Position { + return &Position{ + StartLine: StartLine, + EndLine: EndLine, + StartPos: StartPos, + EndPos: EndPos, + } +} + func (p Position) String() string { return fmt.Sprintf("Pos{Line: %d-%d Pos: %d-%d}", p.StartLine, p.EndLine, p.StartPos, p.EndPos) } diff --git a/scanner/lexer.go b/scanner/lexer.go index e415f8e..999f009 100644 --- a/scanner/lexer.go +++ b/scanner/lexer.go @@ -8,6 +8,8 @@ import ( "io" "unicode" + "github.com/z7zmey/php-parser/position" + "github.com/cznic/golex/lex" "github.com/z7zmey/php-parser/comment" ) @@ -521,7 +523,17 @@ func (l *Lexer) newToken(chars []lex.Char) Token { } func (l *Lexer) addComment(chars []lex.Char) { - c := comment.NewComment(string(l.charsToBytes(chars))) + firstChar := chars[0] + lastChar := chars[len(chars)-1] + + pos := position.NewPosition( + l.File.Line(firstChar.Pos()), + l.File.Line(lastChar.Pos()), + int(firstChar.Pos()), + int(lastChar.Pos()), + ) + + c := comment.NewComment(string(l.charsToBytes(chars)), pos) l.Comments = append(l.Comments, c) } diff --git a/scanner/scanner_test.go b/scanner/scanner_test.go index b63afb5..3195757 100644 --- a/scanner/scanner_test.go +++ b/scanner/scanner_test.go @@ -5,6 +5,8 @@ import ( "reflect" "testing" + "github.com/z7zmey/php-parser/position" + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/scanner" @@ -873,7 +875,7 @@ func TestCommentEnd(t *testing.T) { src := ` test` expected := []*comment.Comment{ - comment.NewComment("//test"), + comment.NewComment("//test", position.NewPosition(2, 2, 8, 13)), } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") @@ -960,7 +962,7 @@ func TestInlineComment(t *testing.T) { /*test*/` expected := []*comment.Comment{ - comment.NewComment("/*test*/"), + comment.NewComment("/*test*/", position.NewPosition(2, 2, 8, 15)), } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") @@ -978,7 +980,7 @@ func TestEmptyInlineComment(t *testing.T) { /**/` expected := []*comment.Comment{ - comment.NewComment("/**/"), + comment.NewComment("/**/", position.NewPosition(2, 2, 8, 11)), } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") @@ -996,7 +998,7 @@ func TestEmptyInlineComment2(t *testing.T) { /***/` expected := []*comment.Comment{ - comment.NewComment("/***/"), + comment.NewComment("/***/", position.NewPosition(2, 2, 8, 12)), } lexer := scanner.NewLexer(bytes.NewBufferString(src), "test.php") diff --git a/scanner/token_test.go b/scanner/token_test.go index 9864882..2993267 100644 --- a/scanner/token_test.go +++ b/scanner/token_test.go @@ -13,7 +13,7 @@ func TestToken(t *testing.T) { tkn := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) c := []*comment.Comment{ - comment.NewComment("test comment"), + comment.NewComment("test comment", nil), } tkn.SetComments(c) From 56127a4a2cc0badebc73ba5c70034b8e563777c7 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 15 Apr 2018 22:02:07 +0300 Subject: [PATCH 04/25] move `Positions` and `Comments` into `parser` package --- comment/comment_test.go | 34 +++++++++++++-------------------- comment/comments.go | 11 ----------- parser/comments.go | 14 ++++++++++++++ parser/comments_test.go | 28 +++++++++++++++++++++++++++ parser/parser.go | 6 ++---- parser/position_builder.go | 2 +- parser/position_builder_test.go | 22 ++++++++++----------- parser/positions.go | 14 ++++++++++++++ parser/positions_test.go | 25 ++++++++++++++++++++++++ php5/parser.go | 13 ++++++------- php7/parser.go | 13 ++++++------- position/position.go | 10 ---------- position/position_test.go | 19 ++++++++++++++++++ visitor/dumper.go | 7 +++---- 14 files changed, 142 insertions(+), 76 deletions(-) delete mode 100644 comment/comments.go create mode 100644 parser/comments.go create mode 100644 parser/comments_test.go create mode 100644 parser/positions.go create mode 100644 parser/positions_test.go create mode 100644 position/position_test.go diff --git a/comment/comment_test.go b/comment/comment_test.go index c9389e2..72e1981 100644 --- a/comment/comment_test.go +++ b/comment/comment_test.go @@ -6,29 +6,9 @@ import ( "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/comment" - "github.com/z7zmey/php-parser/node" ) -func TestComments(t *testing.T) { - n := node.NewIdentifier("test") - - commentGroup := []*comment.Comment{ - comment.NewComment("/** hello world */", nil), - comment.NewComment("// hello world", nil), - } - - comments := comment.Comments{} - comments.AddComments(n, commentGroup) - - if comments[n][0].String() != "/** hello world */" { - t.Errorf("expected and actual are not equal\n") - } - if comments[n][1].String() != "// hello world" { - t.Errorf("expected and actual are not equal\n") - } -} - -func TestCommentPos(t *testing.T) { +func TestCommentGetPosition(t *testing.T) { expected := position.NewPosition(0, 0, 0, 0) comment := comment.NewComment("/** hello world */", expected) @@ -39,3 +19,15 @@ func TestCommentPos(t *testing.T) { t.Errorf("expected and actual are not equal\n") } } + +func TestCommentPrint(t *testing.T) { + expected := "/** hello world */" + + comment := comment.NewComment(expected, nil) + + actual := comment.String() + + if expected != actual { + t.Errorf("expected and actual are not equal\n") + } +} diff --git a/comment/comments.go b/comment/comments.go deleted file mode 100644 index 8ef687d..0000000 --- a/comment/comments.go +++ /dev/null @@ -1,11 +0,0 @@ -package comment - -import "github.com/z7zmey/php-parser/node" - -// Comments a collection of comment groups assigned to nodes -type Comments map[node.Node][]*Comment - -// AddComments add comment group to the collection -func (c Comments) AddComments(node node.Node, comments []*Comment) { - c[node] = append(c[node], comments...) -} diff --git a/parser/comments.go b/parser/comments.go new file mode 100644 index 0000000..c5aac8b --- /dev/null +++ b/parser/comments.go @@ -0,0 +1,14 @@ +package parser + +import ( + "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/node" +) + +// Comments a collection of comment groups assigned to nodes +type Comments map[node.Node][]*comment.Comment + +// AddComments add comment group to the collection +func (c Comments) AddComments(node node.Node, comments []*comment.Comment) { + c[node] = append(c[node], comments...) +} diff --git a/parser/comments_test.go b/parser/comments_test.go new file mode 100644 index 0000000..bdec9ef --- /dev/null +++ b/parser/comments_test.go @@ -0,0 +1,28 @@ +package parser_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/parser" +) + +func TestComments(t *testing.T) { + n := node.NewIdentifier("test") + + commentGroup := []*comment.Comment{ + comment.NewComment("/** hello world */", nil), + comment.NewComment("// hello world", nil), + } + + comments := parser.Comments{} + comments.AddComments(n, commentGroup) + + if comments[n][0].String() != "/** hello world */" { + t.Errorf("expected and actual are not equal\n") + } + if comments[n][1].String() != "// hello world" { + t.Errorf("expected and actual are not equal\n") + } +} diff --git a/parser/parser.go b/parser/parser.go index e9b4e93..24dc804 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -1,10 +1,8 @@ package parser import ( - "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/errors" "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/position" ) // Parser interface @@ -13,6 +11,6 @@ type Parser interface { GetPath() string GetRootNode() node.Node GetErrors() []*errors.Error - GetComments() comment.Comments - GetPositions() position.Positions + GetComments() Comments + GetPositions() Positions } diff --git a/parser/position_builder.go b/parser/position_builder.go index 9f9260e..178b1cb 100644 --- a/parser/position_builder.go +++ b/parser/position_builder.go @@ -8,7 +8,7 @@ import ( // Builder provide functions to constuct positions type Builder struct { - Positions *position.Positions + Positions *Positions } type startPos struct { diff --git a/parser/position_builder_test.go b/parser/position_builder_test.go index 6166967..4d3f5a3 100644 --- a/parser/position_builder_test.go +++ b/parser/position_builder_test.go @@ -38,7 +38,7 @@ func TestNewTokensPosition(t *testing.T) { func TestNewNodePosition(t *testing.T) { n := node.NewIdentifier("test node") - p := &position.Positions{} + p := &parser.Positions{} p.AddPosition(n, &position.Position{ StartLine: 1, EndLine: 1, @@ -61,7 +61,7 @@ func TestNewTokenNodePosition(t *testing.T) { tkn := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) n := node.NewIdentifier("test node") - p := &position.Positions{} + p := &parser.Positions{} p.AddPosition(n, &position.Position{ StartLine: 2, EndLine: 2, @@ -84,7 +84,7 @@ func TestNewNodeTokenPosition(t *testing.T) { n := node.NewIdentifier("test node") tkn := scanner.NewToken([]byte(`foo`), 2, 2, 10, 12) - p := &position.Positions{} + p := &parser.Positions{} p.AddPosition(n, &position.Position{ StartLine: 1, EndLine: 1, @@ -108,7 +108,7 @@ func TestNewNodeListPosition(t *testing.T) { n2 := node.NewIdentifier("test node") builder := parser.Builder{ - Positions: &position.Positions{ + Positions: &parser.Positions{ n1: &position.Position{ StartLine: 1, EndLine: 1, @@ -136,7 +136,7 @@ func TestNewNodesPosition(t *testing.T) { n2 := node.NewIdentifier("test node") builder := parser.Builder{ - Positions: &position.Positions{ + Positions: &parser.Positions{ n1: &position.Position{ StartLine: 1, EndLine: 1, @@ -165,7 +165,7 @@ func TestNewNodeListTokenPosition(t *testing.T) { tkn := scanner.NewToken([]byte(`foo`), 3, 3, 20, 22) builder := parser.Builder{ - Positions: &position.Positions{ + Positions: &parser.Positions{ n1: &position.Position{ StartLine: 1, EndLine: 1, @@ -194,7 +194,7 @@ func TestNewTokenNodeListPosition(t *testing.T) { n2 := node.NewIdentifier("test node") builder := parser.Builder{ - Positions: &position.Positions{ + Positions: &parser.Positions{ n1: &position.Position{ StartLine: 2, EndLine: 2, @@ -223,7 +223,7 @@ func TestNewNodeNodeListPosition(t *testing.T) { n3 := node.NewIdentifier("test node") builder := parser.Builder{ - Positions: &position.Positions{ + Positions: &parser.Positions{ n1: &position.Position{ StartLine: 1, EndLine: 1, @@ -271,7 +271,7 @@ func TestNewOptionalListTokensPosition2(t *testing.T) { n3 := node.NewIdentifier("test node") builder := parser.Builder{ - Positions: &position.Positions{ + Positions: &parser.Positions{ n1: &position.Position{ StartLine: 1, EndLine: 1, @@ -317,7 +317,7 @@ func TestNilNodeListPos(t *testing.T) { n1 := node.NewIdentifier("test node") builder := parser.Builder{ - Positions: &position.Positions{ + Positions: &parser.Positions{ n1: &position.Position{ StartLine: 1, EndLine: 1, @@ -350,7 +350,7 @@ func TestEmptyNodeListPos(t *testing.T) { n1 := node.NewIdentifier("test node") builder := parser.Builder{ - Positions: &position.Positions{ + Positions: &parser.Positions{ n1: &position.Position{ StartLine: 1, EndLine: 1, diff --git a/parser/positions.go b/parser/positions.go new file mode 100644 index 0000000..6c2c0a9 --- /dev/null +++ b/parser/positions.go @@ -0,0 +1,14 @@ +package parser + +import ( + "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/position" +) + +// Positions a collection of positions attached to nodes +type Positions map[node.Node]*position.Position + +// AddPosition attaches a position to a node +func (p Positions) AddPosition(node node.Node, position *position.Position) { + p[node] = position +} diff --git a/parser/positions_test.go b/parser/positions_test.go new file mode 100644 index 0000000..d836c5c --- /dev/null +++ b/parser/positions_test.go @@ -0,0 +1,25 @@ +package parser_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/position" + + "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/parser" +) + +func TestPositions(t *testing.T) { + n := node.NewIdentifier("test") + + expected := position.NewPosition(0, 0, 0, 0) + + positions := parser.Positions{} + positions.AddPosition(n, expected) + + actual := positions[n] + + if actual != expected { + t.Errorf("expected and actual are not equal\n") + } +} diff --git a/php5/parser.go b/php5/parser.go index fd8fce3..1285cd7 100644 --- a/php5/parser.go +++ b/php5/parser.go @@ -7,7 +7,6 @@ import ( "github.com/z7zmey/php-parser/errors" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/parser" - "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/scanner" ) @@ -23,8 +22,8 @@ type Parser struct { positionBuilder *parser.Builder errors []*errors.Error rootNode node.Node - comments comment.Comments - positions position.Positions + comments parser.Comments + positions parser.Positions } // NewParser creates and returns new Parser @@ -62,8 +61,8 @@ func (l *Parser) Parse() int { // init l.errors = nil l.rootNode = nil - l.comments = comment.Comments{} - l.positions = position.Positions{} + l.comments = parser.Comments{} + l.positions = parser.Positions{} l.positionBuilder = &parser.Builder{ Positions: &l.positions, } @@ -99,11 +98,11 @@ func (l *Parser) GetErrors() []*errors.Error { } // GetComments returns comments list -func (l *Parser) GetComments() comment.Comments { +func (l *Parser) GetComments() parser.Comments { return l.comments } // GetPositions returns positions list -func (l *Parser) GetPositions() position.Positions { +func (l *Parser) GetPositions() parser.Positions { return l.positions } diff --git a/php7/parser.go b/php7/parser.go index 4529c35..21f48f4 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -7,7 +7,6 @@ import ( "github.com/z7zmey/php-parser/errors" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/parser" - "github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/scanner" ) @@ -23,8 +22,8 @@ type Parser struct { positionBuilder *parser.Builder errors []*errors.Error rootNode node.Node - comments comment.Comments - positions position.Positions + comments parser.Comments + positions parser.Positions } // NewParser creates and returns new Parser @@ -62,8 +61,8 @@ func (l *Parser) Parse() int { // init l.errors = nil l.rootNode = nil - l.comments = comment.Comments{} - l.positions = position.Positions{} + l.comments = parser.Comments{} + l.positions = parser.Positions{} l.positionBuilder = &parser.Builder{ Positions: &l.positions, } @@ -99,11 +98,11 @@ func (l *Parser) GetErrors() []*errors.Error { } // GetComments returns comments list -func (l *Parser) GetComments() comment.Comments { +func (l *Parser) GetComments() parser.Comments { return l.comments } // GetPositions returns positions list -func (l *Parser) GetPositions() position.Positions { +func (l *Parser) GetPositions() parser.Positions { return l.positions } diff --git a/position/position.go b/position/position.go index 0ca3c80..d4099cd 100644 --- a/position/position.go +++ b/position/position.go @@ -2,8 +2,6 @@ package position import ( "fmt" - - "github.com/z7zmey/php-parser/node" ) // Position represents node position @@ -27,11 +25,3 @@ func NewPosition(StartLine int, EndLine int, StartPos int, EndPos int) *Position func (p Position) String() string { return fmt.Sprintf("Pos{Line: %d-%d Pos: %d-%d}", p.StartLine, p.EndLine, p.StartPos, p.EndPos) } - -// Positions a collection of positions attached to nodes -type Positions map[node.Node]*Position - -// AddPosition attaches a position to a node -func (p Positions) AddPosition(node node.Node, position *Position) { - p[node] = position -} diff --git a/position/position_test.go b/position/position_test.go new file mode 100644 index 0000000..0e322b6 --- /dev/null +++ b/position/position_test.go @@ -0,0 +1,19 @@ +package position_test + +import ( + "testing" + + "github.com/z7zmey/php-parser/position" +) + +func TestPrintPosition(t *testing.T) { + pos := position.NewPosition(1, 1, 2, 5) + + expected := "Pos{Line: 1-1 Pos: 2-5}" + + actual := pos.String() + + if expected != actual { + t.Errorf("expected and actual are not equal\n") + } +} diff --git a/visitor/dumper.go b/visitor/dumper.go index 50c0c20..6930f1b 100644 --- a/visitor/dumper.go +++ b/visitor/dumper.go @@ -7,9 +7,8 @@ import ( "reflect" "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/position" + "github.com/z7zmey/php-parser/parser" - "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/walker" ) @@ -18,8 +17,8 @@ import ( type Dumper struct { Writer io.Writer Indent string - Comments comment.Comments - Positions position.Positions + Comments parser.Comments + Positions parser.Positions NsResolver *NamespaceResolver } From bc158256633db2c08e9975593b2ae9144cf045d4 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 15 Apr 2018 22:06:02 +0300 Subject: [PATCH 05/25] rename `PositionBuilder` --- parser/position_builder.go | 82 ++++++++++++++++----------------- parser/position_builder_test.go | 34 +++++++------- php5/parser.go | 4 +- php7/parser.go | 4 +- 4 files changed, 62 insertions(+), 62 deletions(-) diff --git a/parser/position_builder.go b/parser/position_builder.go index 178b1cb..e09a0ba 100644 --- a/parser/position_builder.go +++ b/parser/position_builder.go @@ -6,8 +6,8 @@ import ( "github.com/z7zmey/php-parser/scanner" ) -// Builder provide functions to constuct positions -type Builder struct { +// PositionBuilder provide functions to constuct positions +type PositionBuilder struct { Positions *Positions } @@ -21,7 +21,7 @@ type endPos struct { endPos int } -func (b *Builder) getListStartPos(l []node.Node) startPos { +func (b *PositionBuilder) getListStartPos(l []node.Node) startPos { if l == nil { return startPos{-1, -1} } @@ -33,7 +33,7 @@ func (b *Builder) getListStartPos(l []node.Node) startPos { return b.getNodeStartPos(l[0]) } -func (b *Builder) getNodeStartPos(n node.Node) startPos { +func (b *PositionBuilder) getNodeStartPos(n node.Node) startPos { sl := -1 sp := -1 @@ -50,7 +50,7 @@ func (b *Builder) getNodeStartPos(n node.Node) startPos { return startPos{sl, sp} } -func (b *Builder) getListEndPos(l []node.Node) endPos { +func (b *PositionBuilder) getListEndPos(l []node.Node) endPos { if l == nil { return endPos{-1, -1} } @@ -62,7 +62,7 @@ func (b *Builder) getListEndPos(l []node.Node) endPos { return b.getNodeEndPos(l[len(l)-1]) } -func (b *Builder) getNodeEndPos(n node.Node) endPos { +func (b *PositionBuilder) getNodeEndPos(n node.Node) endPos { el := -1 ep := -1 @@ -80,120 +80,120 @@ func (b *Builder) getNodeEndPos(n node.Node) endPos { } // NewNodeListPosition returns new Position -func (b *Builder) NewNodeListPosition(list []node.Node) *position.Position { - return &position.Position{ +func (b *PositionBuilder) NewNodeListPosition(list []node.Node) *position.Position { + return position.NewPosition( b.getListStartPos(list).startLine, b.getListEndPos(list).endLine, b.getListStartPos(list).startPos, b.getListEndPos(list).endPos, - } + ) } // NewNodePosition returns new Position -func (b *Builder) NewNodePosition(n node.Node) *position.Position { - return &position.Position{ +func (b *PositionBuilder) NewNodePosition(n node.Node) *position.Position { + return position.NewPosition( b.getNodeStartPos(n).startLine, b.getNodeEndPos(n).endLine, b.getNodeStartPos(n).startPos, b.getNodeEndPos(n).endPos, - } + ) } // NewTokenPosition returns new Position -func (b *Builder) NewTokenPosition(t scanner.Token) *position.Position { - return &position.Position{ +func (b *PositionBuilder) NewTokenPosition(t scanner.Token) *position.Position { + return position.NewPosition( t.StartLine, t.EndLine, t.StartPos, t.EndPos, - } + ) } // NewTokensPosition returns new Position -func (b *Builder) NewTokensPosition(startToken scanner.Token, endToken scanner.Token) *position.Position { - return &position.Position{ +func (b *PositionBuilder) NewTokensPosition(startToken scanner.Token, endToken scanner.Token) *position.Position { + return position.NewPosition( startToken.StartLine, endToken.EndLine, startToken.StartPos, endToken.EndPos, - } + ) } // NewTokenNodePosition returns new Position -func (b *Builder) NewTokenNodePosition(t scanner.Token, n node.Node) *position.Position { - return &position.Position{ +func (b *PositionBuilder) NewTokenNodePosition(t scanner.Token, n node.Node) *position.Position { + return position.NewPosition( t.StartLine, b.getNodeEndPos(n).endLine, t.StartPos, b.getNodeEndPos(n).endPos, - } + ) } // NewNodeTokenPosition returns new Position -func (b *Builder) NewNodeTokenPosition(n node.Node, t scanner.Token) *position.Position { - return &position.Position{ +func (b *PositionBuilder) NewNodeTokenPosition(n node.Node, t scanner.Token) *position.Position { + return position.NewPosition( b.getNodeStartPos(n).startLine, t.EndLine, b.getNodeStartPos(n).startPos, t.EndPos, - } + ) } // NewNodesPosition returns new Position -func (b *Builder) NewNodesPosition(startNode node.Node, endNode node.Node) *position.Position { - return &position.Position{ +func (b *PositionBuilder) NewNodesPosition(startNode node.Node, endNode node.Node) *position.Position { + return position.NewPosition( b.getNodeStartPos(startNode).startLine, b.getNodeEndPos(endNode).endLine, b.getNodeStartPos(startNode).startPos, b.getNodeEndPos(endNode).endPos, - } + ) } // NewNodeListTokenPosition returns new Position -func (b *Builder) NewNodeListTokenPosition(list []node.Node, t scanner.Token) *position.Position { - return &position.Position{ +func (b *PositionBuilder) NewNodeListTokenPosition(list []node.Node, t scanner.Token) *position.Position { + return position.NewPosition( b.getListStartPos(list).startLine, t.EndLine, b.getListStartPos(list).startPos, t.EndPos, - } + ) } // NewTokenNodeListPosition returns new Position -func (b *Builder) NewTokenNodeListPosition(t scanner.Token, list []node.Node) *position.Position { - return &position.Position{ +func (b *PositionBuilder) NewTokenNodeListPosition(t scanner.Token, list []node.Node) *position.Position { + return position.NewPosition( t.StartLine, b.getListEndPos(list).endLine, t.StartPos, b.getListEndPos(list).endPos, - } + ) } // NewNodeNodeListPosition returns new Position -func (b *Builder) NewNodeNodeListPosition(n node.Node, list []node.Node) *position.Position { - return &position.Position{ +func (b *PositionBuilder) NewNodeNodeListPosition(n node.Node, list []node.Node) *position.Position { + return position.NewPosition( b.getNodeStartPos(n).startLine, b.getListEndPos(list).endLine, b.getNodeStartPos(n).startPos, b.getListEndPos(list).endPos, - } + ) } // NewOptionalListTokensPosition returns new Position -func (b *Builder) NewOptionalListTokensPosition(list []node.Node, t scanner.Token, endToken scanner.Token) *position.Position { +func (b *PositionBuilder) NewOptionalListTokensPosition(list []node.Node, t scanner.Token, endToken scanner.Token) *position.Position { if list == nil { - return &position.Position{ + return position.NewPosition( t.StartLine, endToken.EndLine, t.StartPos, endToken.EndPos, - } + ) } - return &position.Position{ + return position.NewPosition( b.getListStartPos(list).startLine, endToken.EndLine, b.getListStartPos(list).startPos, endToken.EndPos, - } + ) } diff --git a/parser/position_builder_test.go b/parser/position_builder_test.go index 4d3f5a3..0fda0ad 100644 --- a/parser/position_builder_test.go +++ b/parser/position_builder_test.go @@ -11,7 +11,7 @@ import ( ) func TestNewTokenPosition(t *testing.T) { - builder := parser.Builder{} + builder := parser.PositionBuilder{} tkn := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) @@ -23,7 +23,7 @@ func TestNewTokenPosition(t *testing.T) { } func TestNewTokensPosition(t *testing.T) { - builder := parser.Builder{} + builder := parser.PositionBuilder{} token1 := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) token2 := scanner.NewToken([]byte(`foo`), 2, 2, 4, 6) @@ -46,7 +46,7 @@ func TestNewNodePosition(t *testing.T) { EndPos: 3, }) - builder := parser.Builder{ + builder := parser.PositionBuilder{ Positions: p, } @@ -69,7 +69,7 @@ func TestNewTokenNodePosition(t *testing.T) { EndPos: 12, }) - builder := parser.Builder{ + builder := parser.PositionBuilder{ Positions: p, } @@ -92,7 +92,7 @@ func TestNewNodeTokenPosition(t *testing.T) { EndPos: 9, }) - builder := parser.Builder{ + builder := parser.PositionBuilder{ Positions: p, } @@ -107,7 +107,7 @@ func TestNewNodeListPosition(t *testing.T) { n1 := node.NewIdentifier("test node") n2 := node.NewIdentifier("test node") - builder := parser.Builder{ + builder := parser.PositionBuilder{ Positions: &parser.Positions{ n1: &position.Position{ StartLine: 1, @@ -135,7 +135,7 @@ func TestNewNodesPosition(t *testing.T) { n1 := node.NewIdentifier("test node") n2 := node.NewIdentifier("test node") - builder := parser.Builder{ + builder := parser.PositionBuilder{ Positions: &parser.Positions{ n1: &position.Position{ StartLine: 1, @@ -164,7 +164,7 @@ func TestNewNodeListTokenPosition(t *testing.T) { n2 := node.NewIdentifier("test node") tkn := scanner.NewToken([]byte(`foo`), 3, 3, 20, 22) - builder := parser.Builder{ + builder := parser.PositionBuilder{ Positions: &parser.Positions{ n1: &position.Position{ StartLine: 1, @@ -193,7 +193,7 @@ func TestNewTokenNodeListPosition(t *testing.T) { n1 := node.NewIdentifier("test node") n2 := node.NewIdentifier("test node") - builder := parser.Builder{ + builder := parser.PositionBuilder{ Positions: &parser.Positions{ n1: &position.Position{ StartLine: 2, @@ -222,7 +222,7 @@ func TestNewNodeNodeListPosition(t *testing.T) { n2 := node.NewIdentifier("test node") n3 := node.NewIdentifier("test node") - builder := parser.Builder{ + builder := parser.PositionBuilder{ Positions: &parser.Positions{ n1: &position.Position{ StartLine: 1, @@ -253,7 +253,7 @@ func TestNewNodeNodeListPosition(t *testing.T) { } func TestNewOptionalListTokensPosition(t *testing.T) { - builder := parser.Builder{} + builder := parser.PositionBuilder{} token1 := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) token2 := scanner.NewToken([]byte(`foo`), 2, 2, 4, 6) @@ -270,7 +270,7 @@ func TestNewOptionalListTokensPosition2(t *testing.T) { n2 := node.NewIdentifier("test node") n3 := node.NewIdentifier("test node") - builder := parser.Builder{ + builder := parser.PositionBuilder{ Positions: &parser.Positions{ n1: &position.Position{ StartLine: 1, @@ -304,7 +304,7 @@ func TestNewOptionalListTokensPosition2(t *testing.T) { } func TestNilNodePos(t *testing.T) { - builder := parser.Builder{} + builder := parser.PositionBuilder{} pos := builder.NewNodesPosition(nil, nil) @@ -316,7 +316,7 @@ func TestNilNodePos(t *testing.T) { func TestNilNodeListPos(t *testing.T) { n1 := node.NewIdentifier("test node") - builder := parser.Builder{ + builder := parser.PositionBuilder{ Positions: &parser.Positions{ n1: &position.Position{ StartLine: 1, @@ -337,7 +337,7 @@ func TestNilNodeListPos(t *testing.T) { func TestNilNodeListTokenPos(t *testing.T) { token1 := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) - builder := parser.Builder{} + builder := parser.PositionBuilder{} pos := builder.NewNodeListTokenPosition(nil, token1) @@ -349,7 +349,7 @@ func TestNilNodeListTokenPos(t *testing.T) { func TestEmptyNodeListPos(t *testing.T) { n1 := node.NewIdentifier("test node") - builder := parser.Builder{ + builder := parser.PositionBuilder{ Positions: &parser.Positions{ n1: &position.Position{ StartLine: 1, @@ -370,7 +370,7 @@ func TestEmptyNodeListPos(t *testing.T) { func TestEmptyNodeListTokenPos(t *testing.T) { token1 := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) - builder := parser.Builder{} + builder := parser.PositionBuilder{} pos := builder.NewNodeListTokenPosition([]node.Node{}, token1) diff --git a/php5/parser.go b/php5/parser.go index 1285cd7..7af4208 100644 --- a/php5/parser.go +++ b/php5/parser.go @@ -19,7 +19,7 @@ type Parser struct { *scanner.Lexer path string lastToken *scanner.Token - positionBuilder *parser.Builder + positionBuilder *parser.PositionBuilder errors []*errors.Error rootNode node.Node comments parser.Comments @@ -63,7 +63,7 @@ func (l *Parser) Parse() int { l.rootNode = nil l.comments = parser.Comments{} l.positions = parser.Positions{} - l.positionBuilder = &parser.Builder{ + l.positionBuilder = &parser.PositionBuilder{ Positions: &l.positions, } diff --git a/php7/parser.go b/php7/parser.go index 21f48f4..e461c24 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -19,7 +19,7 @@ type Parser struct { *scanner.Lexer path string lastToken *scanner.Token - positionBuilder *parser.Builder + positionBuilder *parser.PositionBuilder errors []*errors.Error rootNode node.Node comments parser.Comments @@ -63,7 +63,7 @@ func (l *Parser) Parse() int { l.rootNode = nil l.comments = parser.Comments{} l.positions = parser.Positions{} - l.positionBuilder = &parser.Builder{ + l.positionBuilder = &parser.PositionBuilder{ Positions: &l.positions, } From 435dc5c7068849febd27b24b992598ef46582e84 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 15 Apr 2018 22:56:20 +0300 Subject: [PATCH 06/25] scanner.NewToken returns pointer, and scanner.Token saves position as position.Position --- errors/error.go | 11 ++----- errors/error_test.go | 25 +++------------ parser/position_builder.go | 57 +++++++++++++++------------------ parser/position_builder_test.go | 39 ++++++++++++++-------- php5/parser.go | 6 ++-- php5/php5.go | 17 +++++----- php5/php5.y | 16 ++++----- php7/parser.go | 6 ++-- php7/php7.go | 19 +++++------ php7/php7.y | 18 +++++------ scanner/lexer.go | 16 +++++---- scanner/scanner_test.go | 4 +-- scanner/token.go | 30 ++++++++++------- scanner/token_test.go | 9 ++++-- 14 files changed, 137 insertions(+), 136 deletions(-) diff --git a/errors/error.go b/errors/error.go index 0ac2023..f0f05e0 100644 --- a/errors/error.go +++ b/errors/error.go @@ -10,19 +10,14 @@ import ( // Error parsing error type Error struct { Msg string - Pos position.Position + Pos *position.Position } // NewError creates and returns new Error -func NewError(msg string, t scanner.Token) *Error { +func NewError(msg string, t *scanner.Token) *Error { return &Error{ Msg: msg, - Pos: position.Position{ - StartLine: t.StartLine, - EndLine: t.EndLine, - StartPos: t.StartPos, - EndPos: t.EndPos, - }, + Pos: t.Position(), } } diff --git a/errors/error_test.go b/errors/error_test.go index f5b1a47..0f1eb6b 100644 --- a/errors/error_test.go +++ b/errors/error_test.go @@ -26,37 +26,22 @@ func assertEqual(t *testing.T, expected interface{}, actual interface{}) { } func TestConstructor(t *testing.T) { - token := scanner.Token{ - Value: "test", - StartLine: 1, - EndLine: 2, - StartPos: 3, - EndPos: 4, - } + pos := position.NewPosition(1, 2, 3, 4) + token := scanner.NewToken([]byte(`test`), pos) actual := errors.NewError("message", token) expected := &errors.Error{ Msg: "message", - Pos: position.Position{ - StartLine: 1, - EndLine: 2, - StartPos: 3, - EndPos: 4, - }, + Pos: pos, } assertEqual(t, expected, actual) } func TestPrint(t *testing.T) { - token := scanner.Token{ - Value: "test", - StartLine: 1, - EndLine: 2, - StartPos: 3, - EndPos: 4, - } + pos := position.NewPosition(1, 2, 3, 4) + token := scanner.NewToken([]byte(`test`), pos) Error := errors.NewError("message", token) diff --git a/parser/position_builder.go b/parser/position_builder.go index e09a0ba..d1079e8 100644 --- a/parser/position_builder.go +++ b/parser/position_builder.go @@ -100,42 +100,37 @@ func (b *PositionBuilder) NewNodePosition(n node.Node) *position.Position { } // NewTokenPosition returns new Position -func (b *PositionBuilder) NewTokenPosition(t scanner.Token) *position.Position { - return position.NewPosition( - t.StartLine, - t.EndLine, - t.StartPos, - t.EndPos, - ) +func (b *PositionBuilder) NewTokenPosition(t *scanner.Token) *position.Position { + return t.Position() } // NewTokensPosition returns new Position -func (b *PositionBuilder) NewTokensPosition(startToken scanner.Token, endToken scanner.Token) *position.Position { +func (b *PositionBuilder) NewTokensPosition(startToken *scanner.Token, endToken *scanner.Token) *position.Position { return position.NewPosition( - startToken.StartLine, - endToken.EndLine, - startToken.StartPos, - endToken.EndPos, + startToken.Position().StartLine, + endToken.Position().EndLine, + startToken.Position().StartPos, + endToken.Position().EndPos, ) } // NewTokenNodePosition returns new Position -func (b *PositionBuilder) NewTokenNodePosition(t scanner.Token, n node.Node) *position.Position { +func (b *PositionBuilder) NewTokenNodePosition(t *scanner.Token, n node.Node) *position.Position { return position.NewPosition( - t.StartLine, + t.Position().StartLine, b.getNodeEndPos(n).endLine, - t.StartPos, + t.Position().StartPos, b.getNodeEndPos(n).endPos, ) } // NewNodeTokenPosition returns new Position -func (b *PositionBuilder) NewNodeTokenPosition(n node.Node, t scanner.Token) *position.Position { +func (b *PositionBuilder) NewNodeTokenPosition(n node.Node, t *scanner.Token) *position.Position { return position.NewPosition( b.getNodeStartPos(n).startLine, - t.EndLine, + t.Position().EndLine, b.getNodeStartPos(n).startPos, - t.EndPos, + t.Position().EndPos, ) } @@ -150,21 +145,21 @@ func (b *PositionBuilder) NewNodesPosition(startNode node.Node, endNode node.Nod } // NewNodeListTokenPosition returns new Position -func (b *PositionBuilder) NewNodeListTokenPosition(list []node.Node, t scanner.Token) *position.Position { +func (b *PositionBuilder) NewNodeListTokenPosition(list []node.Node, t *scanner.Token) *position.Position { return position.NewPosition( b.getListStartPos(list).startLine, - t.EndLine, + t.Position().EndLine, b.getListStartPos(list).startPos, - t.EndPos, + t.Position().EndPos, ) } // NewTokenNodeListPosition returns new Position -func (b *PositionBuilder) NewTokenNodeListPosition(t scanner.Token, list []node.Node) *position.Position { +func (b *PositionBuilder) NewTokenNodeListPosition(t *scanner.Token, list []node.Node) *position.Position { return position.NewPosition( - t.StartLine, + t.Position().StartLine, b.getListEndPos(list).endLine, - t.StartPos, + t.Position().StartPos, b.getListEndPos(list).endPos, ) } @@ -180,20 +175,20 @@ func (b *PositionBuilder) NewNodeNodeListPosition(n node.Node, list []node.Node) } // NewOptionalListTokensPosition returns new Position -func (b *PositionBuilder) NewOptionalListTokensPosition(list []node.Node, t scanner.Token, endToken scanner.Token) *position.Position { +func (b *PositionBuilder) NewOptionalListTokensPosition(list []node.Node, t *scanner.Token, endToken *scanner.Token) *position.Position { if list == nil { return position.NewPosition( - t.StartLine, - endToken.EndLine, - t.StartPos, - endToken.EndPos, + t.Position().StartLine, + endToken.Position().EndLine, + t.Position().StartPos, + endToken.Position().EndPos, ) } return position.NewPosition( b.getListStartPos(list).startLine, - endToken.EndLine, + endToken.Position().EndLine, b.getListStartPos(list).startPos, - endToken.EndPos, + endToken.Position().EndPos, ) } diff --git a/parser/position_builder_test.go b/parser/position_builder_test.go index 0fda0ad..c794695 100644 --- a/parser/position_builder_test.go +++ b/parser/position_builder_test.go @@ -13,7 +13,8 @@ import ( func TestNewTokenPosition(t *testing.T) { builder := parser.PositionBuilder{} - tkn := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) + tpos := position.NewPosition(1, 1, 0, 3) + tkn := scanner.NewToken([]byte(`foo`), tpos) pos := builder.NewTokenPosition(tkn) @@ -25,8 +26,10 @@ func TestNewTokenPosition(t *testing.T) { func TestNewTokensPosition(t *testing.T) { builder := parser.PositionBuilder{} - token1 := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) - token2 := scanner.NewToken([]byte(`foo`), 2, 2, 4, 6) + tpos1 := position.NewPosition(1, 1, 0, 3) + token1 := scanner.NewToken([]byte(`foo`), tpos1) + tpos2 := position.NewPosition(2, 2, 4, 6) + token2 := scanner.NewToken([]byte(`foo`), tpos2) pos := builder.NewTokensPosition(token1, token2) @@ -58,7 +61,8 @@ func TestNewNodePosition(t *testing.T) { } func TestNewTokenNodePosition(t *testing.T) { - tkn := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) + tpos := position.NewPosition(1, 1, 0, 3) + tkn := scanner.NewToken([]byte(`foo`), tpos) n := node.NewIdentifier("test node") p := &parser.Positions{} @@ -82,7 +86,8 @@ func TestNewTokenNodePosition(t *testing.T) { func TestNewNodeTokenPosition(t *testing.T) { n := node.NewIdentifier("test node") - tkn := scanner.NewToken([]byte(`foo`), 2, 2, 10, 12) + tpos := position.NewPosition(2, 2, 10, 12) + tkn := scanner.NewToken([]byte(`foo`), tpos) p := &parser.Positions{} p.AddPosition(n, &position.Position{ @@ -162,7 +167,8 @@ func TestNewNodesPosition(t *testing.T) { func TestNewNodeListTokenPosition(t *testing.T) { n1 := node.NewIdentifier("test node") n2 := node.NewIdentifier("test node") - tkn := scanner.NewToken([]byte(`foo`), 3, 3, 20, 22) + tpos := position.NewPosition(3, 3, 20, 22) + tkn := scanner.NewToken([]byte(`foo`), tpos) builder := parser.PositionBuilder{ Positions: &parser.Positions{ @@ -189,7 +195,8 @@ func TestNewNodeListTokenPosition(t *testing.T) { } func TestNewTokenNodeListPosition(t *testing.T) { - tkn := scanner.NewToken([]byte(`foo`), 1, 1, 0, 2) + tpos := position.NewPosition(1, 1, 0, 2) + tkn := scanner.NewToken([]byte(`foo`), tpos) n1 := node.NewIdentifier("test node") n2 := node.NewIdentifier("test node") @@ -255,8 +262,10 @@ func TestNewNodeNodeListPosition(t *testing.T) { func TestNewOptionalListTokensPosition(t *testing.T) { builder := parser.PositionBuilder{} - token1 := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) - token2 := scanner.NewToken([]byte(`foo`), 2, 2, 4, 6) + tpos1 := position.NewPosition(1, 1, 0, 3) + token1 := scanner.NewToken([]byte(`foo`), tpos1) + tpos2 := position.NewPosition(2, 2, 4, 6) + token2 := scanner.NewToken([]byte(`foo`), tpos2) pos := builder.NewOptionalListTokensPosition(nil, token1, token2) @@ -293,8 +302,10 @@ func TestNewOptionalListTokensPosition2(t *testing.T) { }, } - token1 := scanner.NewToken([]byte(`foo`), 4, 4, 27, 29) - token2 := scanner.NewToken([]byte(`foo`), 5, 5, 30, 32) + tpos1 := position.NewPosition(4, 4, 27, 29) + token1 := scanner.NewToken([]byte(`foo`), tpos1) + tpos2 := position.NewPosition(5, 5, 30, 32) + token2 := scanner.NewToken([]byte(`foo`), tpos2) pos := builder.NewOptionalListTokensPosition([]node.Node{n2, n3}, token1, token2) @@ -335,7 +346,8 @@ func TestNilNodeListPos(t *testing.T) { } func TestNilNodeListTokenPos(t *testing.T) { - token1 := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) + tpos := position.NewPosition(1, 1, 0, 3) + token1 := scanner.NewToken([]byte(`foo`), tpos) builder := parser.PositionBuilder{} @@ -368,7 +380,8 @@ func TestEmptyNodeListPos(t *testing.T) { } func TestEmptyNodeListTokenPos(t *testing.T) { - token1 := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) + tpos := position.NewPosition(1, 1, 0, 3) + token1 := scanner.NewToken([]byte(`foo`), tpos) builder := parser.PositionBuilder{} diff --git a/php5/parser.go b/php5/parser.go index 7af4208..2d849fd 100644 --- a/php5/parser.go +++ b/php5/parser.go @@ -10,7 +10,7 @@ import ( "github.com/z7zmey/php-parser/scanner" ) -func (lval *yySymType) Token(t scanner.Token) { +func (lval *yySymType) Token(t *scanner.Token) { lval.token = t } @@ -45,12 +45,12 @@ func NewParser(src io.Reader, path string) *Parser { // Lex proxy to lexer Lex func (l *Parser) Lex(lval *yySymType) int { t := l.Lexer.Lex(lval) - l.lastToken = &lval.token + l.lastToken = lval.token return t } func (l *Parser) Error(msg string) { - l.errors = append(l.errors, errors.NewError(msg, *l.lastToken)) + l.errors = append(l.errors, errors.NewError(msg, l.lastToken)) } // Parse the php7 Parser entrypoint diff --git a/php5/php5.go b/php5/php5.go index 523c6f8..cb1facd 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -23,7 +23,7 @@ import ( type yySymType struct { yys int node node.Node - token scanner.Token + token *scanner.Token boolWithToken boolWithToken list []node.Node foreachVariable foreachVariable @@ -345,6 +345,7 @@ const yyErrCode = 2 const yyInitialStackSize = 16 //line php5/php5.y:3825 + type foreachVariable struct { node node.Node byRef bool @@ -352,7 +353,7 @@ type foreachVariable struct { type nodesWithEndToken struct { nodes []node.Node - endToken scanner.Token + endToken *scanner.Token } type boolWithToken struct { @@ -3132,7 +3133,7 @@ yydefault: yyDollar = yyS[yypt-1 : yypt+1] //line php5/php5.y:910 { - yyVAL.boolWithToken = boolWithToken{true, &yyDollar[1].token} + yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 91: yyDollar = yyS[yypt-0 : yypt+1] @@ -3144,7 +3145,7 @@ yydefault: yyDollar = yyS[yypt-1 : yypt+1] //line php5/php5.y:917 { - yyVAL.boolWithToken = boolWithToken{true, &yyDollar[1].token} + yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 93: yyDollar = yyS[yypt-9 : yypt+1] @@ -3557,10 +3558,10 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } else if yyDollar[2].boolWithToken.value == true { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(*yyDollar[2].boolWithToken.token, yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].boolWithToken.token, yyDollar[4].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].boolWithToken.token.Comments()) } else if yyDollar[3].boolWithToken.value == true { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(*yyDollar[3].boolWithToken.token, yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].boolWithToken.token, yyDollar[4].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].boolWithToken.token.Comments()) } else { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3585,10 +3586,10 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } else if yyDollar[2].boolWithToken.value == true { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(*yyDollar[2].boolWithToken.token, yyDollar[6].node)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].boolWithToken.token, yyDollar[6].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].boolWithToken.token.Comments()) } else if yyDollar[3].boolWithToken.value == true { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(*yyDollar[3].boolWithToken.token, yyDollar[6].node)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].boolWithToken.token, yyDollar[6].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].boolWithToken.token.Comments()) } else { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[6].node)) diff --git a/php5/php5.y b/php5/php5.y index 4a81af3..6ea6dd3 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -20,7 +20,7 @@ import ( %union{ node node.Node - token scanner.Token + token *scanner.Token boolWithToken boolWithToken list []node.Node foreachVariable foreachVariable @@ -907,14 +907,14 @@ is_reference: /* empty */ { $$ = boolWithToken{false, nil} } | '&' - { $$ = boolWithToken{true, &$1} } + { $$ = boolWithToken{true, $1} } ; is_variadic: /* empty */ { $$ = boolWithToken{false, nil} } | T_ELLIPSIS - { $$ = boolWithToken{true, &$1} } + { $$ = boolWithToken{true, $1} } ; unticked_function_declaration_statement: @@ -1255,10 +1255,10 @@ parameter: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) } else if $2.value == true { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition(*$2.token, $4)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($2.token, $4)) yylex.(*Parser).comments.AddComments($$, $2.token.Comments()) } else if $3.value == true { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition(*$3.token, $4)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($3.token, $4)) yylex.(*Parser).comments.AddComments($$, $3.token.Comments()) } else { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) @@ -1281,10 +1281,10 @@ parameter: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) } else if $2.value == true { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition(*$2.token, $6)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2.token, $6)) yylex.(*Parser).comments.AddComments($$, $2.token.Comments()) } else if $3.value == true { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition(*$3.token, $6)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3.token, $6)) yylex.(*Parser).comments.AddComments($$, $3.token.Comments()) } else { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) @@ -3831,7 +3831,7 @@ type foreachVariable struct { type nodesWithEndToken struct { nodes []node.Node - endToken scanner.Token + endToken *scanner.Token } type boolWithToken struct { diff --git a/php7/parser.go b/php7/parser.go index e461c24..5ec8c7c 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -10,7 +10,7 @@ import ( "github.com/z7zmey/php-parser/scanner" ) -func (lval *yySymType) Token(t scanner.Token) { +func (lval *yySymType) Token(t *scanner.Token) { lval.token = t } @@ -45,12 +45,12 @@ func NewParser(src io.Reader, path string) *Parser { // Lex proxy to lexer Lex func (l *Parser) Lex(lval *yySymType) int { t := l.Lexer.Lex(lval) - l.lastToken = &lval.token + l.lastToken = lval.token return t } func (l *Parser) Error(msg string) { - l.errors = append(l.errors, errors.NewError(msg, *l.lastToken)) + l.errors = append(l.errors, errors.NewError(msg, l.lastToken)) } // Parse the php7 Parser entrypoint diff --git a/php7/php7.go b/php7/php7.go index ee9c5e7..da05aaf 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -23,7 +23,7 @@ import ( type yySymType struct { yys int node node.Node - token scanner.Token + token *scanner.Token boolWithToken boolWithToken list []node.Node foreachVariable foreachVariable @@ -345,6 +345,7 @@ const yyErrCode = 2 const yyInitialStackSize = 16 //line php7/php7.y:2635 + type foreachVariable struct { node node.Node byRef bool @@ -352,7 +353,7 @@ type foreachVariable struct { type nodesWithEndToken struct { nodes []node.Node - endToken scanner.Token + endToken *scanner.Token } type boolWithToken struct { @@ -3242,7 +3243,7 @@ yydefault: yyDollar = yyS[yypt-1 : yypt+1] //line php7/php7.y:764 { - yyVAL.boolWithToken = boolWithToken{true, &yyDollar[1].token} + yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 167: yyDollar = yyS[yypt-0 : yypt+1] @@ -3254,7 +3255,7 @@ yydefault: yyDollar = yyS[yypt-1 : yypt+1] //line php7/php7.y:769 { - yyVAL.boolWithToken = boolWithToken{true, &yyDollar[1].token} + yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 169: yyDollar = yyS[yypt-9 : yypt+1] @@ -3623,11 +3624,11 @@ yydefault: yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } else if yyDollar[2].boolWithToken.value == true { yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(*yyDollar[2].boolWithToken.token, yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].boolWithToken.token, yyDollar[4].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].boolWithToken.token.Comments()) } else if yyDollar[3].boolWithToken.value == true { yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(*yyDollar[3].boolWithToken.token, yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].boolWithToken.token, yyDollar[4].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].boolWithToken.token.Comments()) } else { yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) @@ -3653,11 +3654,11 @@ yydefault: yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } else if yyDollar[2].boolWithToken.value == true { yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(*yyDollar[2].boolWithToken.token, yyDollar[6].node)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].boolWithToken.token, yyDollar[6].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].boolWithToken.token.Comments()) } else if yyDollar[3].boolWithToken.value == true { yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(*yyDollar[3].boolWithToken.token, yyDollar[6].node)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].boolWithToken.token, yyDollar[6].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].boolWithToken.token.Comments()) } else { yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) @@ -4893,7 +4894,7 @@ yydefault: yyDollar = yyS[yypt-1 : yypt+1] //line php7/php7.y:1963 { - yyVAL.boolWithToken = boolWithToken{true, &yyDollar[1].token} + yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 374: yyDollar = yyS[yypt-0 : yypt+1] diff --git a/php7/php7.y b/php7/php7.y index 478ec97..581e578 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -20,7 +20,7 @@ import ( %union{ node node.Node - token scanner.Token + token *scanner.Token boolWithToken boolWithToken list []node.Node foreachVariable foreachVariable @@ -761,12 +761,12 @@ function_declaration_statement: is_reference: /* empty */ { $$ = boolWithToken{false, nil} } - | '&' { $$ = boolWithToken{true, &$1} } + | '&' { $$ = boolWithToken{true, $1} } ; is_variadic: /* empty */ { $$ = boolWithToken{false, nil} } - | T_ELLIPSIS { $$ = boolWithToken{true, &$1} } + | T_ELLIPSIS { $$ = boolWithToken{true, $1} } ; class_declaration_statement: @@ -1044,11 +1044,11 @@ parameter: yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) } else if $2.value == true { $$ = node.NewParameter($1, variable, nil, $2.value, $3.value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition(*$2.token, $4)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($2.token, $4)) yylex.(*Parser).comments.AddComments($$, $2.token.Comments()) } else if $3.value == true { $$ = node.NewParameter($1, variable, nil, $2.value, $3.value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition(*$3.token, $4)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($3.token, $4)) yylex.(*Parser).comments.AddComments($$, $3.token.Comments()) } else { $$ = node.NewParameter($1, variable, nil, $2.value, $3.value) @@ -1072,11 +1072,11 @@ parameter: yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) } else if $2.value == true { $$ = node.NewParameter($1, variable, $6, $2.value, $3.value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition(*$2.token, $6)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2.token, $6)) yylex.(*Parser).comments.AddComments($$, $2.token.Comments()) } else if $3.value == true { $$ = node.NewParameter($1, variable, $6, $2.value, $3.value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition(*$3.token, $6)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3.token, $6)) yylex.(*Parser).comments.AddComments($$, $3.token.Comments()) } else { $$ = node.NewParameter($1, variable, $6, $2.value, $3.value) @@ -1960,7 +1960,7 @@ backup_doc_comment: returns_ref: /* empty */ { $$ = boolWithToken{false, nil} } - | '&' { $$ = boolWithToken{true, &$1} } + | '&' { $$ = boolWithToken{true, $1} } ; lexical_vars: @@ -2641,7 +2641,7 @@ type foreachVariable struct { type nodesWithEndToken struct { nodes []node.Node - endToken scanner.Token + endToken *scanner.Token } type boolWithToken struct { diff --git a/scanner/lexer.go b/scanner/lexer.go index 999f009..6eba61b 100644 --- a/scanner/lexer.go +++ b/scanner/lexer.go @@ -432,7 +432,7 @@ const T_POW = 57481 // Lval parsers yySymType must implement this interface type Lval interface { - Token(tkn Token) + Token(tkn *Token) } // Lexer php lexer @@ -510,16 +510,18 @@ func (l *Lexer) getCurrentState() int { return l.StateStack[len(l.StateStack)-1] } -func (l *Lexer) newToken(chars []lex.Char) Token { +func (l *Lexer) newToken(chars []lex.Char) *Token { firstChar := chars[0] lastChar := chars[len(chars)-1] - startLine := l.File.Line(firstChar.Pos()) - endLine := l.File.Line(lastChar.Pos()) - startPos := int(firstChar.Pos()) - endPos := int(lastChar.Pos()) + pos := position.NewPosition( + l.File.Line(firstChar.Pos()), + l.File.Line(lastChar.Pos()), + int(firstChar.Pos()), + int(lastChar.Pos()), + ) - return NewToken(l.charsToBytes(chars), startLine, endLine, startPos, endPos).SetComments(l.Comments) + return NewToken(l.charsToBytes(chars), pos).SetComments(l.Comments) } func (l *Lexer) addComment(chars []lex.Char) { diff --git a/scanner/scanner_test.go b/scanner/scanner_test.go index 3195757..5f743e6 100644 --- a/scanner/scanner_test.go +++ b/scanner/scanner_test.go @@ -28,10 +28,10 @@ func assertEqual(t *testing.T, expected interface{}, actual interface{}) { } type lval struct { - Tkn scanner.Token + Tkn *scanner.Token } -func (lv *lval) Token(t scanner.Token) { +func (lv *lval) Token(t *scanner.Token) { lv.Tkn = t } diff --git a/scanner/token.go b/scanner/token.go index ec8c8f2..fa00965 100644 --- a/scanner/token.go +++ b/scanner/token.go @@ -2,35 +2,41 @@ package scanner import ( "github.com/z7zmey/php-parser/comment" + "github.com/z7zmey/php-parser/position" ) // Token value returned by lexer type Token struct { - Value string - StartLine int - EndLine int - StartPos int - EndPos int - comments []*comment.Comment + Value string + position *position.Position + comments []*comment.Comment } // NewToken Token constructor -// TODO: return pointer -func NewToken(value []byte, startLine int, endLine int, startPos int, endPos int) Token { - return Token{string(value), startLine, endLine, startPos, endPos, nil} +func NewToken(value []byte, pos *position.Position) *Token { + return &Token{ + Value: string(value), + position: pos, + comments: nil, + } } -func (t Token) String() string { +func (t *Token) String() string { return string(t.Value) } +// Position returns token position +func (t *Token) Position() *position.Position { + return t.position +} + // Comments returns attached comments -func (t Token) Comments() []*comment.Comment { +func (t *Token) Comments() []*comment.Comment { return t.comments } // SetComments attach comments -func (t Token) SetComments(comments []*comment.Comment) Token { +func (t *Token) SetComments(comments []*comment.Comment) *Token { t.comments = comments return t } diff --git a/scanner/token_test.go b/scanner/token_test.go index 2993267..940ed41 100644 --- a/scanner/token_test.go +++ b/scanner/token_test.go @@ -4,13 +4,16 @@ import ( "reflect" "testing" + "github.com/z7zmey/php-parser/position" + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/scanner" ) func TestToken(t *testing.T) { - tkn := scanner.NewToken([]byte(`foo`), 1, 1, 0, 3) + pos := position.NewPosition(1, 1, 0, 3) + tkn := scanner.NewToken([]byte(`foo`), pos) c := []*comment.Comment{ comment.NewComment("test comment", nil), @@ -18,7 +21,7 @@ func TestToken(t *testing.T) { tkn.SetComments(c) - if reflect.DeepEqual(tkn.Comments(), c) { + if !reflect.DeepEqual(tkn.Comments(), c) { t.Errorf("comments are not equal\n") } @@ -26,7 +29,7 @@ func TestToken(t *testing.T) { t.Errorf("token value is not equal\n") } - if tkn.StartLine != 1 || tkn.EndLine != 1 || tkn.StartPos != 0 || tkn.EndPos != 3 { + if tkn.Position() != pos { t.Errorf("token position is not equal\n") } } From a28fd2e8ec84e12642beab4c79584880f5b0d88b Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 15 Apr 2018 23:04:24 +0300 Subject: [PATCH 07/25] rename lastToken to currentToken --- php5/parser.go | 6 +++--- php7/parser.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/php5/parser.go b/php5/parser.go index 2d849fd..c134e6f 100644 --- a/php5/parser.go +++ b/php5/parser.go @@ -18,7 +18,7 @@ func (lval *yySymType) Token(t *scanner.Token) { type Parser struct { *scanner.Lexer path string - lastToken *scanner.Token + currentToken *scanner.Token positionBuilder *parser.PositionBuilder errors []*errors.Error rootNode node.Node @@ -45,12 +45,12 @@ func NewParser(src io.Reader, path string) *Parser { // Lex proxy to lexer Lex func (l *Parser) Lex(lval *yySymType) int { t := l.Lexer.Lex(lval) - l.lastToken = lval.token + l.currentToken = lval.token return t } func (l *Parser) Error(msg string) { - l.errors = append(l.errors, errors.NewError(msg, l.lastToken)) + l.errors = append(l.errors, errors.NewError(msg, l.currentToken)) } // Parse the php7 Parser entrypoint diff --git a/php7/parser.go b/php7/parser.go index 5ec8c7c..67e5b59 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -18,7 +18,7 @@ func (lval *yySymType) Token(t *scanner.Token) { type Parser struct { *scanner.Lexer path string - lastToken *scanner.Token + currentToken *scanner.Token positionBuilder *parser.PositionBuilder errors []*errors.Error rootNode node.Node @@ -45,12 +45,12 @@ func NewParser(src io.Reader, path string) *Parser { // Lex proxy to lexer Lex func (l *Parser) Lex(lval *yySymType) int { t := l.Lexer.Lex(lval) - l.lastToken = lval.token + l.currentToken = lval.token return t } func (l *Parser) Error(msg string) { - l.errors = append(l.errors, errors.NewError(msg, l.lastToken)) + l.errors = append(l.errors, errors.NewError(msg, l.currentToken)) } // Parse the php7 Parser entrypoint From a9f54cba27d5898b8f4f393d40b776ecab4aaf14 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 27 May 2018 00:55:26 +0300 Subject: [PATCH 08/25] scanner: remove unnecessary lval.Token calls --- scanner/scanner.go | 23 ++++++----------------- scanner/scanner.l | 13 +++++-------- 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/scanner/scanner.go b/scanner/scanner.go index fc80d5e..8533317 100644 --- a/scanner/scanner.go +++ b/scanner/scanner.go @@ -7493,10 +7493,8 @@ yystate598: } yyrule1: // [ \t\n\r]+ - { - lval.Token(l.newToken(l.Token())) - goto yystate0 - } + + goto yystate0 yyrule2: // . { @@ -7523,13 +7521,11 @@ yyrule2: // . yyrule3: // \<\?php([ \t]|{NEW_LINE}) { l.begin(PHP) - lval.Token(l.newToken(l.Token())) // return T_OPEN_TAG; goto yystate0 } yyrule4: // \<\? { l.begin(PHP) - lval.Token(l.newToken(l.Token())) // return T_OPEN_TAG; goto yystate0 } yyrule5: // \<\?= @@ -7540,10 +7536,8 @@ yyrule5: // \<\?= goto yystate0 } yyrule6: // [ \t\n\r]+ - { - lval.Token(l.newToken(l.Token())) // return T_WHITESPACE - goto yystate0 - } + + goto yystate0 yyrule7: // [;][ \t\n\r]*\?\>{NEW_LINE}? { l.begin(INITIAL) @@ -8360,14 +8354,11 @@ yyrule127: // ([/][*])|([/][*][*]) } c = l.Next() } - lval.Token(l.newToken(l.Token())) if is_doc_comment { l.PhpDocComment = string(l.TokenBytes(nil)) l.addComment(l.Token()) - // return T_DOC_COMMENT } else { l.addComment(l.Token()) - // return T_COMMENT } goto yystate0 } @@ -8412,10 +8403,8 @@ yyrule133: // -> goto yystate0 } yyrule134: // [ \t\n\r]+ - { - lval.Token(l.newToken(l.Token())) // return T_WHITESPACE; - goto yystate0 - } + + goto yystate0 yyrule135: // -> { lval.Token(l.newToken(l.Token())) diff --git a/scanner/scanner.l b/scanner/scanner.l index 624d1b6..f21104f 100644 --- a/scanner/scanner.l +++ b/scanner/scanner.l @@ -60,7 +60,7 @@ NEW_LINE (\r|\n|\r\n) %% c = l.Rule0() -[ \t\n\r]+ lval.Token(l.newToken(l.Token())); +[ \t\n\r]+ . tb := []lex.Char{} @@ -87,11 +87,11 @@ NEW_LINE (\r|\n|\r\n) lval.Token(l.newToken(tb)) return T_INLINE_HTML -\<\?php([ \t]|{NEW_LINE}) l.begin(PHP);lval.Token(l.newToken(l.Token()));// return T_OPEN_TAG; -\<\? l.begin(PHP);lval.Token(l.newToken(l.Token()));// return T_OPEN_TAG; +\<\?php([ \t]|{NEW_LINE}) l.begin(PHP); +\<\? l.begin(PHP); \<\?= l.begin(PHP);lval.Token(l.newToken(l.Token())); return T_ECHO; -[ \t\n\r]+ lval.Token(l.newToken(l.Token()));// return T_WHITESPACE +[ \t\n\r]+ [;][ \t\n\r]*\?\>{NEW_LINE}? l.begin(INITIAL);lval.Token(l.newToken(l.Token())); return Rune2Class(';'); \?\>{NEW_LINE}? l.begin(INITIAL);lval.Token(l.newToken(l.Token())); return Rune2Class(';'); @@ -310,14 +310,11 @@ NEW_LINE (\r|\n|\r\n) c = l.Next() } - lval.Token(l.newToken(l.Token())) if is_doc_comment { l.PhpDocComment = string(l.TokenBytes(nil)) l.addComment(l.Token()) - // return T_DOC_COMMENT } else { l.addComment(l.Token()) - // return T_COMMENT } {OPERATORS} lval.Token(l.newToken(l.Token())); return Rune2Class(rune(l.TokenBytes(nil)[0])) @@ -328,7 +325,7 @@ NEW_LINE (\r|\n|\r\n) {VAR_NAME} lval.Token(l.newToken(l.Token())); return T_STRING -> l.begin(PROPERTY);lval.Token(l.newToken(l.Token())); return T_OBJECT_OPERATOR; -[ \t\n\r]+ lval.Token(l.newToken(l.Token())); // return T_WHITESPACE; +[ \t\n\r]+ -> lval.Token(l.newToken(l.Token())); return T_OBJECT_OPERATOR; {VAR_NAME} l.begin(PHP);lval.Token(l.newToken(l.Token())); return T_STRING; . l.ungetChars(1);l.begin(PHP) From e396f81eeacc96d92468d458fc1b8c695e79d9bd Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 27 May 2018 18:02:58 +0300 Subject: [PATCH 09/25] php7: save all comments --- php5/php5.go | 3172 +++++++++++++------------- php5/php5.y | 32 + php7/parser.go | 27 +- php7/php7.go | 4627 ++++++++++++++++++++++++-------------- php7/php7.y | 4836 ++++++++++++++++++++++++++-------------- scanner/lexer.go | 64 +- visitor/dumper_test.go | 4 - 7 files changed, 7795 insertions(+), 4967 deletions(-) diff --git a/php5/php5.go b/php5/php5.go index cb1facd..07307a3 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -148,26 +148,26 @@ const T_NOELSE = 57458 const T_PLUS_EQUAL = 57459 const T_MINUS_EQUAL = 57460 const T_MUL_EQUAL = 57461 -const T_DIV_EQUAL = 57462 -const T_CONCAT_EQUAL = 57463 -const T_MOD_EQUAL = 57464 -const T_AND_EQUAL = 57465 -const T_OR_EQUAL = 57466 -const T_XOR_EQUAL = 57467 -const T_SL_EQUAL = 57468 -const T_SR_EQUAL = 57469 -const T_POW_EQUAL = 57470 +const T_POW_EQUAL = 57462 +const T_DIV_EQUAL = 57463 +const T_CONCAT_EQUAL = 57464 +const T_MOD_EQUAL = 57465 +const T_AND_EQUAL = 57466 +const T_OR_EQUAL = 57467 +const T_XOR_EQUAL = 57468 +const T_SL_EQUAL = 57469 +const T_SR_EQUAL = 57470 const T_BOOLEAN_OR = 57471 const T_BOOLEAN_AND = 57472 -const T_IS_EQUAL = 57473 -const T_IS_NOT_EQUAL = 57474 -const T_IS_IDENTICAL = 57475 -const T_IS_NOT_IDENTICAL = 57476 -const T_IS_SMALLER_OR_EQUAL = 57477 -const T_IS_GREATER_OR_EQUAL = 57478 -const T_SL = 57479 -const T_SR = 57480 -const T_POW = 57481 +const T_POW = 57473 +const T_SL = 57474 +const T_SR = 57475 +const T_IS_IDENTICAL = 57476 +const T_IS_NOT_IDENTICAL = 57477 +const T_IS_EQUAL = 57478 +const T_IS_NOT_EQUAL = 57479 +const T_IS_SMALLER_OR_EQUAL = 57480 +const T_IS_GREATER_OR_EQUAL = 57481 var yyToknames = [...]string{ "$end", @@ -286,6 +286,29 @@ var yyToknames = [...]string{ "T_COALESCE", "T_SPACESHIP", "T_NOELSE", + "T_PLUS_EQUAL", + "T_MINUS_EQUAL", + "T_MUL_EQUAL", + "T_POW_EQUAL", + "T_DIV_EQUAL", + "T_CONCAT_EQUAL", + "T_MOD_EQUAL", + "T_AND_EQUAL", + "T_OR_EQUAL", + "T_XOR_EQUAL", + "T_SL_EQUAL", + "T_SR_EQUAL", + "T_BOOLEAN_OR", + "T_BOOLEAN_AND", + "T_POW", + "T_SL", + "T_SR", + "T_IS_IDENTICAL", + "T_IS_NOT_IDENTICAL", + "T_IS_EQUAL", + "T_IS_NOT_EQUAL", + "T_IS_SMALLER_OR_EQUAL", + "T_IS_GREATER_OR_EQUAL", "'\"'", "'`'", "'{'", @@ -305,38 +328,15 @@ var yyToknames = [...]string{ "'@'", "'$'", "','", - "'='", - "T_PLUS_EQUAL", - "T_MINUS_EQUAL", - "T_MUL_EQUAL", - "T_DIV_EQUAL", - "T_CONCAT_EQUAL", - "T_MOD_EQUAL", - "T_AND_EQUAL", - "T_OR_EQUAL", - "T_XOR_EQUAL", - "T_SL_EQUAL", - "T_SR_EQUAL", - "T_POW_EQUAL", - "T_BOOLEAN_OR", - "T_BOOLEAN_AND", "'|'", + "'='", "'^'", - "T_IS_EQUAL", - "T_IS_NOT_EQUAL", - "T_IS_IDENTICAL", - "T_IS_NOT_IDENTICAL", - "'<'", - "T_IS_SMALLER_OR_EQUAL", - "'>'", - "T_IS_GREATER_OR_EQUAL", - "T_SL", - "T_SR", - "'.'", "'*'", "'/'", "'%'", - "T_POW", + "'<'", + "'>'", + "'.'", } var yyStatenames = [...]string{} @@ -344,7 +344,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:3825 +//line php5/php5.y:3857 type foreachVariable struct { node node.Node @@ -388,21 +388,21 @@ var yyExca = [...]int{ -2, 411, -1, 114, 78, 451, - 123, 447, + 146, 447, -2, 457, -1, 154, 104, 435, 105, 435, -2, 433, -1, 204, - 121, 306, - 124, 306, + 144, 306, + 147, 306, -2, 430, -1, 205, 104, 435, 105, 435, - 121, 307, - 124, 307, + 144, 307, + 147, 307, -2, 433, -1, 271, 78, 451, @@ -411,95 +411,95 @@ var yyExca = [...]int{ 78, 334, -2, 413, -1, 302, - 123, 448, + 146, 448, -2, 458, -1, 311, 78, 333, -2, 412, -1, 378, - 153, 0, - 154, 0, - 155, 0, - 156, 0, + 134, 0, + 135, 0, + 136, 0, + 137, 0, -2, 274, -1, 379, - 153, 0, - 154, 0, - 155, 0, - 156, 0, + 134, 0, + 135, 0, + 136, 0, + 137, 0, -2, 275, -1, 380, - 153, 0, - 154, 0, - 155, 0, - 156, 0, + 134, 0, + 135, 0, + 136, 0, + 137, 0, -2, 276, -1, 381, - 153, 0, - 154, 0, - 155, 0, - 156, 0, + 134, 0, + 135, 0, + 136, 0, + 137, 0, -2, 277, -1, 382, - 157, 0, - 158, 0, - 159, 0, - 160, 0, + 138, 0, + 139, 0, + 165, 0, + 166, 0, -2, 278, -1, 383, - 157, 0, - 158, 0, - 159, 0, - 160, 0, + 138, 0, + 139, 0, + 165, 0, + 166, 0, -2, 279, -1, 384, - 157, 0, - 158, 0, - 159, 0, - 160, 0, + 138, 0, + 139, 0, + 165, 0, + 166, 0, -2, 280, -1, 385, - 157, 0, - 158, 0, - 159, 0, - 160, 0, + 138, 0, + 139, 0, + 165, 0, + 166, 0, -2, 281, -1, 392, 104, 435, 105, 435, -2, 433, -1, 400, - 124, 142, + 147, 142, -2, 147, -1, 462, 104, 435, 105, 435, - 124, 514, - 135, 514, + 147, 514, + 158, 514, -2, 433, -1, 463, - 124, 515, - 135, 515, + 147, 515, + 158, 515, -2, 430, -1, 464, 104, 435, 105, 435, -2, 433, -1, 486, - 124, 156, - 135, 156, + 147, 156, + 158, 156, -2, 430, -1, 487, 104, 435, 105, 435, - 124, 157, - 135, 157, + 147, 157, + 158, 157, -2, 433, -1, 493, - 123, 472, + 146, 472, -2, 516, -1, 499, - 123, 472, + 146, 472, -2, 517, -1, 521, 78, 332, @@ -510,71 +510,71 @@ var yyExca = [...]int{ 95, 135, -2, 0, -1, 551, - 124, 142, + 147, 142, -2, 147, -1, 564, - 124, 142, + 147, 142, -2, 147, -1, 581, - 121, 308, - 124, 308, + 144, 308, + 147, 308, -2, 430, -1, 582, 104, 435, 105, 435, - 121, 309, - 124, 309, + 144, 309, + 147, 309, -2, 433, -1, 681, 78, 334, -2, 371, -1, 779, - 153, 0, - 154, 0, - 155, 0, - 156, 0, + 134, 0, + 135, 0, + 136, 0, + 137, 0, -2, 397, -1, 780, - 153, 0, - 154, 0, - 155, 0, - 156, 0, + 134, 0, + 135, 0, + 136, 0, + 137, 0, -2, 398, -1, 781, - 153, 0, - 154, 0, - 155, 0, - 156, 0, + 134, 0, + 135, 0, + 136, 0, + 137, 0, -2, 399, -1, 782, - 153, 0, - 154, 0, - 155, 0, - 156, 0, + 134, 0, + 135, 0, + 136, 0, + 137, 0, -2, 400, -1, 783, - 157, 0, - 158, 0, - 159, 0, - 160, 0, + 138, 0, + 139, 0, + 165, 0, + 166, 0, -2, 401, -1, 784, - 157, 0, - 158, 0, - 159, 0, - 160, 0, + 138, 0, + 139, 0, + 165, 0, + 166, 0, -2, 402, -1, 785, - 157, 0, - 158, 0, - 159, 0, - 160, 0, + 138, 0, + 139, 0, + 165, 0, + 166, 0, -2, 403, -1, 786, - 157, 0, - 158, 0, - 159, 0, - 160, 0, + 138, 0, + 139, 0, + 165, 0, + 166, 0, -2, 404, -1, 789, 78, 333, @@ -586,7 +586,7 @@ var yyExca = [...]int{ 31, 128, 32, 128, 33, 128, - 120, 128, + 143, 128, -2, 0, -1, 914, 95, 140, @@ -595,7 +595,7 @@ var yyExca = [...]int{ 31, 127, 32, 127, 33, 127, - 120, 127, + 143, 127, -2, 0, -1, 943, 93, 136, @@ -606,16 +606,16 @@ var yyExca = [...]int{ 29, 189, -2, 4, -1, 980, - 124, 142, + 147, 142, -2, 147, -1, 997, - 121, 193, + 144, 193, -2, 195, } const yyPrivate = 57344 -const yyLast = 8512 +const yyLast = 9012 var yyAct = [...]int{ @@ -623,300 +623,268 @@ var yyAct = [...]int{ 123, 131, 606, 200, 340, 918, 734, 567, 452, 815, 474, 683, 296, 594, 461, 592, 421, 61, 579, 142, 319, 315, 39, 98, 264, 390, 158, 517, 130, 2, - 444, 115, 289, 192, 653, 118, 138, 140, 447, 544, - 145, 485, 179, 653, 978, 1002, 228, 228, 162, 477, - 941, 331, 940, 43, 7, 493, 959, 121, 330, 937, - 934, 6, 931, 26, 821, 932, 939, 450, 499, 121, - 121, 267, 44, 656, 658, 659, 657, 953, 432, 933, - 921, 897, 853, 737, 192, 657, 709, 562, 954, 632, - 251, 586, 618, 586, 298, 898, 735, 494, 153, 516, - 633, 653, 585, 619, 270, 655, 654, 137, 358, 325, - 179, 560, 272, 586, 793, 204, 311, 556, 510, 316, - 320, 728, 561, 323, 114, 258, 329, 241, 557, 5, - 506, 305, 511, 675, 677, 676, 678, 663, 664, 665, - 656, 658, 659, 657, 507, 543, 339, 141, 653, 359, - 121, 228, 655, 654, 310, 475, 355, 39, 178, 180, - 181, 179, 121, 360, 451, 159, 357, 350, 312, 162, - 356, 201, 1018, 976, 929, 907, 451, 451, 906, 120, - 192, 351, 313, 267, 133, 228, 665, 656, 658, 659, - 657, 120, 120, 904, 117, 861, 855, 653, 134, 791, - 661, 655, 654, 241, 745, 271, 653, 104, 595, 639, - 655, 654, 301, 228, 352, 631, 270, 386, 300, 177, - 176, 425, 630, 624, 272, 673, 674, 671, 672, 675, - 677, 676, 678, 663, 664, 665, 656, 658, 659, 657, - 302, 623, 663, 664, 665, 656, 658, 659, 657, 597, - 232, 232, 228, 175, 178, 180, 181, 179, 596, 595, - 456, 473, 749, 231, 231, 333, 440, 336, 393, 748, - 604, 294, 120, 611, 293, 273, 740, 453, 295, 610, - 287, 281, 254, 228, 303, 253, 399, 160, 265, 977, - 930, 1001, 950, 915, 885, 449, 882, 870, 825, 446, - 814, 727, 693, 634, 131, 396, 625, 621, 509, 430, - 428, 490, 513, 307, 241, 1013, 521, 271, 980, 297, - 892, 472, 139, 297, 504, 999, 824, 593, 818, 682, - 39, 449, 913, 434, 439, 492, 449, 587, 491, 502, - 498, 564, 505, 497, 809, 808, 876, 463, 465, 521, - 551, 126, 400, 121, 537, 232, 541, 288, 278, 275, - 467, 484, 7, 274, 344, 250, 471, 345, 231, 6, - 486, 222, 479, 480, 196, 195, 194, 144, 548, 495, - 122, 135, 436, 437, 989, 546, 552, 273, 448, 232, - 1010, 572, 1009, 572, 577, 572, 580, 458, 228, 400, - 265, 984, 231, 983, 126, 923, 121, 912, 437, 436, - 436, 126, 437, 121, 880, 588, 39, 232, 703, 704, - 229, 703, 704, 230, 448, 811, 805, 804, 798, 448, - 231, 295, 584, 712, 699, 547, 545, 5, 490, 233, - 542, 501, 539, 398, 348, 540, 615, 156, 981, 126, - 905, 121, 605, 423, 1019, 975, 232, 609, 449, 449, - 874, 917, 492, 498, 891, 491, 497, 890, 309, 231, - 308, 126, 888, 229, 732, 120, 230, 578, 581, 228, - 229, 306, 197, 230, 435, 830, 449, 232, 616, 449, - 614, 449, 233, 446, 295, 617, 224, 225, 316, 233, - 231, 987, 320, 257, 637, 638, 810, 521, 730, 702, - 641, 642, 802, 803, 681, 680, 521, 455, 229, 126, - 353, 230, 39, 521, 521, 521, 521, 521, 120, 645, - 695, 696, 648, 531, 259, 120, 650, 233, 635, 438, - 126, 647, 572, 125, 652, 710, 424, 700, 228, 228, - 228, 448, 448, 521, 7, 572, 718, 125, 726, 39, - 39, 6, 91, 126, 971, 731, 531, 572, 580, 569, - 570, 126, 729, 120, 612, 267, 687, 228, 228, 448, - 124, 459, 448, 713, 448, 705, 739, 707, 573, 295, - 723, 574, 454, 427, 295, 733, 282, 286, 260, 261, - 469, 504, 232, 738, 426, 304, 742, 741, 270, 736, - 126, 299, 321, 126, 816, 231, 272, 864, 228, 595, - 228, 518, 686, 515, 62, 512, 744, 449, 508, 5, - 457, 446, 573, 573, 754, 574, 574, 128, 129, 468, - 322, 54, 263, 317, 521, 521, 521, 521, 521, 521, + 444, 115, 289, 978, 959, 118, 138, 140, 447, 544, + 145, 485, 937, 657, 663, 664, 228, 228, 162, 477, + 657, 331, 934, 941, 7, 940, 931, 821, 330, 737, + 653, 6, 43, 26, 655, 654, 709, 653, 562, 939, + 657, 267, 44, 516, 656, 658, 659, 358, 432, 665, + 325, 656, 658, 659, 953, 932, 1002, 653, 735, 921, + 251, 655, 654, 793, 298, 954, 897, 853, 153, 933, + 586, 656, 658, 659, 270, 728, 665, 137, 586, 543, + 898, 493, 272, 121, 192, 204, 311, 632, 192, 316, + 320, 618, 585, 323, 114, 258, 329, 241, 633, 5, + 510, 305, 619, 586, 450, 121, 121, 192, 499, 121, + 121, 657, 663, 664, 511, 560, 339, 141, 677, 678, + 126, 228, 121, 494, 310, 179, 561, 39, 653, 179, + 182, 183, 655, 654, 159, 475, 357, 201, 556, 162, + 506, 976, 656, 658, 659, 675, 676, 665, 179, 557, + 177, 176, 359, 267, 507, 228, 178, 180, 181, 929, + 178, 180, 181, 907, 117, 175, 360, 906, 355, 177, + 176, 350, 904, 241, 126, 271, 121, 104, 861, 178, + 180, 181, 356, 228, 175, 351, 270, 386, 126, 229, + 121, 425, 230, 352, 272, 312, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 233, 313, + 302, 133, 657, 451, 855, 791, 595, 745, 301, 639, + 232, 232, 228, 717, 300, 134, 620, 631, 120, 653, + 456, 630, 624, 231, 231, 333, 451, 336, 393, 209, + 451, 623, 611, 229, 597, 273, 230, 453, 610, 749, + 120, 120, 353, 228, 303, 120, 596, 229, 265, 595, + 230, 473, 233, 440, 748, 449, 604, 120, 294, 446, + 295, 293, 287, 281, 131, 396, 233, 1018, 509, 160, + 977, 490, 513, 254, 241, 253, 521, 271, 1001, 950, + 915, 472, 885, 882, 504, 870, 825, 814, 930, 727, + 39, 449, 693, 434, 634, 492, 449, 740, 491, 502, + 498, 399, 505, 497, 625, 716, 621, 463, 465, 521, + 430, 120, 428, 307, 913, 232, 541, 1013, 980, 892, + 467, 484, 7, 139, 297, 120, 471, 297, 231, 6, + 486, 824, 479, 480, 818, 809, 808, 192, 548, 495, + 593, 682, 436, 437, 439, 546, 552, 273, 448, 232, + 587, 572, 564, 572, 577, 572, 580, 458, 228, 551, + 265, 400, 231, 537, 344, 288, 278, 345, 437, 436, + 436, 295, 437, 275, 274, 588, 39, 232, 179, 182, + 183, 250, 222, 196, 448, 189, 191, 195, 194, 448, + 231, 144, 122, 1010, 876, 1009, 999, 5, 490, 177, + 176, 135, 539, 989, 984, 540, 615, 983, 923, 178, + 180, 181, 188, 190, 175, 912, 232, 609, 449, 449, + 703, 704, 492, 498, 880, 491, 497, 811, 805, 231, + 804, 309, 798, 308, 712, 1019, 699, 400, 581, 228, + 703, 704, 547, 545, 542, 501, 449, 232, 616, 449, + 614, 449, 398, 446, 348, 617, 156, 981, 316, 905, + 231, 126, 320, 605, 637, 638, 975, 521, 917, 891, + 641, 642, 890, 888, 681, 732, 521, 578, 306, 197, + 435, 179, 39, 521, 521, 521, 521, 521, 192, 645, + 224, 225, 648, 531, 874, 802, 803, 830, 635, 695, + 696, 650, 572, 257, 652, 710, 647, 700, 228, 228, + 228, 448, 448, 521, 7, 572, 718, 295, 726, 39, + 39, 6, 91, 126, 515, 731, 531, 572, 580, 179, + 126, 810, 729, 125, 612, 267, 259, 228, 228, 448, + 730, 438, 448, 713, 448, 705, 739, 707, 680, 455, + 723, 702, 424, 125, 295, 733, 987, 128, 129, 295, + 687, 504, 232, 738, 126, 459, 742, 741, 270, 736, + 126, 454, 126, 569, 570, 231, 272, 295, 228, 971, + 228, 518, 427, 426, 304, 512, 744, 449, 299, 5, + 126, 446, 573, 124, 754, 574, 282, 286, 469, 686, + 260, 261, 132, 816, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 789, 743, 521, 576, 758, 295, 756, 295, 757, - 285, 295, 132, 232, 404, 132, 259, 720, 239, 750, - 402, 438, 463, 295, 790, 792, 231, 226, 234, 259, - 521, 208, 126, 207, 121, 985, 486, 228, 259, 271, - 827, 823, 259, 799, 795, 45, 1007, 438, 725, 572, - 448, 831, 986, 163, 531, 1017, 572, 850, 819, 338, - 812, 703, 704, 531, 559, 991, 828, 813, 957, 832, - 531, 531, 531, 531, 531, 851, 955, 856, 45, 453, - 260, 261, 232, 232, 232, 742, 796, 609, 706, 703, - 704, 858, 469, 260, 261, 231, 231, 231, 925, 896, - 531, 268, 260, 261, 269, 470, 260, 261, 521, 273, - 893, 232, 232, 259, 521, 521, 550, 1003, 284, 998, - 233, 960, 265, 935, 231, 231, 847, 848, 849, 846, - 845, 844, 901, 599, 878, 601, 600, 228, 126, 228, - 877, 760, 521, 883, 881, 572, 889, 884, 759, 854, - 875, 722, 232, 800, 232, 651, 120, 859, 860, 820, - 649, 646, 900, 572, 903, 231, 602, 231, 514, 481, - 39, 395, 324, 203, 202, 841, 285, 260, 261, 887, - 199, 842, 136, 1, 840, 944, 335, 228, 899, 829, + 521, 789, 743, 521, 54, 758, 321, 756, 295, 757, + 864, 573, 317, 232, 574, 508, 259, 720, 573, 750, + 595, 574, 463, 322, 790, 792, 231, 285, 62, 126, + 521, 121, 132, 126, 468, 121, 486, 228, 126, 271, + 121, 457, 263, 799, 576, 404, 402, 795, 208, 572, + 448, 831, 207, 985, 531, 827, 572, 850, 819, 823, + 226, 234, 1007, 531, 45, 725, 828, 813, 295, 832, + 531, 531, 531, 531, 531, 851, 295, 856, 423, 453, + 260, 261, 232, 232, 232, 742, 986, 609, 163, 796, + 559, 858, 239, 338, 1017, 231, 231, 231, 229, 991, + 531, 230, 268, 957, 955, 269, 925, 229, 521, 273, + 230, 232, 232, 45, 521, 521, 896, 233, 259, 584, + 893, 233, 265, 438, 231, 231, 233, 847, 848, 849, + 846, 845, 844, 599, 878, 601, 600, 228, 550, 228, + 877, 1003, 521, 883, 881, 572, 889, 884, 998, 854, + 875, 960, 232, 800, 232, 935, 901, 859, 860, 820, + 126, 760, 900, 572, 903, 231, 759, 231, 722, 651, + 39, 649, 259, 1, 646, 259, 120, 284, 602, 887, + 120, 470, 260, 261, 259, 120, 514, 228, 899, 438, 521, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 519, 259, - 531, 922, 938, 259, 283, 908, 449, 1008, 256, 39, - 446, 343, 521, 936, 747, 847, 848, 849, 846, 845, - 844, 232, 753, 863, 445, 879, 909, 531, 608, 589, - 590, 519, 521, 591, 231, 521, 873, 894, 521, 684, - 572, 962, 572, 970, 39, 255, 39, 839, 994, 964, - 963, 902, 483, 192, 39, 403, 39, 39, 895, 838, - 521, 835, 575, 260, 261, 572, 970, 260, 261, 956, - 982, 566, 958, 39, 1005, 961, 1004, 39, 39, 521, - 724, 572, 394, 389, 993, 164, 572, 995, 341, 997, - 697, 538, 177, 176, 914, 928, 916, 979, 290, 448, - 460, 161, 39, 572, 1011, 531, 924, 157, 926, 927, - 1012, 531, 531, 318, 572, 1015, 992, 314, 127, 919, - 39, 232, 919, 232, 182, 183, 175, 178, 180, 181, - 179, 943, 528, 607, 231, 947, 231, 996, 948, 531, - 969, 968, 967, 192, 39, 966, 837, 836, 834, 401, - 39, 40, 945, 568, 15, 14, 822, 719, 801, 694, - 11, 841, 249, 75, 972, 76, 116, 842, 266, 64, - 840, 232, 89, 598, 90, 520, 101, 74, 12, 326, - 100, 99, 177, 176, 231, 79, 119, 531, 526, 519, - 3, 41, 0, 990, 0, 0, 0, 0, 519, 0, + 531, 922, 481, 259, 283, 908, 449, 395, 256, 39, + 446, 324, 521, 936, 203, 285, 260, 261, 469, 260, + 261, 232, 202, 199, 136, 879, 909, 531, 260, 261, + 944, 519, 521, 335, 231, 521, 873, 829, 521, 938, + 572, 962, 572, 970, 39, 1008, 39, 812, 703, 704, + 706, 703, 704, 343, 39, 747, 39, 39, 753, 863, + 521, 445, 608, 260, 261, 572, 970, 260, 261, 956, + 982, 589, 958, 39, 590, 961, 591, 39, 39, 521, + 684, 572, 255, 839, 993, 994, 572, 995, 964, 997, + 963, 902, 483, 403, 914, 895, 916, 979, 838, 448, + 835, 575, 39, 572, 1011, 531, 924, 566, 926, 927, + 1012, 531, 531, 1005, 572, 1015, 992, 1004, 724, 919, + 39, 232, 919, 232, 394, 558, 389, 164, 341, 697, + 538, 943, 928, 290, 231, 947, 231, 460, 948, 531, + 161, 157, 318, 314, 39, 127, 528, 607, 996, 969, + 39, 968, 945, 967, 966, 837, 836, 834, 401, 40, + 568, 15, 14, 822, 972, 719, 801, 694, 11, 249, + 75, 232, 76, 116, 266, 64, 89, 598, 90, 520, + 101, 74, 12, 326, 231, 100, 99, 531, 79, 519, + 119, 526, 3, 990, 41, 0, 0, 0, 519, 0, 0, 0, 0, 0, 0, 519, 519, 519, 519, 519, - 188, 189, 190, 191, 182, 183, 175, 178, 180, 181, - 179, 847, 848, 849, 846, 845, 844, 0, 1014, 531, - 0, 0, 0, 0, 0, 519, 0, 1020, 169, 171, - 170, 192, 0, 833, 0, 0, 0, 0, 0, 531, - 558, 0, 531, 0, 0, 531, 0, 685, 0, 0, + 0, 0, 0, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 0, 0, 0, 1014, 531, + 0, 0, 0, 0, 0, 519, 0, 1020, 0, 0, + 169, 171, 170, 192, 0, 0, 0, 0, 0, 531, + 0, 0, 531, 0, 0, 531, 209, 685, 0, 0, 0, 0, 0, 0, 688, 689, 690, 691, 692, 0, - 620, 0, 809, 808, 0, 0, 0, 531, 193, 173, - 177, 176, 209, 210, 211, 212, 214, 215, 216, 217, - 218, 219, 220, 221, 213, 0, 531, 0, 0, 0, - 167, 168, 172, 174, 186, 187, 184, 185, 188, 189, - 190, 191, 182, 183, 175, 178, 180, 181, 179, 0, - 0, 0, 0, 0, 0, 0, 519, 519, 519, 519, + 0, 0, 0, 0, 0, 0, 0, 531, 0, 0, + 0, 0, 167, 168, 179, 182, 183, 184, 185, 186, + 187, 189, 191, 0, 0, 0, 531, 809, 808, 0, + 0, 0, 0, 193, 173, 177, 176, 0, 0, 0, + 0, 0, 172, 0, 174, 178, 180, 181, 188, 190, + 175, 0, 0, 0, 0, 0, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 0, 0, 519, 0, 209, 210, 211, - 212, 214, 215, 216, 217, 218, 219, 220, 221, 213, - 0, 0, 0, 0, 0, 0, 0, 668, 666, 667, + 519, 519, 519, 0, 0, 519, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 668, 666, 667, 0, 0, 0, 0, 0, 0, 519, 0, 0, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, - 786, 788, 869, 0, 685, 653, 0, 679, 661, 655, - 654, 209, 210, 211, 212, 214, 215, 216, 217, 218, - 219, 220, 221, 213, 0, 0, 0, 0, 0, 670, - 669, 660, 662, 673, 674, 671, 672, 675, 677, 676, - 678, 663, 664, 665, 656, 658, 659, 657, 0, 0, - 519, 0, 0, 0, 0, 0, 519, 519, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 349, 0, 0, 0, 0, 31, 0, 0, 0, 0, - 0, 0, 0, 0, 519, 209, 210, 211, 212, 214, - 215, 216, 217, 218, 219, 220, 221, 213, 0, 147, + 786, 788, 0, 0, 685, 670, 669, 657, 663, 664, + 671, 672, 673, 674, 677, 678, 668, 666, 667, 0, + 0, 869, 0, 0, 653, 0, 679, 661, 655, 654, + 0, 0, 0, 0, 0, 660, 0, 662, 656, 658, + 659, 675, 676, 665, 0, 0, 0, 0, 0, 0, + 519, 0, 0, 0, 0, 0, 519, 519, 670, 669, + 657, 663, 664, 671, 672, 673, 674, 677, 678, 0, + 0, 0, 0, 0, 0, 31, 0, 653, 867, 679, + 661, 655, 654, 0, 519, 0, 0, 0, 660, 0, + 662, 656, 658, 659, 675, 676, 665, 0, 0, 147, 151, 155, 0, 0, 0, 165, 0, 0, 0, 868, 0, 0, 51, 198, 0, 871, 872, 0, 206, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 0, 0, 519, 235, 236, 237, 238, 0, 154, 240, - 0, 242, 243, 244, 245, 246, 247, 248, 653, 252, - 0, 661, 655, 654, 262, 205, 0, 0, 0, 276, + 0, 242, 243, 244, 245, 246, 247, 248, 0, 252, + 0, 0, 0, 0, 262, 205, 0, 0, 0, 276, 277, 0, 279, 280, 0, 0, 0, 0, 227, 227, - 0, 0, 0, 291, 519, 662, 673, 674, 671, 672, - 675, 677, 676, 678, 663, 664, 665, 656, 658, 659, - 657, 910, 0, 0, 519, 0, 0, 519, 0, 0, - 519, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 240, 0, 0, 0, 0, - 342, 0, 519, 0, 0, 0, 0, 0, 0, 126, - 0, 121, 0, 942, 0, 0, 0, 0, 0, 0, - 0, 519, 0, 361, 362, 363, 364, 365, 366, 367, + 0, 0, 0, 291, 519, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 0, 0, 0, + 0, 910, 0, 0, 519, 0, 0, 519, 0, 0, + 519, 0, 670, 669, 657, 663, 664, 671, 672, 673, + 674, 677, 678, 0, 0, 240, 0, 0, 209, 0, + 342, 653, 519, 679, 661, 655, 654, 0, 0, 0, + 0, 0, 660, 942, 662, 656, 658, 659, 675, 676, + 665, 519, 0, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 0, 387, - 0, 155, 0, 354, 0, 0, 0, 0, 717, 0, + 0, 155, 0, 354, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 406, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 417, 418, 419, 229, 0, - 0, 230, 0, 0, 0, 0, 0, 391, 392, 0, - 0, 0, 0, 0, 0, 0, 0, 233, 0, 0, - 0, 0, 0, 0, 0, 0, 240, 0, 0, 433, - 433, 0, 0, 0, 0, 422, 441, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 716, 0, 0, - 155, 155, 0, 120, 466, 0, 0, 433, 0, 0, + 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 391, 392, 670, + 669, 657, 663, 664, 671, 672, 673, 674, 677, 678, + 0, 0, 0, 0, 0, 0, 240, 0, 653, 433, + 433, 661, 655, 654, 0, 422, 441, 0, 0, 660, + 0, 662, 656, 658, 659, 675, 676, 665, 0, 0, + 155, 155, 0, 0, 466, 0, 0, 433, 0, 0, 0, 0, 0, 433, 291, 0, 0, 0, 0, 433, 433, 0, 0, 155, 443, 0, 433, 496, 0, 0, - 0, 0, 500, 0, 0, 0, 653, 462, 464, 661, - 655, 654, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 478, 0, 0, 0, 0, - 487, 669, 660, 662, 673, 674, 671, 672, 675, 677, - 676, 678, 663, 664, 665, 656, 658, 659, 657, 549, - 0, 0, 0, 0, 0, 0, 553, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 4, 0, 83, 84, 72, 18, 105, 106, 13, - 88, 121, 0, 30, 555, 0, 0, 95, 29, 20, - 19, 0, 21, 0, 33, 0, 34, 0, 0, 22, - 0, 155, 0, 23, 24, 38, 45, 16, 25, 36, - 0, 0, 37, 10, 0, 27, 0, 32, 81, 82, - 8, 46, 48, 50, 0, 0, 0, 0, 52, 96, - 0, 94, 110, 111, 112, 107, 108, 0, 582, 0, - 583, 0, 0, 93, 0, 0, 0, 613, 9, 113, - 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, - 80, 53, 0, 0, 0, 78, 42, 28, 47, 49, - 0, 626, 628, 55, 56, 911, 65, 66, 67, 68, - 69, 70, 71, 0, 0, 636, 92, 77, 17, 644, - 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, - 59, 60, 73, 120, 668, 666, 667, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 478, 0, 653, 0, 0, 0, 655, 654, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 342, 701, + 0, 0, 500, 0, 0, 0, 0, 462, 464, 0, + 0, 0, 83, 84, 72, 0, 105, 106, 126, 88, + 121, 0, 0, 0, 0, 478, 95, 0, 0, 0, + 487, 0, 0, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 45, 0, 0, 0, 549, + 0, 0, 0, 0, 0, 0, 553, 81, 82, 0, + 349, 0, 0, 0, 0, 0, 0, 52, 96, 0, + 94, 110, 111, 112, 107, 108, 209, 0, 0, 0, + 0, 0, 93, 0, 555, 0, 0, 143, 113, 109, + 103, 489, 85, 86, 87, 0, 0, 0, 0, 80, + 53, 155, 911, 0, 78, 42, 149, 0, 0, 0, + 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, + 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 668, 666, 667, 0, 0, 0, 0, 582, 0, + 583, 0, 0, 0, 0, 0, 0, 613, 92, 77, + 0, 0, 0, 0, 63, 482, 97, 0, 0, 488, + 58, 57, 59, 60, 73, 120, 0, 0, 0, 0, + 0, 626, 628, 670, 669, 657, 663, 664, 671, 672, + 673, 674, 677, 678, 667, 636, 0, 0, 0, 0, 0, 0, 653, 0, 679, 661, 655, 654, 0, 0, - 711, 673, 674, 671, 672, 675, 677, 676, 678, 663, - 664, 665, 656, 658, 659, 657, 670, 669, 660, 662, - 673, 674, 671, 672, 675, 677, 676, 678, 663, 664, - 665, 656, 658, 659, 657, 0, 0, 0, 0, 433, - 391, 715, 715, 0, 0, 0, 0, 0, 0, 0, - 746, 0, 0, 0, 0, 0, 433, 751, 668, 666, - 667, 0, 0, 0, 0, 155, 0, 0, 0, 422, + 0, 0, 0, 660, 0, 662, 656, 658, 659, 675, + 676, 665, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 478, 0, 0, 670, 669, 657, 663, 664, 671, + 672, 673, 674, 677, 678, 0, 192, 0, 342, 701, + 0, 0, 0, 653, 0, 679, 661, 655, 654, 0, + 711, 0, 0, 0, 660, 0, 662, 656, 658, 659, + 675, 676, 665, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 179, 182, 183, + 184, 185, 186, 187, 189, 191, 0, 0, 0, 433, + 391, 715, 715, 169, 171, 170, 192, 173, 177, 176, + 746, 0, 0, 0, 0, 0, 433, 751, 178, 180, + 181, 188, 190, 175, 0, 155, 0, 0, 0, 422, 422, 0, 0, 0, 0, 0, 0, 0, 0, 155, + 0, 0, 668, 666, 667, 167, 168, 179, 182, 183, + 184, 185, 186, 187, 189, 191, 0, 0, 0, 862, + 0, 0, 462, 0, 0, 841, 193, 173, 177, 176, + 478, 842, 478, 0, 840, 172, 487, 174, 178, 180, + 181, 188, 190, 175, 670, 669, 657, 663, 664, 671, + 672, 673, 674, 677, 678, 0, 0, 0, 0, 0, + 0, 0, 797, 653, 0, 679, 661, 655, 654, 806, + 0, 0, 0, 0, 660, 0, 662, 656, 658, 659, + 675, 676, 665, 0, 0, 847, 848, 849, 846, 845, + 844, 657, 663, 664, 671, 672, 673, 674, 677, 678, + 0, 0, 0, 852, 0, 0, 433, 0, 653, 0, + 0, 661, 655, 654, 433, 433, 0, 0, 0, 817, + 0, 865, 656, 658, 659, 675, 676, 665, 0, 0, + 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 4, 0, 83, 84, 72, + 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, + 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, + 34, 342, 0, 22, 0, 0, 0, 23, 24, 38, + 45, 16, 25, 36, 0, 0, 37, 10, 0, 27, + 0, 32, 81, 82, 8, 46, 48, 50, 0, 0, + 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, + 108, 0, 0, 0, 0, 0, 0, 93, 0, 715, + 0, 422, 9, 113, 109, 103, 0, 85, 86, 87, + 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, + 42, 28, 47, 49, 0, 0, 0, 55, 56, 0, + 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 478, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 653, 867, 679, 661, - 655, 654, 462, 666, 667, 0, 0, 0, 0, 0, - 478, 0, 478, 0, 0, 0, 487, 0, 0, 0, - 670, 669, 660, 662, 673, 674, 671, 672, 675, 677, - 676, 678, 663, 664, 665, 656, 658, 659, 657, 0, - 653, 0, 679, 661, 655, 654, 0, 0, 0, 806, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 670, 669, 660, 662, 673, 674, - 671, 672, 675, 677, 676, 678, 663, 664, 665, 656, - 658, 659, 657, 852, 0, 0, 433, 0, 0, 0, - 0, 0, 0, 0, 433, 433, 0, 0, 0, 817, - 0, 865, 0, 0, 0, 0, 0, 0, 4, 0, - 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, - 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, - 0, 33, 0, 34, 0, 0, 22, 0, 0, 0, - 23, 24, 38, 45, 16, 25, 36, 0, 0, 37, - 10, 342, 27, 0, 32, 81, 82, 8, 46, 48, - 50, 0, 0, 0, 0, 52, 96, 0, 94, 110, - 111, 112, 107, 108, 0, 0, 0, 0, 0, 0, - 93, 0, 0, 0, 0, 9, 113, 109, 103, 0, - 85, 86, 87, 0, 0, 0, 0, 80, 53, 715, - 0, 422, 78, 42, 28, 47, 49, 0, 0, 0, - 55, 56, 0, 65, 66, 67, 68, 69, 70, 71, - 0, 0, 0, 92, 77, 17, 503, 35, 0, 63, + 0, 0, 0, 92, 77, 17, 644, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, - 120, 0, 0, 0, 0, 0, 0, 0, 4, 478, - 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, - 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, - 0, 33, 0, 34, 0, 0, 22, 0, 0, 0, - 23, 24, 38, 45, 16, 25, 36, 0, 0, 37, - 10, 0, 27, 0, 32, 81, 82, 8, 46, 48, - 50, 0, 0, 0, 0, 52, 96, 0, 94, 110, - 111, 112, 107, 108, 0, 0, 0, 0, 0, 0, - 93, 0, 0, 0, 0, 9, 113, 109, 103, 0, - 85, 86, 87, 0, 0, 0, 0, 80, 53, 0, - 0, 0, 78, 42, 28, 47, 49, 0, 0, 0, - 55, 56, 0, 65, 66, 67, 68, 69, 70, 71, - 0, 0, 0, 92, 77, 17, 0, 35, 0, 63, - 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, - 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, + 120, 4, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, 34, 0, 0, 22, - 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, - 0, 0, 37, 0, 0, 27, 0, 32, 81, 82, - 332, 46, 48, 50, 0, 0, 0, 0, 52, 96, + 0, 0, 0, 23, 24, 38, 45, 16, 25, 36, + 0, 0, 37, 10, 0, 27, 0, 32, 81, 82, + 8, 46, 48, 50, 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, 0, 0, - 0, 0, 0, 93, 0, 0, 0, 0, 143, 113, + 0, 0, 0, 93, 0, 0, 0, 0, 9, 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, 47, 49, 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, - 69, 70, 71, 0, 0, 0, 92, 77, 17, 1021, - 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, - 59, 60, 73, 120, 328, 0, 83, 84, 72, 18, - 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, - 95, 29, 20, 19, 0, 21, 0, 33, 0, 34, - 0, 0, 22, 0, 0, 0, 23, 24, 38, 45, - 0, 25, 36, 0, 0, 37, 0, 0, 27, 0, - 32, 81, 82, 332, 46, 48, 50, 0, 0, 0, - 0, 52, 96, 0, 94, 110, 111, 112, 107, 108, - 0, 0, 0, 0, 0, 0, 93, 0, 0, 0, - 0, 143, 113, 109, 103, 0, 85, 86, 87, 0, - 0, 0, 0, 80, 53, 0, 0, 0, 78, 42, - 28, 47, 49, 0, 0, 0, 55, 56, 0, 65, - 66, 67, 68, 69, 70, 71, 0, 0, 0, 92, - 77, 17, 1016, 35, 0, 63, 0, 97, 0, 0, - 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, + 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, + 77, 17, 503, 35, 0, 63, 0, 97, 0, 0, + 0, 58, 57, 59, 60, 73, 120, 4, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, 34, 0, 0, 22, 0, 0, 0, 23, - 24, 38, 45, 0, 25, 36, 0, 0, 37, 0, - 0, 27, 0, 32, 81, 82, 332, 46, 48, 50, + 24, 38, 45, 16, 25, 36, 0, 0, 37, 10, + 0, 27, 0, 32, 81, 82, 8, 46, 48, 50, 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, - 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, + 0, 0, 0, 0, 9, 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, 47, 49, 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, 71, 0, - 0, 0, 92, 77, 17, 1000, 35, 0, 63, 0, - 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, - 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, - 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, - 0, 21, 988, 33, 0, 34, 0, 0, 22, 0, - 0, 0, 23, 24, 38, 45, 0, 25, 36, 0, - 0, 37, 0, 0, 27, 0, 32, 81, 82, 332, - 46, 48, 50, 0, 0, 0, 0, 52, 96, 0, - 94, 110, 111, 112, 107, 108, 0, 0, 0, 0, - 0, 0, 93, 0, 0, 0, 0, 143, 113, 109, - 103, 0, 85, 86, 87, 0, 0, 0, 0, 80, - 53, 0, 0, 0, 78, 42, 28, 47, 49, 0, - 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, - 70, 71, 0, 0, 0, 92, 77, 17, 0, 35, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 92, 77, 17, 0, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, - 29, 20, 19, 0, 21, 0, 33, 974, 34, 0, + 29, 20, 19, 0, 21, 0, 33, 0, 34, 0, 0, 22, 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, 0, 0, 37, 0, 0, 27, 0, 32, 81, 82, 332, 46, 48, 50, 0, 0, 0, 0, @@ -925,20 +893,87 @@ var yyAct = [...]int{ 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, 47, 49, 0, 0, 0, 55, 56, 0, 65, 66, - 67, 68, 69, 70, 71, 0, 0, 0, 92, 77, - 17, 0, 35, 0, 63, 0, 97, 0, 0, 0, - 58, 57, 59, 60, 73, 120, 328, 0, 83, 84, - 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, - 0, 0, 95, 29, 20, 19, 0, 21, 0, 33, - 0, 34, 0, 0, 22, 0, 0, 0, 23, 24, - 38, 45, 0, 25, 36, 0, 0, 37, 0, 0, - 27, 0, 32, 81, 82, 332, 46, 48, 50, 0, - 0, 0, 0, 52, 96, 0, 94, 110, 111, 112, - 107, 108, 0, 0, 0, 0, 0, 0, 93, 0, - 0, 0, 0, 143, 113, 109, 103, 0, 85, 86, - 87, 0, 0, 0, 0, 80, 53, 0, 0, 0, - 78, 42, 28, 47, 49, 0, 0, 0, 55, 56, - 0, 65, 66, 67, 68, 69, 70, 71, 0, 0, + 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 92, 77, 17, 1021, 35, 0, 63, 0, 97, + 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, + 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, + 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, + 21, 0, 33, 0, 34, 0, 0, 22, 0, 0, + 0, 23, 24, 38, 45, 0, 25, 36, 0, 0, + 37, 0, 0, 27, 0, 32, 81, 82, 332, 46, + 48, 50, 0, 0, 0, 0, 52, 96, 0, 94, + 110, 111, 112, 107, 108, 0, 0, 0, 0, 0, + 0, 93, 0, 0, 0, 0, 143, 113, 109, 103, + 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, + 0, 0, 0, 78, 42, 28, 47, 49, 0, 0, + 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, + 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 92, 77, 17, + 1016, 35, 0, 63, 0, 97, 0, 0, 0, 58, + 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, + 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, + 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, + 34, 0, 0, 22, 0, 0, 0, 23, 24, 38, + 45, 0, 25, 36, 0, 0, 37, 0, 0, 27, + 0, 32, 81, 82, 332, 46, 48, 50, 0, 0, + 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, + 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, + 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, + 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, + 42, 28, 47, 49, 0, 0, 0, 55, 56, 0, + 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 92, 77, 17, 1000, 35, 0, 63, + 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, + 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, + 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, + 19, 0, 21, 988, 33, 0, 34, 0, 0, 22, + 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, + 0, 0, 37, 0, 0, 27, 0, 32, 81, 82, + 332, 46, 48, 50, 0, 0, 0, 0, 52, 96, + 0, 94, 110, 111, 112, 107, 108, 0, 0, 0, + 0, 0, 0, 93, 0, 0, 0, 0, 143, 113, + 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, + 80, 53, 0, 0, 0, 78, 42, 28, 47, 49, + 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, + 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, + 77, 17, 0, 35, 0, 63, 0, 97, 0, 0, + 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, + 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, + 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, + 33, 974, 34, 0, 0, 22, 0, 0, 0, 23, + 24, 38, 45, 0, 25, 36, 0, 0, 37, 0, + 0, 27, 0, 32, 81, 82, 332, 46, 48, 50, + 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, + 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, + 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, + 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, + 0, 78, 42, 28, 47, 49, 0, 0, 0, 55, + 56, 0, 65, 66, 67, 68, 69, 70, 71, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 92, 77, 17, 0, 35, + 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, + 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, + 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, + 29, 20, 19, 0, 21, 0, 33, 0, 34, 0, + 0, 22, 0, 0, 0, 23, 24, 38, 45, 0, + 25, 36, 0, 0, 37, 0, 0, 27, 0, 32, + 81, 82, 332, 46, 48, 50, 0, 0, 0, 0, + 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, + 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, + 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, + 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, + 47, 49, 0, 0, 0, 55, 56, 0, 65, 66, + 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 77, 17, 973, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, @@ -952,21 +987,10 @@ var yyAct = [...]int{ 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, 47, 49, 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, - 71, 0, 0, 0, 92, 77, 17, 952, 35, 0, - 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, - 73, 120, 328, 0, 83, 84, 72, 18, 105, 106, - 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, - 20, 19, 0, 21, 0, 33, 0, 34, 0, 0, - 22, 0, 0, 0, 23, 24, 38, 45, 0, 25, - 36, 0, 0, 37, 0, 0, 27, 0, 32, 81, - 82, 332, 46, 48, 50, 0, 0, 0, 0, 52, - 96, 0, 94, 110, 111, 112, 107, 108, 0, 0, - 0, 0, 0, 0, 93, 0, 0, 0, 0, 143, - 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, - 0, 80, 53, 0, 0, 0, 78, 42, 28, 47, - 49, 0, 0, 0, 55, 56, 0, 65, 66, 67, - 68, 69, 70, 71, 0, 0, 0, 92, 77, 17, - 951, 35, 0, 63, 0, 97, 0, 0, 0, 58, + 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 92, 77, 17, + 952, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, @@ -979,24 +1003,13 @@ var yyAct = [...]int{ 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, 47, 49, 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, - 92, 77, 17, 949, 35, 0, 63, 0, 97, 0, - 0, 0, 58, 57, 59, 60, 73, 120, 328, 0, - 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, - 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, - 0, 33, 0, 34, 886, 0, 22, 0, 0, 0, - 23, 24, 38, 45, 0, 25, 36, 0, 0, 37, - 0, 0, 27, 0, 32, 81, 82, 332, 46, 48, - 50, 0, 0, 0, 0, 52, 96, 0, 94, 110, - 111, 112, 107, 108, 0, 0, 0, 0, 0, 0, - 93, 0, 0, 0, 0, 143, 113, 109, 103, 0, - 85, 86, 87, 0, 0, 0, 0, 80, 53, 0, - 0, 0, 78, 42, 28, 47, 49, 0, 0, 0, - 55, 56, 0, 65, 66, 67, 68, 69, 70, 71, - 0, 0, 0, 92, 77, 17, 0, 35, 0, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 92, 77, 17, 951, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, - 19, 698, 21, 0, 33, 0, 34, 0, 0, 22, + 19, 0, 21, 0, 33, 0, 34, 0, 0, 22, 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, 0, 0, 37, 0, 0, 27, 0, 32, 81, 82, 332, 46, 48, 50, 0, 0, 0, 0, 52, 96, @@ -1005,25 +1018,14 @@ var yyAct = [...]int{ 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, 47, 49, 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, - 69, 70, 71, 0, 0, 0, 92, 77, 17, 0, - 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, - 59, 60, 73, 120, 328, 0, 83, 84, 72, 18, - 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, - 95, 29, 20, 19, 0, 21, 0, 33, 0, 34, - 0, 0, 22, 0, 0, 0, 23, 24, 38, 45, - 0, 25, 36, 0, 0, 37, 0, 0, 27, 0, - 32, 81, 82, 332, 46, 48, 50, 0, 0, 0, - 0, 52, 96, 0, 94, 110, 111, 112, 107, 108, - 0, 0, 0, 0, 0, 0, 93, 0, 0, 0, - 0, 143, 113, 109, 103, 0, 85, 86, 87, 0, - 0, 0, 0, 80, 53, 0, 0, 0, 78, 42, - 28, 47, 49, 0, 0, 0, 55, 56, 0, 65, - 66, 67, 68, 69, 70, 71, 0, 0, 0, 92, - 77, 17, 563, 35, 0, 63, 0, 97, 0, 0, + 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, + 77, 17, 949, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, - 33, 0, 34, 0, 0, 22, 0, 0, 0, 23, + 33, 0, 34, 886, 0, 22, 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, 0, 0, 37, 0, 0, 27, 0, 32, 81, 82, 332, 46, 48, 50, 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, @@ -1032,73 +1034,72 @@ var yyAct = [...]int{ 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, 47, 49, 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, 71, 0, - 0, 0, 92, 77, 17, 327, 35, 0, 63, 0, - 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, - 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, - 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, - 0, 21, 0, 33, 0, 34, 0, 0, 22, 0, - 0, 0, 23, 24, 38, 45, 0, 25, 36, 0, - 0, 37, 0, 0, 27, 0, 32, 81, 82, 332, - 46, 48, 50, 0, 0, 0, 0, 52, 96, 0, - 94, 110, 111, 112, 107, 108, 0, 0, 0, 0, - 0, 0, 93, 0, 0, 0, 0, 143, 113, 109, - 103, 0, 85, 86, 87, 0, 0, 0, 0, 80, - 53, 0, 0, 0, 78, 42, 28, 47, 49, 0, - 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, - 70, 71, 0, 0, 0, 92, 77, 17, 0, 35, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 92, 77, 17, 0, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, - 60, 73, 120, 83, 84, 72, 18, 105, 106, 13, - 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, - 19, 0, 21, 0, 33, 0, 34, 0, 0, 22, - 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, - 0, 0, 37, 0, 0, 27, 0, 32, 81, 82, - 0, 0, 0, 0, 0, 0, 0, 0, 52, 96, - 0, 94, 110, 111, 112, 107, 108, 0, 0, 0, - 0, 0, 0, 93, 0, 0, 0, 0, 143, 113, - 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, - 80, 53, 0, 0, 0, 78, 42, 28, 0, 0, - 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, - 69, 70, 71, 0, 0, 0, 92, 77, 17, 0, - 35, 946, 63, 0, 97, 0, 0, 0, 58, 57, - 59, 60, 73, 120, 83, 84, 72, 18, 105, 106, - 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, - 20, 19, 0, 21, 0, 33, 0, 34, 0, 0, - 22, 0, 0, 0, 23, 24, 38, 45, 0, 25, - 36, 0, 0, 37, 0, 0, 27, 0, 32, 81, - 82, 0, 0, 0, 0, 0, 0, 0, 0, 52, - 96, 0, 94, 110, 111, 112, 107, 108, 0, 0, - 0, 0, 0, 0, 93, 0, 0, 0, 0, 143, - 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, - 0, 80, 53, 0, 0, 0, 78, 42, 28, 0, - 0, 0, 0, 0, 55, 56, 0, 65, 66, 67, - 68, 69, 70, 71, 0, 0, 0, 92, 77, 17, - 0, 35, 920, 63, 0, 97, 0, 0, 0, 58, - 57, 59, 60, 73, 120, 83, 84, 72, 18, 105, + 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, - 29, 20, 19, 0, 21, 0, 33, 0, 34, 0, + 29, 20, 19, 698, 21, 0, 33, 0, 34, 0, 0, 22, 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, 0, 0, 37, 0, 0, 27, 0, 32, - 81, 82, 0, 0, 0, 0, 0, 0, 0, 0, + 81, 82, 332, 46, 48, 50, 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, - 0, 0, 0, 0, 0, 55, 56, 0, 65, 66, - 67, 68, 69, 70, 71, 0, 0, 0, 92, 77, - 17, 0, 35, 721, 63, 0, 97, 0, 0, 0, - 58, 57, 59, 60, 73, 120, 83, 84, 72, 18, - 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, - 95, 29, 20, 19, 0, 21, 0, 33, 0, 34, - 0, 0, 22, 0, 0, 0, 23, 24, 38, 45, - 0, 25, 36, 0, 0, 37, 0, 0, 27, 0, - 32, 81, 82, 0, 0, 0, 0, 0, 0, 0, - 0, 52, 96, 0, 94, 110, 111, 112, 107, 108, - 0, 0, 0, 0, 0, 0, 93, 0, 0, 0, - 0, 143, 113, 109, 103, 0, 85, 86, 87, 0, - 0, 0, 0, 80, 53, 0, 0, 0, 78, 42, - 28, 0, 0, 0, 0, 0, 55, 56, 0, 65, - 66, 67, 68, 69, 70, 71, 0, 0, 0, 92, - 77, 17, 0, 35, 337, 63, 0, 97, 0, 0, + 47, 49, 0, 0, 0, 55, 56, 0, 65, 66, + 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 92, 77, 17, 0, 35, 0, 63, 0, 97, + 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, + 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, + 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, + 21, 0, 33, 0, 34, 0, 0, 22, 0, 0, + 0, 23, 24, 38, 45, 0, 25, 36, 0, 0, + 37, 0, 0, 27, 0, 32, 81, 82, 332, 46, + 48, 50, 0, 0, 0, 0, 52, 96, 0, 94, + 110, 111, 112, 107, 108, 0, 0, 0, 0, 0, + 0, 93, 0, 0, 0, 0, 143, 113, 109, 103, + 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, + 0, 0, 0, 78, 42, 28, 47, 49, 0, 0, + 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, + 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 92, 77, 17, + 563, 35, 0, 63, 0, 97, 0, 0, 0, 58, + 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, + 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, + 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, + 34, 0, 0, 22, 0, 0, 0, 23, 24, 38, + 45, 0, 25, 36, 0, 0, 37, 0, 0, 27, + 0, 32, 81, 82, 332, 46, 48, 50, 0, 0, + 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, + 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, + 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, + 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, + 42, 28, 47, 49, 0, 0, 0, 55, 56, 0, + 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 92, 77, 17, 327, 35, 0, 63, + 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, + 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, + 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, + 19, 0, 21, 0, 33, 0, 34, 0, 0, 22, + 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, + 0, 0, 37, 0, 0, 27, 0, 32, 81, 82, + 332, 46, 48, 50, 0, 0, 0, 0, 52, 96, + 0, 94, 110, 111, 112, 107, 108, 0, 0, 0, + 0, 0, 0, 93, 0, 0, 0, 0, 143, 113, + 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, + 80, 53, 0, 0, 0, 78, 42, 28, 47, 49, + 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, + 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, + 77, 17, 0, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, @@ -1111,490 +1112,539 @@ var yyAct = [...]int{ 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, 0, 0, 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, - 92, 77, 17, 0, 35, 334, 63, 0, 97, 0, - 0, 0, 58, 57, 59, 60, 73, 120, 83, 84, - 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, - 0, 0, 95, 29, 20, 19, 0, 21, 0, 33, - 0, 34, 0, 0, 22, 0, 0, 0, 23, 24, - 38, 45, 0, 25, 36, 0, 0, 37, 0, 0, - 27, 0, 32, 81, 82, 0, 0, 0, 0, 0, - 0, 0, 0, 52, 96, 0, 94, 110, 111, 112, - 107, 108, 0, 0, 0, 0, 0, 0, 93, 0, - 0, 0, 0, 143, 113, 109, 103, 0, 85, 86, - 87, 0, 192, 0, 0, 80, 53, 0, 0, 0, - 78, 42, 28, 0, 0, 0, 0, 0, 55, 56, - 0, 65, 66, 67, 68, 69, 70, 71, 0, 0, - 0, 92, 77, 17, 0, 35, 0, 63, 0, 97, - 173, 177, 176, 58, 57, 59, 60, 73, 120, 169, - 171, 170, 192, 0, 0, 0, 0, 0, 0, 0, - 0, 167, 168, 172, 174, 186, 187, 184, 185, 188, - 189, 190, 191, 182, 183, 175, 178, 180, 181, 179, - 0, 0, 862, 0, 0, 0, 0, 0, 0, 193, - 173, 177, 176, 169, 171, 170, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 167, 168, 172, 174, 186, 187, 184, 185, 188, - 189, 190, 191, 182, 183, 175, 178, 180, 181, 179, - 0, 0, 857, 193, 173, 177, 176, 668, 666, 667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 794, 0, 0, 167, 168, 172, 174, 186, - 187, 184, 185, 188, 189, 190, 191, 182, 183, 175, - 178, 180, 181, 179, 797, 653, 0, 679, 661, 655, - 654, 668, 666, 667, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 755, 0, 0, 670, - 669, 660, 662, 673, 674, 671, 672, 675, 677, 676, - 678, 663, 664, 665, 656, 658, 659, 657, 0, 653, - 0, 679, 661, 655, 654, 169, 171, 170, 192, 0, + 0, 0, 0, 92, 77, 17, 0, 35, 946, 63, + 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, + 120, 83, 84, 72, 18, 105, 106, 13, 88, 121, + 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, + 21, 0, 33, 0, 34, 0, 0, 22, 0, 0, + 0, 23, 24, 38, 45, 0, 25, 36, 0, 0, + 37, 0, 0, 27, 0, 32, 81, 82, 0, 0, + 0, 0, 0, 0, 0, 0, 52, 96, 0, 94, + 110, 111, 112, 107, 108, 0, 0, 0, 0, 0, + 0, 93, 0, 0, 0, 0, 143, 113, 109, 103, + 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, + 0, 0, 0, 78, 42, 28, 0, 0, 0, 0, + 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, + 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 670, 669, 660, 662, 673, 674, 671, - 672, 675, 677, 676, 678, 663, 664, 665, 656, 658, - 659, 657, 0, 0, 0, 193, 173, 177, 176, 0, - 0, 0, 0, 169, 171, 170, 192, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 167, 168, 172, - 174, 186, 187, 184, 185, 188, 189, 190, 191, 182, - 183, 175, 178, 180, 181, 179, 752, 0, 0, 0, - 0, 0, 0, 193, 173, 177, 176, 0, 0, 0, - 0, 169, 171, 170, 192, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 167, 168, 172, 174, 186, - 187, 184, 185, 188, 189, 190, 191, 182, 183, 175, - 178, 180, 181, 179, 708, 0, 0, 0, 0, 0, - 0, 193, 173, 177, 176, 0, 0, 0, 0, 169, - 171, 170, 192, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 167, 168, 172, 174, 186, 187, 184, - 185, 188, 189, 190, 191, 182, 183, 175, 178, 180, - 181, 179, 643, 0, 0, 0, 0, 0, 0, 193, - 173, 177, 176, 0, 0, 0, 0, 169, 171, 170, - 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 167, 168, 172, 174, 186, 187, 184, 185, 188, - 189, 190, 191, 182, 183, 175, 178, 180, 181, 179, - 640, 0, 0, 0, 0, 0, 0, 193, 173, 177, - 176, 169, 171, 170, 192, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 167, - 168, 172, 174, 186, 187, 184, 185, 188, 189, 190, - 191, 182, 183, 175, 178, 180, 181, 179, 622, 0, - 0, 193, 173, 177, 176, 0, 0, 0, 0, 169, - 171, 170, 192, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 167, 168, 172, 174, 186, 187, 184, - 185, 188, 189, 190, 191, 182, 183, 175, 178, 180, - 181, 179, 603, 0, 0, 0, 0, 0, 0, 193, - 173, 177, 176, 0, 0, 169, 171, 170, 192, 0, + 0, 0, 0, 0, 0, 0, 0, 92, 77, 17, + 0, 35, 920, 63, 0, 97, 0, 0, 0, 58, + 57, 59, 60, 73, 120, 83, 84, 72, 18, 105, + 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, + 29, 20, 19, 0, 21, 0, 33, 0, 34, 0, + 0, 22, 0, 0, 0, 23, 24, 38, 45, 0, + 25, 36, 0, 0, 37, 0, 0, 27, 0, 32, + 81, 82, 0, 0, 0, 0, 0, 0, 0, 0, + 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, + 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, + 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, + 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, + 0, 0, 0, 0, 0, 55, 56, 0, 65, 66, + 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 476, 167, 168, 172, 174, 186, 187, 184, 185, 188, - 189, 190, 191, 182, 183, 175, 178, 180, 181, 179, - 554, 0, 0, 0, 0, 193, 173, 177, 176, 169, - 171, 170, 192, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 167, 168, 172, - 174, 186, 187, 184, 185, 188, 189, 190, 191, 182, - 183, 175, 178, 180, 181, 179, 0, 0, 0, 193, - 173, 177, 176, 169, 171, 170, 192, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 405, 0, - 0, 167, 168, 172, 174, 186, 187, 184, 185, 188, - 189, 190, 191, 182, 183, 175, 178, 180, 181, 179, - 429, 0, 0, 193, 173, 177, 176, 169, 171, 170, - 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 167, 168, 172, 174, 186, - 187, 184, 185, 188, 189, 190, 191, 182, 183, 175, - 178, 180, 181, 179, 0, 0, 0, 193, 173, 177, - 176, 0, 0, 0, 169, 171, 170, 192, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 167, - 168, 172, 174, 186, 187, 184, 185, 188, 189, 190, - 191, 182, 183, 175, 178, 180, 181, 179, 397, 0, - 0, 0, 0, 0, 193, 173, 177, 176, 0, 0, - 0, 169, 171, 170, 192, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 167, 168, 172, 174, - 186, 187, 184, 185, 188, 189, 190, 191, 182, 183, - 175, 178, 180, 181, 179, 347, 0, 0, 0, 0, - 0, 193, 173, 177, 176, 0, 0, 0, 169, 171, - 170, 192, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 167, 168, 172, 174, 186, 187, 184, - 185, 188, 189, 190, 191, 182, 183, 175, 178, 180, - 181, 179, 346, 0, 0, 0, 0, 0, 193, 173, - 177, 176, 0, 0, 0, 169, 171, 170, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 167, 168, 172, 174, 186, 187, 184, 185, 188, 189, - 190, 191, 182, 183, 175, 178, 180, 181, 179, 166, - 0, 0, 0, 0, 0, 193, 173, 177, 176, 668, - 666, 667, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 167, 168, 172, - 174, 186, 187, 184, 185, 188, 189, 190, 191, 182, - 183, 175, 178, 180, 181, 179, 0, 653, 0, 679, - 661, 655, 654, 169, 171, 170, 192, 0, 0, 0, + 0, 92, 77, 17, 0, 35, 721, 63, 0, 97, + 0, 0, 0, 58, 57, 59, 60, 73, 120, 83, + 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, + 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, + 33, 0, 34, 0, 0, 22, 0, 0, 0, 23, + 24, 38, 45, 0, 25, 36, 0, 0, 37, 0, + 0, 27, 0, 32, 81, 82, 0, 0, 0, 0, + 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, + 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, + 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, + 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, + 0, 78, 42, 28, 0, 0, 0, 0, 0, 55, + 56, 0, 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 670, 669, 660, 662, 673, 674, 671, 672, 675, - 677, 676, 678, 663, 664, 665, 656, 658, 659, 657, - 0, 0, 0, 193, 173, 177, 176, 171, 170, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 167, 168, 172, 174, 186, - 187, 184, 185, 188, 189, 190, 191, 182, 183, 175, - 178, 180, 181, 179, 0, 0, 193, 173, 177, 176, - 0, 667, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 167, 168, - 172, 174, 186, 187, 184, 185, 188, 189, 190, 191, - 182, 183, 175, 178, 180, 181, 179, 653, 0, 679, - 661, 655, 654, 170, 192, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 670, 669, 660, 662, 673, 674, 671, 672, 675, - 677, 676, 678, 663, 664, 665, 656, 658, 659, 657, - 0, 193, 173, 177, 176, 192, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 167, 168, 172, 174, 186, 187, 184, - 185, 188, 189, 190, 191, 182, 183, 175, 178, 180, - 181, 179, 193, 173, 177, 176, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 167, 168, 172, 174, 186, 187, - 184, 185, 188, 189, 190, 191, 182, 183, 175, 178, - 180, 181, 179, 653, 0, 679, 661, 655, 654, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 670, 669, 660, - 662, 673, 674, 671, 672, 675, 677, 676, 678, 663, - 664, 665, 656, 658, 659, 657, 653, 0, 0, 661, - 655, 654, 192, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 670, 669, 660, 662, 673, 674, 671, 672, 675, 677, - 676, 678, 663, 664, 665, 656, 658, 659, 657, 0, - 173, 177, 176, 0, 0, 0, 0, 83, 84, 72, - 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, - 0, 95, 168, 172, 174, 186, 187, 184, 185, 188, - 189, 190, 191, 182, 183, 175, 178, 180, 181, 179, - 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 81, 82, 0, 0, 0, 0, 0, 0, - 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, - 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, - 0, 0, 143, 113, 109, 103, 489, 85, 86, 87, - 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, - 42, 149, 0, 0, 0, 0, 0, 55, 56, 0, - 65, 66, 67, 68, 69, 70, 71, 0, 0, 653, - 92, 77, 661, 655, 654, 0, 63, 482, 97, 0, - 0, 488, 58, 57, 59, 60, 73, 120, 0, 0, - 0, 0, 0, 0, 0, 660, 662, 673, 674, 671, - 672, 675, 677, 676, 678, 663, 664, 665, 656, 658, - 659, 657, 83, 84, 72, 0, 105, 106, 126, 88, - 121, 0, 0, 0, 0, 0, 95, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 81, 82, 0, - 0, 0, 0, 0, 0, 0, 0, 52, 96, 0, - 94, 110, 111, 112, 107, 108, 0, 0, 0, 0, - 0, 0, 93, 0, 192, 0, 0, 143, 113, 109, - 103, 489, 85, 86, 87, 0, 0, 0, 0, 80, - 53, 0, 0, 0, 78, 148, 149, 0, 0, 0, - 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, - 70, 71, 173, 177, 176, 92, 77, 0, 0, 0, - 0, 63, 0, 97, 0, 0, 488, 58, 57, 59, - 60, 73, 120, 0, 0, 172, 174, 186, 187, 184, - 185, 188, 189, 190, 191, 182, 183, 175, 178, 180, - 181, 179, 83, 84, 72, 0, 105, 106, 126, 88, - 121, 0, 0, 0, 0, 0, 95, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 81, 82, 0, - 0, 0, 0, 0, 0, 0, 0, 52, 96, 0, - 94, 110, 111, 112, 107, 108, 0, 0, 0, 0, - 0, 0, 93, 0, 0, 0, 0, 143, 113, 109, - 103, 0, 85, 86, 87, 192, 0, 0, 0, 80, - 53, 0, 0, 0, 78, 148, 149, 0, 0, 0, - 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, - 70, 71, 0, 0, 0, 92, 77, 0, 0, 0, - 0, 63, 0, 97, 177, 176, 866, 58, 57, 59, - 60, 73, 120, 83, 84, 72, 0, 105, 106, 126, - 88, 121, 0, 0, 0, 0, 0, 95, 186, 187, - 184, 185, 188, 189, 190, 191, 182, 183, 175, 178, - 180, 181, 179, 0, 0, 0, 45, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 81, 82, + 0, 0, 0, 0, 0, 92, 77, 17, 0, 35, + 337, 63, 0, 97, 0, 0, 0, 58, 57, 59, + 60, 73, 120, 83, 84, 72, 18, 105, 106, 13, + 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, + 19, 0, 21, 0, 33, 0, 34, 0, 0, 22, + 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, + 0, 0, 37, 0, 0, 27, 0, 32, 81, 82, 0, 0, 0, 0, 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, - 80, 53, 0, 0, 0, 78, 148, 149, 0, 0, + 80, 53, 0, 0, 0, 78, 42, 28, 0, 0, 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, - 69, 70, 71, 0, 0, 0, 92, 77, 0, 0, - 0, 0, 63, 0, 97, 0, 0, 629, 58, 57, - 59, 60, 73, 120, 83, 84, 72, 0, 105, 106, - 126, 88, 121, 0, 0, 0, 0, 0, 95, 0, + 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, - 82, 0, 0, 0, 0, 0, 0, 0, 0, 52, - 96, 0, 94, 110, 111, 112, 107, 108, 0, 0, - 0, 0, 0, 0, 93, 0, 192, 0, 0, 143, - 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, - 0, 80, 53, 0, 0, 0, 78, 148, 149, 0, - 0, 0, 0, 0, 55, 56, 0, 65, 66, 67, - 68, 69, 70, 71, 173, 177, 176, 92, 77, 0, - 0, 0, 0, 63, 0, 97, 0, 0, 627, 58, - 57, 59, 60, 73, 120, 0, 0, 0, 174, 186, - 187, 184, 185, 188, 189, 190, 191, 182, 183, 175, - 178, 180, 181, 179, 83, 84, 72, 0, 105, 106, - 126, 88, 121, 0, 0, 0, 0, 0, 95, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, - 82, 0, 0, 0, 0, 0, 0, 0, 0, 52, - 96, 0, 94, 110, 111, 112, 107, 108, 0, 0, - 0, 0, 0, 0, 93, 0, 0, 0, 0, 143, - 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, - 0, 80, 53, 0, 0, 0, 78, 148, 149, 0, - 0, 0, 0, 0, 55, 56, 0, 65, 66, 67, - 68, 69, 70, 71, 0, 0, 0, 92, 77, 0, - 0, 0, 0, 63, 0, 97, 0, 0, 292, 58, - 57, 59, 60, 73, 120, 83, 84, 72, 0, 105, - 106, 126, 88, 121, 0, 0, 0, 0, 0, 95, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 45, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 81, 82, 0, 0, 0, 0, 0, 0, 0, 0, - 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, - 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, - 143, 113, 109, 103, 0, 85, 86, 87, 0, 192, - 0, 0, 80, 53, 0, 0, 0, 78, 42, 149, - 0, 0, 0, 0, 0, 55, 56, 0, 65, 66, - 67, 68, 69, 70, 71, 0, 0, 0, 92, 77, - 0, 0, 0, 0, 63, 431, 97, 173, 177, 176, - 58, 57, 59, 60, 73, 120, 83, 84, 72, 0, - 105, 106, 126, 88, 121, 0, 0, 0, 0, 0, - 95, 0, 186, 187, 184, 185, 188, 189, 190, 191, - 182, 183, 175, 178, 180, 181, 179, 0, 0, 45, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 81, 82, 0, 0, 0, 0, 0, 0, 0, - 0, 52, 96, 0, 94, 110, 111, 112, 107, 108, - 0, 0, 0, 0, 0, 0, 93, 0, 0, 0, - 0, 143, 113, 109, 103, 0, 85, 86, 87, 0, - 0, 0, 0, 80, 53, 0, 0, 0, 78, 148, - 149, 0, 0, 0, 0, 0, 55, 56, 0, 65, - 66, 67, 68, 69, 70, 71, 0, 0, 0, 92, - 77, 0, 0, 0, 0, 63, 0, 97, 0, 0, - 407, 58, 57, 59, 60, 73, 120, 83, 84, 72, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, + 77, 17, 0, 35, 334, 63, 0, 97, 0, 0, + 0, 58, 57, 59, 60, 73, 120, 83, 84, 72, + 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, + 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, + 34, 0, 0, 22, 0, 0, 0, 23, 24, 38, + 45, 0, 25, 36, 0, 0, 37, 0, 0, 27, + 0, 32, 81, 82, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, + 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, + 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, + 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, + 42, 28, 0, 0, 0, 0, 0, 55, 56, 0, + 65, 66, 67, 68, 69, 70, 71, 83, 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 81, 82, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 92, 77, 17, 0, 35, 0, 63, + 45, 97, 0, 0, 0, 58, 57, 59, 60, 73, + 120, 0, 81, 82, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, + 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, + 0, 0, 143, 113, 109, 103, 489, 85, 86, 87, + 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, + 148, 149, 0, 0, 0, 0, 0, 55, 56, 0, + 65, 66, 67, 68, 69, 70, 71, 83, 84, 72, + 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, + 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 92, 77, 0, 0, 0, 0, 63, + 45, 97, 0, 0, 488, 58, 57, 59, 60, 73, + 120, 0, 81, 82, 0, 0, 0, 0, 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, 148, 149, 0, 0, 0, 0, 0, 55, 56, 0, - 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, - 92, 77, 0, 0, 0, 388, 63, 0, 97, 0, - 0, 0, 58, 57, 59, 60, 73, 120, 83, 84, - 72, 0, 105, 106, 126, 88, 121, 0, 0, 0, - 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 81, 82, 0, 0, 0, 0, 0, - 0, 0, 0, 52, 96, 0, 94, 110, 111, 112, - 107, 108, 0, 0, 0, 0, 0, 0, 93, 0, - 0, 0, 0, 143, 113, 109, 103, 0, 85, 86, - 87, 0, 0, 0, 0, 80, 53, 0, 0, 0, - 78, 148, 149, 0, 0, 0, 0, 0, 55, 56, - 0, 65, 66, 67, 68, 69, 70, 71, 0, 0, - 0, 92, 77, 0, 0, 152, 0, 63, 0, 97, - 0, 0, 0, 58, 57, 59, 60, 73, 120, 83, + 65, 66, 67, 68, 69, 70, 71, 83, 84, 72, + 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, + 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 92, 77, 0, 0, 0, 0, 63, + 45, 97, 0, 0, 866, 58, 57, 59, 60, 73, + 120, 0, 81, 82, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, + 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, + 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, + 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, + 148, 149, 0, 0, 0, 0, 0, 55, 56, 0, + 65, 66, 67, 68, 69, 70, 71, 83, 84, 72, + 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, + 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 92, 77, 0, 0, 0, 0, 63, + 45, 97, 0, 0, 629, 58, 57, 59, 60, 73, + 120, 0, 81, 82, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, + 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, + 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, + 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, + 148, 149, 0, 0, 0, 0, 0, 55, 56, 0, + 65, 66, 67, 68, 69, 70, 71, 83, 84, 72, + 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, + 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 92, 77, 0, 0, 0, 0, 63, + 45, 97, 0, 0, 627, 58, 57, 59, 60, 73, + 120, 0, 81, 82, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, + 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, + 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, + 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, + 148, 149, 0, 0, 0, 0, 0, 55, 56, 0, + 65, 66, 67, 68, 69, 70, 71, 83, 84, 72, + 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, + 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 92, 77, 0, 0, 0, 0, 63, + 45, 97, 0, 0, 292, 58, 57, 59, 60, 73, + 120, 0, 81, 82, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, + 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, + 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, + 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, + 42, 149, 0, 0, 0, 0, 0, 55, 56, 0, + 65, 66, 67, 68, 69, 70, 71, 0, 0, 83, 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 81, 82, 0, 0, 0, 0, + 0, 0, 0, 92, 77, 0, 0, 0, 0, 63, + 431, 97, 45, 0, 0, 58, 57, 59, 60, 73, + 120, 0, 0, 0, 81, 82, 0, 0, 0, 0, 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, 148, 149, 0, 0, 0, 0, 0, 55, + 56, 0, 65, 66, 67, 68, 69, 70, 71, 83, + 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, + 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 92, 77, 0, 0, 0, + 0, 63, 45, 97, 0, 0, 407, 58, 57, 59, + 60, 73, 120, 0, 81, 82, 0, 0, 0, 0, + 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, + 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, + 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, + 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, + 0, 78, 148, 149, 0, 0, 0, 0, 0, 55, + 56, 0, 65, 66, 67, 68, 69, 70, 71, 83, + 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, + 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 92, 77, 0, 0, 0, + 388, 63, 45, 97, 0, 0, 0, 58, 57, 59, + 60, 73, 120, 0, 81, 82, 0, 0, 0, 0, + 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, + 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, + 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, + 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, + 0, 78, 148, 149, 0, 0, 0, 0, 0, 55, + 56, 0, 65, 66, 67, 68, 69, 70, 71, 83, + 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, + 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 92, 77, 0, 0, 152, + 0, 63, 45, 97, 0, 0, 0, 58, 57, 59, + 60, 73, 120, 0, 81, 82, 0, 0, 0, 0, + 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, + 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, + 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, + 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, + 0, 78, 148, 149, 0, 0, 0, 0, 0, 55, + 56, 0, 65, 66, 67, 68, 69, 70, 71, 83, + 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, + 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 92, 77, 0, 0, 150, + 0, 63, 45, 97, 0, 0, 0, 58, 57, 59, + 60, 73, 120, 0, 81, 82, 0, 0, 0, 0, + 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, + 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, + 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, + 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, + 0, 78, 148, 149, 0, 0, 0, 0, 0, 55, + 56, 0, 65, 66, 67, 68, 69, 70, 71, 83, + 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, + 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 92, 77, 0, 0, 146, + 0, 63, 45, 97, 0, 0, 0, 58, 57, 59, + 60, 73, 120, 0, 81, 82, 0, 0, 0, 0, + 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, + 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, + 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, + 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, + 0, 78, 148, 149, 0, 0, 0, 0, 0, 55, + 56, 0, 65, 66, 67, 68, 69, 70, 71, 83, + 84, 72, 0, 105, 106, 126, 442, 121, 0, 0, + 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 92, 77, 0, 0, 0, + 0, 63, 45, 97, 0, 0, 0, 58, 57, 59, + 60, 73, 120, 0, 81, 82, 0, 0, 0, 0, + 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, + 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, + 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, + 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, + 0, 78, 148, 149, 0, 0, 0, 0, 0, 55, + 56, 0, 65, 66, 67, 68, 69, 70, 71, 83, + 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, + 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 92, 77, 0, 0, 0, + 0, 63, 45, 97, 0, 0, 0, 58, 57, 59, + 60, 73, 120, 0, 81, 82, 0, 0, 0, 0, + 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, + 112, 107, 108, 0, 841, 0, 0, 0, 0, 93, + 842, 0, 0, 840, 143, 113, 109, 103, 0, 85, + 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, + 0, 78, 42, 149, 0, 0, 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, 71, 0, - 0, 0, 92, 77, 0, 0, 150, 0, 63, 0, - 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, - 83, 84, 72, 0, 105, 106, 126, 88, 121, 0, - 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 81, 82, 0, 0, 0, - 0, 0, 0, 0, 0, 52, 96, 0, 94, 110, - 111, 112, 107, 108, 0, 0, 0, 0, 0, 0, - 93, 0, 0, 0, 0, 143, 113, 109, 103, 0, - 85, 86, 87, 0, 0, 0, 0, 80, 53, 0, - 0, 0, 78, 148, 149, 0, 0, 0, 0, 0, - 55, 56, 0, 65, 66, 67, 68, 69, 70, 71, - 0, 0, 0, 92, 77, 0, 0, 146, 0, 63, - 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, - 120, 83, 84, 72, 0, 105, 106, 126, 88, 121, - 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 81, 82, 0, 0, - 0, 0, 0, 0, 0, 0, 52, 96, 0, 94, - 110, 111, 112, 107, 108, 0, 0, 0, 0, 0, - 0, 93, 0, 0, 0, 0, 143, 113, 109, 103, - 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, - 0, 0, 0, 78, 148, 149, 0, 0, 0, 0, - 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, - 71, 0, 0, 0, 92, 77, 0, 0, 0, 0, - 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, - 73, 120, 83, 84, 72, 0, 105, 106, 126, 442, - 121, 0, 0, 0, 0, 0, 95, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 81, 82, 0, - 0, 0, 0, 0, 0, 0, 0, 52, 96, 0, - 94, 110, 111, 112, 107, 108, 0, 0, 0, 0, - 0, 0, 93, 0, 0, 0, 0, 143, 113, 109, - 103, 0, 85, 86, 87, 0, 0, 0, 0, 80, - 53, 0, 0, 0, 78, 148, 149, 0, 0, 0, - 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, - 70, 71, 0, 0, 0, 92, 77, 0, 0, 0, + 0, 169, 171, 170, 192, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 847, 848, 849, 846, 845, 844, + 0, 0, 0, 0, 0, 92, 77, 794, 0, 0, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, - 60, 73, 120, 83, 84, 72, 0, 105, 106, 126, - 88, 121, 0, 0, 0, 0, 0, 95, 0, 0, + 60, 73, 120, 167, 168, 179, 182, 183, 184, 185, + 186, 187, 189, 191, 0, 0, 668, 666, 667, 833, + 0, 0, 0, 857, 193, 173, 177, 176, 0, 0, + 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, + 190, 175, 755, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 670, 669, + 657, 663, 664, 671, 672, 673, 674, 677, 678, 0, + 0, 169, 171, 170, 192, 0, 0, 653, 0, 679, + 661, 655, 654, 0, 0, 0, 0, 0, 660, 0, + 662, 656, 658, 659, 675, 676, 665, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 81, 82, - 0, 0, 0, 0, 0, 0, 0, 0, 52, 96, - 0, 94, 110, 111, 112, 107, 108, 0, 0, 0, - 0, 0, 0, 93, 0, 0, 0, 0, 143, 113, - 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, - 80, 53, 105, 106, 126, 78, 42, 149, 0, 0, - 0, 0, 529, 55, 56, 0, 65, 66, 67, 68, - 69, 70, 71, 0, 0, 0, 92, 77, 0, 0, - 0, 0, 63, 0, 97, 0, 0, 0, 58, 57, - 59, 60, 73, 120, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 524, 0, 527, 110, 111, 112, - 107, 108, 0, 0, 0, 0, 0, 0, 530, 0, - 0, 0, 0, 522, 113, 109, 523, 105, 106, 126, - 0, 0, 0, 0, 0, 0, 0, 529, 0, 0, - 0, 0, 233, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 167, 168, 179, 182, 183, 184, 185, + 186, 187, 189, 191, 169, 171, 170, 192, 0, 0, + 0, 0, 0, 0, 193, 173, 177, 176, 0, 0, + 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, + 190, 175, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 167, 168, 179, 182, + 183, 184, 185, 186, 187, 189, 191, 0, 0, 0, + 752, 169, 171, 170, 192, 0, 0, 193, 173, 177, + 176, 0, 0, 0, 0, 0, 172, 0, 174, 178, + 180, 181, 188, 190, 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 787, 536, 0, 525, - 0, 0, 0, 535, 534, 532, 533, 0, 0, 524, - 0, 527, 110, 111, 112, 107, 108, 0, 0, 0, - 0, 0, 0, 530, 0, 0, 0, 0, 522, 113, - 109, 523, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 233, 0, 0, + 0, 0, 0, 167, 168, 179, 182, 183, 184, 185, + 186, 187, 189, 191, 0, 0, 0, 708, 169, 171, + 170, 192, 0, 0, 193, 173, 177, 176, 0, 0, + 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, + 190, 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 167, 168, 179, 182, 183, 184, 185, 186, 187, 189, + 191, 0, 0, 0, 643, 169, 171, 170, 192, 0, + 0, 193, 173, 177, 176, 0, 0, 0, 0, 0, + 172, 0, 174, 178, 180, 181, 188, 190, 175, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 167, 168, 179, + 182, 183, 184, 185, 186, 187, 189, 191, 0, 0, + 0, 640, 169, 171, 170, 192, 0, 0, 193, 173, + 177, 176, 0, 0, 0, 0, 0, 172, 0, 174, + 178, 180, 181, 188, 190, 175, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 167, 168, 179, 182, 183, 184, + 185, 186, 187, 189, 191, 169, 171, 170, 192, 0, + 0, 0, 622, 0, 0, 193, 173, 177, 176, 0, + 0, 0, 0, 0, 172, 0, 174, 178, 180, 181, + 188, 190, 175, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 167, 168, 179, + 182, 183, 184, 185, 186, 187, 189, 191, 0, 0, + 0, 603, 169, 171, 170, 192, 0, 0, 193, 173, + 177, 176, 0, 0, 0, 0, 0, 172, 0, 174, + 178, 180, 181, 188, 190, 175, 476, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 167, 168, 179, 182, 183, 184, + 185, 186, 187, 189, 191, 169, 171, 170, 192, 0, + 554, 0, 0, 0, 0, 193, 173, 177, 176, 0, + 0, 0, 0, 0, 172, 0, 174, 178, 180, 181, + 188, 190, 175, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 167, 168, 179, + 182, 183, 184, 185, 186, 187, 189, 191, 169, 171, + 170, 192, 0, 0, 0, 0, 0, 0, 193, 173, + 177, 176, 0, 0, 0, 0, 0, 172, 0, 174, + 178, 180, 181, 188, 190, 175, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 405, 0, 0, 0, + 167, 168, 179, 182, 183, 184, 185, 186, 187, 189, + 191, 0, 0, 0, 0, 0, 0, 0, 429, 0, + 0, 193, 173, 177, 176, 169, 171, 170, 192, 0, + 172, 0, 174, 178, 180, 181, 188, 190, 175, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 167, 168, 179, + 182, 183, 184, 185, 186, 187, 189, 191, 169, 171, + 170, 192, 0, 0, 0, 0, 0, 0, 193, 173, + 177, 176, 0, 0, 0, 0, 0, 172, 0, 174, + 178, 180, 181, 188, 190, 175, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 167, 168, 179, 182, 183, 184, 185, 186, 187, 189, + 191, 169, 171, 170, 192, 397, 0, 0, 0, 0, + 0, 193, 173, 177, 176, 0, 0, 0, 0, 0, + 172, 0, 174, 178, 180, 181, 188, 190, 175, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 167, 168, 179, 182, 183, 184, 185, + 186, 187, 189, 191, 169, 171, 170, 192, 347, 0, + 0, 0, 0, 0, 193, 173, 177, 176, 0, 0, + 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, + 190, 175, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 167, 168, 179, 182, + 183, 184, 185, 186, 187, 189, 191, 169, 171, 170, + 192, 346, 0, 0, 0, 0, 0, 193, 173, 177, + 176, 0, 0, 0, 0, 0, 172, 0, 174, 178, + 180, 181, 188, 190, 175, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 668, 666, 667, 167, + 168, 179, 182, 183, 184, 185, 186, 187, 189, 191, + 0, 0, 0, 0, 166, 0, 0, 0, 0, 0, + 193, 173, 177, 176, 0, 0, 0, 0, 0, 172, + 0, 174, 178, 180, 181, 188, 190, 175, 670, 669, + 657, 663, 664, 671, 672, 673, 674, 677, 678, 169, + 171, 170, 192, 0, 0, 0, 0, 653, 0, 679, + 661, 655, 654, 0, 0, 0, 0, 0, 660, 0, + 662, 656, 658, 659, 675, 676, 665, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 666, + 667, 167, 168, 179, 182, 183, 184, 185, 186, 187, + 189, 191, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 193, 173, 177, 176, 0, 0, 0, 0, + 0, 172, 0, 174, 178, 180, 181, 188, 190, 175, + 670, 669, 657, 663, 664, 671, 672, 673, 674, 677, + 678, 171, 170, 192, 0, 0, 0, 0, 0, 653, + 0, 679, 661, 655, 654, 0, 0, 0, 0, 0, + 660, 0, 662, 656, 658, 659, 675, 676, 665, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 167, 168, 179, 182, 183, 184, 185, 186, + 187, 189, 191, 170, 192, 0, 0, 0, 0, 0, + 0, 0, 0, 193, 173, 177, 176, 0, 0, 0, + 0, 0, 172, 0, 174, 178, 180, 181, 188, 190, + 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 167, 168, 179, 182, 183, 184, 185, + 186, 187, 189, 191, 192, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 193, 173, 177, 176, 0, 0, + 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, + 190, 175, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 167, 168, 179, 182, 183, 184, 185, + 186, 187, 189, 191, 192, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 193, 173, 177, 176, 0, 0, + 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, + 190, 175, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 167, 168, 179, 182, 183, 184, 185, + 186, 187, 189, 191, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 173, 177, 176, 0, 0, + 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, + 190, 175, 669, 657, 663, 664, 671, 672, 673, 674, + 677, 678, 192, 0, 0, 0, 0, 0, 0, 0, + 653, 0, 0, 661, 655, 654, 0, 0, 0, 0, + 0, 660, 0, 662, 656, 658, 659, 675, 676, 665, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 168, 179, 182, 183, 184, 185, 186, 187, + 189, 191, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 173, 177, 176, 0, 0, 0, 0, + 0, 172, 0, 174, 178, 180, 181, 188, 190, 175, + 657, 663, 664, 671, 672, 673, 674, 677, 678, 192, + 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, + 661, 655, 654, 0, 0, 0, 0, 0, 660, 0, + 662, 656, 658, 659, 675, 676, 665, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 179, 182, 183, 184, 185, 186, 187, 189, 191, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 173, 177, 176, 0, 0, 0, 0, 0, 172, 0, + 174, 178, 180, 181, 188, 190, 175, 657, 663, 664, + 671, 672, 673, 674, 677, 678, 192, 0, 0, 0, + 0, 0, 0, 0, 653, 0, 0, 661, 655, 654, + 0, 0, 0, 0, 0, 0, 0, 662, 656, 658, + 659, 675, 676, 665, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 179, 182, 183, + 184, 185, 186, 187, 189, 191, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 173, 177, 176, + 0, 0, 0, 0, 0, 0, 0, 174, 178, 180, + 181, 188, 190, 175, 657, 663, 664, 671, 672, 673, + 674, 677, 678, 192, 0, 0, 0, 0, 0, 0, + 0, 653, 0, 0, 0, 655, 654, 0, 0, 0, + 0, 0, 0, 0, 0, 656, 658, 659, 675, 676, + 665, 105, 106, 126, 0, 0, 0, 0, 0, 0, + 0, 529, 0, 0, 179, 182, 183, 184, 185, 186, + 187, 189, 191, 0, 105, 106, 126, 0, 0, 0, + 0, 0, 0, 0, 529, 177, 176, 0, 0, 0, + 0, 0, 0, 0, 0, 178, 180, 181, 188, 190, + 175, 0, 0, 524, 0, 527, 110, 111, 112, 107, + 108, 0, 0, 0, 0, 0, 0, 530, 0, 0, + 0, 0, 522, 113, 109, 523, 524, 0, 527, 110, + 111, 112, 107, 108, 0, 0, 0, 0, 0, 0, + 530, 233, 0, 0, 0, 522, 113, 109, 523, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 233, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 787, 536, + 0, 525, 0, 0, 0, 535, 534, 532, 533, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 536, 0, 525, 0, 0, 0, 535, 534, 532, 533, } var yyPact = [...]int{ - -1000, -1000, 2286, -1000, -1000, -1000, -1000, -1000, 267, 471, - 610, 73, -1000, 269, -1000, -1000, 852, -1000, 209, 209, - 4934, 264, 209, 7826, 7695, 7564, 336, 163, 721, 7957, - -1000, 5808, 263, 262, 261, -1000, 373, 7957, 850, 53, - 844, 843, 7957, -1000, -1000, -1000, -1000, 661, -1000, 659, - -1000, 1185, 258, 7957, 402, 449, 449, 7957, 7957, 7957, - 7957, -1000, -1000, 8219, -1000, 7957, 7957, 7957, 7957, 7957, - 7957, 7957, 252, 7957, -1000, 170, 167, 891, 7957, 595, - 702, 250, 246, 7957, 7957, 245, 7957, 7957, -1000, 166, - -1000, -1000, 887, 781, -1000, 165, 244, 7040, -1000, 159, - 156, -1000, 206, 808, 543, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, 103, 160, -1000, 537, 210, -1000, - 372, -1000, 199, 359, -1000, 808, -1000, 57, 571, 540, - -1000, 621, 808, -1000, 842, -1000, -17, 4015, 4803, 8219, - 4672, 718, 53, 485, 7957, 255, -1000, 5761, -1000, 688, - -1000, 5714, -1000, 333, 1259, 5896, -1000, 56, -1000, -1000, - 411, 45, 53, -18, 38, 5896, -1000, 7957, 7957, 7957, - 7957, 7957, 7957, 7957, 7957, 7957, 7957, 7957, 7957, 7957, - 7957, 7957, 7957, 7957, 7957, 7957, 7957, 7957, 7957, 7957, - 7957, 7957, 702, 7433, 449, 7957, 841, -1000, 5667, 332, - 286, -1000, 645, 639, -1000, 1185, 5620, -1000, -1000, 7302, - 7957, 7957, 7957, 7957, 7957, 7957, 7957, 7957, 7957, 7957, - 7957, 7957, 404, -1000, -1000, -1000, -1000, -1000, 206, 474, - 808, 536, 525, -1000, -1000, -115, -115, -47, -115, 196, - 5576, 195, -115, -115, -115, -115, -115, -115, -115, -1000, - 7171, -1000, -115, 7957, 7957, 376, 706, 684, -1000, 219, - 8088, 449, 6065, 67, 210, 524, -1000, 422, 445, 808, - 583, 103, 160, 513, 7957, 7957, 5896, 5896, 7957, 5896, - 5896, 7957, 532, 706, 697, -1000, 710, 7957, 7040, 145, - 30, 5532, 449, 7957, 7957, 839, -1000, 6323, 206, 55, - 7957, 7957, 103, 372, 68, -1000, 7957, 330, -1000, -1000, - 2146, 206, -1000, 613, 19, -1000, 609, 808, 7, -1000, - 606, 808, 838, 604, -27, 8379, -1000, -1000, -1000, -1000, - -1000, -1000, 241, -1000, -1000, -1000, -1000, -1000, 209, 239, - 329, 20, 5896, -1000, 325, 324, -1000, -1000, -1000, -1000, - -1000, 163, -1000, 7957, -1000, -1000, 784, 237, 8379, -1000, - 7957, 6192, 6464, 5939, 6065, 6024, 6876, 6625, 7169, 4, - 4, 4, -47, -115, -47, -47, 100, 100, 953, 953, - 953, 953, 863, 863, 863, 863, -1000, 5488, 7957, 3, - -1000, -1000, 1121, 715, -3, -39, 3882, -1000, -1000, 228, - 519, 628, 563, 368, 563, 7957, 6065, 351, 6065, 6065, - 6065, 6065, 6065, 6065, 6065, 6065, 6065, 6065, 6065, 6065, - -12, -1000, -1000, 224, 808, 206, 67, 67, 212, -1000, - -1000, -1000, 142, 5896, 133, -1000, -1000, -1000, -1000, 803, - 836, 5442, 155, 342, 210, 164, -1000, -1000, 103, 160, - -1000, 7957, -1000, -1000, 148, 808, 422, 67, 103, 148, - -22, -1000, 1185, -1000, 1046, 193, 5394, 125, -1000, -1000, - -1000, 107, 192, -1000, -1000, 6890, 6759, -1000, -1000, 106, - 99, -1000, -1000, -25, 189, -1000, -1000, 1185, 449, 7957, - -1000, 210, 210, -1000, -1000, 93, 5350, 210, 210, -1000, - 5302, -1000, 1759, -1000, -1000, -1000, -1000, 571, 831, 522, - -1000, 540, 830, 517, -1000, 825, 8379, -1000, 5852, -1000, - -1000, 422, 443, 808, 216, 8379, -1000, -1000, -1000, -1000, - 615, 508, 8379, 8379, 8379, 8379, 8379, 188, 447, 4148, - 3749, 323, 7957, 7957, 399, -1000, 737, -1000, -1000, 5254, - -40, 519, -1000, 5896, 7957, 4932, 322, 449, 1529, 1529, - 4541, 821, 8379, 687, 519, 187, -4, -1000, 53, -1000, - -1000, -1000, 422, 436, 808, 365, 563, -1000, -1000, -29, - -1000, -1000, 1185, -1000, 702, -43, 404, 404, 206, -1000, - -1000, 161, 572, 7957, -1000, 67, -1000, -1000, 88, -1000, - -1000, -1000, -1000, -1000, 7957, -1000, -1000, 154, 147, -1000, - 7957, 7957, 103, 5206, -1000, 422, -1000, -1000, -1000, 7957, - -1000, -1000, -1000, -1000, -1000, -1000, 5158, 449, 5896, 449, - -1000, -1000, -1000, 6478, -1000, -1000, 5896, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, 818, -1000, -1000, - 811, -1000, -1000, 8379, 8379, 8379, 8379, 8379, 8379, 8379, - 8379, 8379, 8379, 8379, 8379, 8379, 8379, 8379, 8379, 8379, - 8379, 8379, 8379, 8379, 8379, 8379, 8379, 8379, 8379, 8304, - 808, 422, 8379, 83, -11, 5114, 535, 714, -72, -72, - -81, -81, 5070, 317, -1000, 209, 4934, 429, 316, -1000, - 315, 5896, -1000, 7957, 233, 396, 314, 709, -1000, 8379, - 186, 4932, -1000, -1000, 566, -1000, 449, 215, 566, -1000, - -1000, -1000, -62, -1000, 679, 213, 184, 676, 519, 412, - 808, 422, -1000, -29, 1023, 563, 210, 7957, -1000, -32, - 7957, 572, -1000, 80, 210, -1000, 5026, 572, 7957, 7957, - 79, 4982, -1000, 570, -1000, 6628, -1000, -1000, -1000, -1000, - -1000, 1911, -81, -81, -72, -72, -72, -72, 1333, 1788, - 82, 33, 33, -81, 5982, 6108, 1955, 6314, 1571, -14, - -14, -14, -14, 91, 91, 91, 91, 8379, 1190, 422, - 183, -1000, -1000, 8379, 8379, -1000, -1000, -1000, -1000, 4934, - -1000, 375, 209, 234, -1000, 7957, 1051, -1000, -1000, -1000, - -1000, -1000, 303, -1000, 676, 182, 1529, -1000, 404, 180, - 3616, 8379, -1000, 363, 563, 358, 355, 207, -1000, 778, - -1000, 422, 817, -1000, -1000, 767, -30, -1000, 688, 708, - -1000, 802, 563, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, 6065, -1000, 77, -1000, -1000, 340, -1000, 62, - 59, -1000, -1000, -1000, 67, 5896, 449, -1000, 6151, 8379, - -1000, 1807, 5852, -1000, 296, 220, -1000, 179, -1000, 4148, - -1000, 352, 4410, -1000, -34, 4410, 294, -1000, -1000, 766, - -1000, -1000, 172, -64, -1000, -46, -66, -1000, 793, 53, - -1000, -67, -59, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - 6151, 8379, -1000, -1000, 4148, 4279, 4148, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, 3483, 178, 3350, 3217, -37, -1000, - 744, 8379, -1000, 736, 8379, -70, 791, 8379, -1000, 563, - -1000, 564, 5852, 4148, -1000, -1000, -1000, 3084, 2951, -1000, - 346, -1000, -1000, -1000, 171, -1000, -1000, -82, -1000, 8379, - 205, -1000, -1000, 338, 564, -1000, 292, 290, 670, 703, - 433, -1000, 2818, -1000, 273, -1000, -1000, 733, 8379, -1000, - 519, -1000, -1000, -1000, -1000, 563, 708, 789, 214, -1000, - 2685, -1000, -1000, 177, -80, -1000, 787, -1000, -1000, -1000, - 685, 281, 563, -1000, -1000, 685, -1000, 202, -1000, -1000, - -1000, -1000, -1000, 563, 2552, 723, -1000, 58, 345, -1000, - 2419, -1000, + -1000, -1000, 2475, -1000, -1000, -1000, -1000, -1000, 296, 501, + 570, 107, -1000, 306, -1000, -1000, 914, -1000, 227, 227, + 5583, 295, 227, 6795, 6685, 6575, 362, 162, 756, 6905, + -1000, 8040, 292, 291, 287, -1000, 387, 6905, 913, 26, + 912, 904, 6905, -1000, -1000, -1000, -1000, 680, -1000, 676, + -1000, 1368, 286, 6905, 436, 218, 218, 6905, 6905, 6905, + 6905, -1000, -1000, 7125, -1000, 6905, 6905, 6905, 6905, 6905, + 6905, 6905, 285, 6905, -1000, 177, 175, 891, 6905, 665, + 703, 278, 277, 6905, 6905, 270, 6905, 6905, -1000, 165, + -1000, -1000, 887, 840, -1000, 164, 269, 6133, -1000, 163, + 160, -1000, 228, 830, 560, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, 116, 137, -1000, 556, 231, -1000, + 386, -1000, 216, 339, -1000, 830, -1000, 91, 610, 604, + -1000, 674, 830, -1000, 901, -1000, -70, 4503, 5429, 7125, + 5275, 752, 26, 521, 6905, 272, -1000, 7987, -1000, 707, + -1000, 7934, -1000, 360, 1606, 8132, -1000, 67, -1000, -1000, + 150, 64, 26, -73, 48, 8132, -1000, 6905, 6905, 6905, + 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, + 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, + 6905, 6905, 703, 6465, 218, 6905, 897, -1000, 7881, 358, + 341, -1000, 671, 670, -1000, 1368, 7828, -1000, -1000, 6355, + 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, + 6905, 6905, 699, -1000, -1000, -1000, -1000, -1000, 228, 520, + 830, 555, 554, -1000, -1000, 400, 400, 448, 400, 215, + 7761, 213, 400, 400, 400, 400, 400, 400, 400, -1000, + 6243, -1000, 400, 6905, 6905, 389, 684, 852, -1000, 246, + 7015, 218, 8324, 134, 231, 543, -1000, 485, 517, 830, + 664, 116, 137, 537, 6905, 6905, 8132, 8132, 6905, 8132, + 8132, 6905, 574, 684, 843, -1000, 786, 6905, 6133, 152, + 17, 7708, 218, 6905, 6905, 892, -1000, 1698, 228, 111, + 6905, 6905, 116, 386, 138, -1000, 6905, 351, -1000, -1000, + 2319, 228, -1000, 630, 36, -1000, 666, 830, -4, -1000, + 606, 830, 856, 545, -77, 8856, -1000, -1000, -1000, -1000, + -1000, -1000, 267, -1000, -1000, -1000, -1000, -1000, 227, 265, + 350, -39, 8132, -1000, 349, 348, -1000, -1000, -1000, -1000, + -1000, 162, -1000, 6905, -1000, -1000, 806, 263, 8856, -1000, + 6905, 8462, 8549, 8223, 8324, 8274, 8636, 8723, 1836, 34, + 34, 34, 448, 400, 448, 448, 57, 57, 297, 297, + 297, 297, 38, 38, 38, 38, -1000, 7655, 6905, 31, + -1000, -1000, 996, 741, 8, -82, 4347, -1000, -1000, 256, + 563, 668, 612, 385, 612, 6905, 8324, 708, 8324, 8324, + 8324, 8324, 8324, 8324, 8324, 8324, 8324, 8324, 8324, 8324, + -15, -1000, -1000, 254, 830, 228, 134, 134, 242, -1000, + -1000, -1000, 147, 8132, 135, -1000, -1000, -1000, -1000, 803, + 848, 7598, 158, 370, 231, 140, -1000, -1000, 116, 137, + -1000, 6905, -1000, -1000, 133, 830, 485, 134, 116, 133, + -16, -1000, 1368, -1000, 119, 209, 7545, 132, -1000, -1000, + -1000, 123, 207, -1000, -1000, 6023, 5913, -1000, -1000, 122, + 118, -1000, -1000, -20, 197, -1000, -1000, 1368, 218, 6905, + -1000, 231, 231, -1000, -1000, 110, 7488, 231, 231, -1000, + 7431, -1000, 2163, -1000, -1000, -1000, -1000, 610, 844, 527, + -1000, 604, 841, 522, -1000, 839, 8856, -1000, 8079, -1000, + -1000, 485, 516, 830, 245, 8856, -1000, -1000, -1000, -1000, + 632, 532, 8856, 8856, 8856, 8856, 8856, 195, 456, 4659, + 4191, 342, 6905, 6905, 458, -1000, 919, -1000, -1000, 7374, + -84, 563, -1000, 8132, 6905, 8374, 340, 218, 204, 204, + 5121, 838, 8856, 704, 563, 192, -43, -1000, 26, -1000, + -1000, -1000, 485, 508, 830, 383, 612, -1000, -1000, -60, + -1000, -1000, 1368, -1000, 703, -91, 699, 699, 228, -1000, + -1000, 199, 643, 6905, -1000, 134, -1000, -1000, 108, -1000, + -1000, -1000, -1000, -1000, 6905, -1000, -1000, 156, 141, -1000, + 6905, 6905, 116, 7317, -1000, 485, -1000, -1000, -1000, 6905, + -1000, -1000, -1000, -1000, -1000, -1000, 7264, 218, 8132, 218, + -1000, -1000, -1000, 5693, -1000, -1000, 8132, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, 836, -1000, -1000, + 831, -1000, -1000, 8856, 8856, 8856, 8856, 8856, 8856, 8856, + 8856, 8856, 8856, 8856, 8856, 8856, 8856, 8856, 8856, 8856, + 8856, 8856, 8856, 8856, 8856, 8856, 8856, 8856, 8856, 8833, + 830, 485, 8856, 106, -55, 7209, 573, 717, 121, 121, + -71, -71, 1935, 338, -1000, 227, 5583, 452, 336, -1000, + 334, 8132, -1000, 6905, 241, 438, 333, 916, -1000, 8856, + 190, 8374, -1000, -1000, 595, -1000, 218, 238, 595, -1000, + -1000, -1000, -93, -1000, 697, 235, 189, 691, 563, 464, + 830, 485, -1000, -60, 7156, 612, 231, 6905, -1000, -40, + 6905, 643, -1000, 105, 231, -1000, 7154, 643, 6905, 6905, + 69, 1896, -1000, 633, -1000, 5803, -1000, -1000, -1000, -1000, + -1000, 1239, -71, -71, 121, 121, 121, 121, 8586, 8673, + 1980, -51, -51, -71, 1785, 1383, 8171, 8499, 8412, 20, + 20, 20, 20, -78, -78, -78, -78, 8856, 1186, 485, + 188, -1000, -1000, 8856, 8856, -1000, -1000, -1000, -1000, 5583, + -1000, 449, 227, 299, -1000, 6905, 1053, -1000, -1000, -1000, + -1000, -1000, 330, -1000, 691, 186, 204, -1000, 699, 185, + 4035, 8856, -1000, 381, 612, 380, 377, 223, -1000, 788, + -1000, 485, 2007, -1000, -1000, 784, -38, -1000, 707, 709, + -1000, 826, 612, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, 8324, -1000, 63, -1000, -1000, 366, -1000, 58, + 54, -1000, -1000, -1000, 134, 8132, 218, -1000, 1490, 8856, + -1000, 1734, 8079, -1000, 321, 219, -1000, 183, -1000, 4659, + -1000, 376, 4967, -1000, -48, 4967, 314, -1000, -1000, 774, + -1000, -1000, 187, -94, -1000, -49, -98, -1000, 825, 26, + -1000, -108, -79, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + 1490, 8856, -1000, -1000, 4659, 4813, 4659, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, 3879, 182, 3723, 3567, -53, -1000, + 772, 8856, -1000, 771, 8856, -116, 821, 8856, -1000, 612, + -1000, 619, 8079, 4659, -1000, -1000, -1000, 3411, 3255, -1000, + 374, -1000, -1000, -1000, 169, -1000, -1000, -117, -1000, 8856, + 222, -1000, -1000, 364, 619, -1000, 313, 310, 688, 737, + 528, -1000, 3099, -1000, 309, -1000, -1000, 767, 8856, -1000, + 563, -1000, -1000, -1000, -1000, 612, 709, 818, 302, -1000, + 2943, -1000, -1000, 181, -62, -1000, 811, -1000, -1000, -1000, + 701, 301, 612, -1000, -1000, 701, -1000, 221, -1000, -1000, + -1000, -1000, -1000, 612, 2787, 762, -1000, 170, 343, -1000, + 2631, -1000, } var yyPgo = [...]int{ - 0, 29, 1091, 1090, 38, 31, 30, 572, 1088, 1086, - 134, 217, 204, 88, 1385, 82, 63, 59, 651, 1422, - 1085, 33, 1081, 1080, 1079, 136, 1078, 36, 37, 1077, - 1076, 1075, 1074, 135, 1073, 1072, 24, 1069, 26, 48, - 45, 1068, 634, 34, 1066, 1, 1065, 1063, 27, 1062, - 73, 68, 61, 1060, 1059, 1058, 35, 1057, 1056, 4, - 1055, 1054, 1053, 17, 1051, 1049, 1048, 1047, 1046, 51, - 5, 1045, 1042, 1041, 1040, 1037, 2, 1033, 631, 1032, - 39, 0, 1018, 1017, 1013, 117, 1007, 1001, 513, 1000, - 998, 42, 8, 995, 9, 991, 990, 988, 14, 49, - 985, 983, 982, 980, 976, 974, 3, 971, 16, 962, - 961, 959, 958, 955, 28, 952, 951, 950, 949, 948, - 947, 945, 21, 939, 933, 930, 25, 929, 23, 12, - 928, 40, 924, 923, 922, 914, 41, 6, 19, 18, - 22, 911, 907, 902, 13, 869, 866, 865, 15, 863, + 0, 29, 1094, 1092, 38, 31, 30, 572, 1091, 1090, + 134, 217, 204, 88, 1385, 82, 72, 59, 684, 1422, + 1088, 33, 1086, 1085, 1083, 136, 1082, 36, 37, 1081, + 1080, 1079, 1078, 135, 1077, 1076, 24, 1075, 26, 48, + 45, 1074, 708, 34, 1073, 1, 1072, 1070, 27, 1069, + 73, 68, 61, 1068, 1067, 1066, 35, 1065, 1063, 4, + 1062, 1061, 1060, 17, 1059, 1058, 1057, 1056, 1055, 51, + 5, 1054, 1053, 1051, 1049, 1048, 2, 1047, 631, 1046, + 39, 0, 1045, 1043, 1042, 117, 1041, 1040, 553, 1037, + 1033, 42, 8, 1032, 9, 1030, 1029, 1028, 14, 49, + 1027, 1026, 1024, 1018, 1017, 1013, 3, 1007, 16, 1001, + 1000, 998, 995, 993, 28, 992, 991, 990, 988, 985, + 983, 982, 21, 980, 976, 974, 25, 971, 23, 12, + 962, 40, 961, 959, 958, 955, 41, 6, 19, 18, + 22, 953, 945, 939, 13, 937, 933, 930, 15, 853, 7, 20, } var yyR1 = [...]int{ @@ -1710,108 +1760,108 @@ var yyR2 = [...]int{ var yyChk = [...]int{ -1000, -149, -80, -3, 2, -25, -51, -52, 51, 79, - 44, -53, -26, 10, -60, -61, 38, 119, 7, 21, + 44, -53, -26, 10, -60, -61, 38, 142, 7, 21, 20, 23, 30, 34, 35, 39, -50, 46, 98, 19, - 14, -14, 48, 25, 27, 121, 40, 43, 36, -1, + 14, -14, 48, 25, 27, 144, 40, 43, 36, -1, -64, -2, 97, -16, -15, 37, 52, 99, 53, 100, - 54, -19, 59, 92, -18, 104, 105, 130, 129, 131, - 132, -48, -42, 123, -37, 107, 108, 109, 110, 111, - 112, 113, 6, 133, -29, -47, -46, 118, 96, -20, + 54, -19, 59, 92, -18, 104, 105, 153, 152, 154, + 155, -48, -42, 146, -37, 107, 108, 109, 110, 111, + 112, 113, 6, 156, -29, -47, -46, 141, 96, -20, 91, 49, 50, 4, 5, 84, 85, 86, 11, -35, - -32, -7, 117, 74, 62, 18, 60, 125, -21, -22, + -32, -7, 140, 74, 62, 18, 60, 148, -21, -22, -23, -30, -81, 82, -11, 8, 9, 66, 67, 81, 63, 64, 65, 80, -10, -136, -44, -12, -40, -9, - 134, 12, 123, -81, 119, 82, 10, -82, 37, 38, - -4, -81, 82, 121, 135, 122, 10, -85, -48, 123, - -48, -25, -1, 79, 123, -48, 121, -14, 97, 98, - 121, -14, 121, -15, -19, -14, 121, -86, -27, 12, - 134, -87, -1, 12, -100, -14, 121, 149, 150, 87, - 89, 88, 151, 128, 152, 163, 130, 129, 164, 167, - 165, 166, 161, 162, 155, 156, 153, 154, 157, 158, - 159, 160, 90, 127, 123, 123, 123, 119, -14, 10, - -144, 128, 10, 10, -15, -19, -14, 52, 52, 136, - 137, 138, 139, 148, 140, 141, 142, 143, 144, 145, - 146, 147, 123, -14, 104, 105, -18, -19, -81, 79, + 157, 12, 146, -81, 142, 82, 10, -82, 37, 38, + -4, -81, 82, 144, 158, 145, 10, -85, -48, 146, + -48, -25, -1, 79, 146, -48, 144, -14, 97, 98, + 144, -14, 144, -15, -19, -14, 144, -86, -27, 12, + 157, -87, -1, 12, -100, -14, 144, 129, 130, 87, + 89, 88, 159, 151, 161, 167, 153, 152, 162, 131, + 163, 164, 132, 133, 134, 135, 136, 137, 165, 138, + 166, 139, 90, 150, 146, 146, 146, 142, -14, 10, + -144, 151, 10, 10, -15, -19, -14, 52, 52, 160, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 146, -14, 104, 105, -18, -19, -81, 79, 82, -11, -12, 98, -18, -14, -14, -14, -14, -42, -14, -50, -14, -14, -14, -14, -14, -14, -14, -49, - 123, -48, -14, 125, 125, -121, 17, -88, -33, 12, + 146, -48, -14, 148, 148, -121, 17, -88, -33, 12, 76, 77, -14, 57, -43, -11, -41, -81, 79, 82, - -21, -10, -136, -12, 123, 123, -14, -14, 123, -14, - -14, 125, -88, 17, 17, 75, -88, 125, 123, -91, - -90, -14, 128, 125, 125, 82, -140, 123, -81, 78, - 125, 119, -10, 134, 78, -140, 119, 124, 121, 119, - -80, -81, 121, 135, -83, -5, -81, 82, -84, -6, - -81, 82, 29, -81, 10, 136, -24, 120, 2, -25, - -51, -52, 51, -25, 122, -146, -25, 122, 21, -144, - -98, -97, -14, -141, 119, 122, 121, 121, 121, 121, - 121, 135, -16, 119, -19, 121, 135, -144, 136, 121, - 135, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -21, -10, -136, -12, 146, 146, -14, -14, 146, -14, + -14, 148, -88, 17, 17, 75, -88, 148, 146, -91, + -90, -14, 151, 148, 148, 82, -140, 146, -81, 78, + 148, 142, -10, 157, 78, -140, 142, 147, 144, 142, + -80, -81, 144, 158, -83, -5, -81, 82, -84, -6, + -81, 82, 29, -81, 10, 160, -24, 143, 2, -25, + -51, -52, 51, -25, 145, -146, -25, 145, 21, -144, + -98, -97, -14, -141, 142, 145, 144, 144, 144, 144, + 144, 158, -16, 142, -19, 144, 158, -144, 160, 144, + 158, -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, -43, -14, 122, -101, - -56, -19, -19, -15, -102, 10, -85, 121, 121, 10, - 123, -65, 55, -113, 55, 58, -14, 128, -14, -14, + -14, -14, -14, -14, -14, -14, -43, -14, 145, -101, + -56, -19, -19, -15, -102, 10, -85, 144, 144, 10, + 146, -65, 55, -113, 55, 58, -14, 151, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -92, -38, -19, 59, 82, -81, 78, 78, 124, 124, - 124, 124, -13, -14, -13, 118, -33, -33, 17, 125, + -92, -38, -19, 59, 82, -81, 78, 78, 147, 147, + 147, 147, -13, -14, -13, 141, -33, -33, 17, 148, 57, -14, 11, -19, -131, -132, -40, -39, -10, -136, - 10, 119, -139, -140, 78, 82, -81, 57, -10, 78, - -89, -36, -19, -15, -19, -15, -14, -13, 117, 75, - 75, -13, -91, 126, -151, 135, 58, -17, -19, -13, - -13, 10, 124, -115, -50, -69, -15, -19, 128, 83, + 10, 142, -139, -140, 78, 82, -81, 57, -10, 78, + -89, -36, -19, -15, -19, -15, -14, -13, 140, 75, + 75, -13, -91, 149, -151, 158, 58, -17, -19, -13, + -13, 10, 147, -115, -50, -69, -15, -19, 151, 83, -140, -39, -40, 10, 52, -13, -14, -39, -40, 10, - -14, 121, -80, 120, -140, -4, 121, 135, 29, -81, - 121, 135, 29, -81, 10, 29, 136, -28, -78, -7, - -31, -81, 79, 82, 60, 125, -8, 62, -79, 18, - 74, -11, 131, 132, 130, 129, 123, 123, -95, -85, - -85, -48, 121, 135, -99, 121, -99, 121, -27, -14, - 12, 123, -28, -14, 122, -14, 124, 135, 29, 29, - 124, 135, 136, 120, 123, -106, -107, -63, -62, 60, - 61, -45, -81, 79, 82, -109, 56, -45, 119, -114, - -45, -15, -19, -19, 91, 124, 135, 123, -81, -127, - -125, -124, -126, 125, -128, 57, 126, 126, -34, 10, - 13, 12, 10, 120, 125, 120, -129, -77, -130, -140, - 125, 119, -10, -14, -40, -81, -131, -40, 124, 135, - 124, 124, 124, 126, 126, 124, -14, 128, -14, 128, - 126, 126, 124, 135, 124, -17, -14, -140, -140, 126, - 120, -140, -140, 120, 120, -5, 10, 29, -6, 10, - 29, 10, -28, 125, 130, 129, 164, 167, 165, 166, - 151, 128, 152, 161, 162, 163, 88, 89, 87, 150, - 149, 155, 156, 153, 154, 157, 159, 158, 160, 127, - 82, -81, 123, -122, -123, -78, 17, 78, -78, -78, - -78, -78, -78, 124, -54, 93, 94, -96, 22, 121, - -98, -14, 120, 32, 33, -99, 31, -99, 120, 136, - -106, -14, 121, -56, -137, -19, 128, 59, -137, -57, - -25, 122, 10, -28, -103, 41, -106, 124, 135, -144, - 82, -81, 119, -114, -108, 135, -43, 136, -38, -92, - 125, -126, -128, -13, -131, 126, -14, -135, 125, 125, - -13, -14, 120, -134, -36, 58, -17, -17, -69, 10, + -14, 144, -80, 143, -140, -4, 144, 158, 29, -81, + 144, 158, 29, -81, 10, 29, 160, -28, -78, -7, + -31, -81, 79, 82, 60, 148, -8, 62, -79, 18, + 74, -11, 154, 155, 153, 152, 146, 146, -95, -85, + -85, -48, 144, 158, -99, 144, -99, 144, -27, -14, + 12, 146, -28, -14, 145, -14, 147, 158, 29, 29, + 147, 158, 160, 143, 146, -106, -107, -63, -62, 60, + 61, -45, -81, 79, 82, -109, 56, -45, 142, -114, + -45, -15, -19, -19, 91, 147, 158, 146, -81, -127, + -125, -124, -126, 148, -128, 57, 149, 149, -34, 10, + 13, 12, 10, 143, 148, 143, -129, -77, -130, -140, + 148, 142, -10, -14, -40, -81, -131, -40, 147, 158, + 147, 147, 147, 149, 149, 147, -14, 151, -14, 151, + 149, 149, 147, 158, 147, -17, -14, -140, -140, 149, + 143, -140, -140, 143, 143, -5, 10, 29, -6, 10, + 29, 10, -28, 148, 153, 152, 162, 131, 163, 164, + 159, 151, 161, 132, 133, 167, 88, 89, 87, 130, + 129, 134, 135, 136, 137, 165, 166, 138, 139, 150, + 82, -81, 146, -122, -123, -78, 17, 78, -78, -78, + -78, -78, -78, 147, -54, 93, 94, -96, 22, 144, + -98, -14, 143, 32, 33, -99, 31, -99, 143, 160, + -106, -14, 144, -56, -137, -19, 151, 59, -137, -57, + -25, 145, 10, -28, -103, 41, -106, 147, 158, -144, + 82, -81, 142, -114, -108, 158, -43, 160, -38, -92, + 148, -126, -128, -13, -131, 149, -14, -135, 148, 148, + -13, -14, 143, -134, -36, 58, -17, -17, -69, 10, 10, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, 122, -78, -81, - -122, 126, -151, 135, 58, 10, 52, 124, 121, -48, - -25, -55, 93, 94, 121, 121, -14, -150, 122, 121, - 120, 121, 31, -28, 124, -138, 58, -19, 123, -138, - -85, 136, -58, 42, 123, 124, -94, 44, -63, -145, - 83, -81, -108, 120, -66, -110, -67, -68, -111, -120, + -78, -78, -78, -78, -78, -78, -78, 145, -78, -81, + -122, 149, -151, 158, 58, 10, 52, 147, 144, -48, + -25, -55, 93, 94, 144, 144, -14, -150, 145, 144, + 143, 144, 31, -28, 147, -138, 58, -19, 146, -138, + -85, 160, -58, 42, 146, 147, -94, 44, -63, -145, + 83, -81, -108, 143, -66, -110, -67, -68, -111, -120, 47, 38, 44, -76, 103, 102, 101, 98, 99, 100, - -45, -139, -14, 124, -13, 126, -129, 126, -128, -13, - -13, 126, 120, -133, 57, -14, 128, 126, -78, 122, - 124, -78, -78, -25, 95, -48, 122, -98, -150, -85, - 121, -94, 124, -137, -92, 124, 28, -28, 119, -45, - 119, 119, 123, 12, 120, -112, 12, 121, 135, -1, - -76, 10, -116, -45, 126, 120, 126, 126, -131, -17, - -78, 58, 121, 122, -85, 124, -85, 119, -148, -25, - 122, 124, -148, 121, -85, 12, -85, -85, -93, 12, - 128, 136, 121, 135, 136, 10, -144, 136, -143, 135, - 121, 119, -78, -85, -147, -25, 122, -85, -85, 120, - 124, 120, 120, 124, 135, 12, -28, 12, -28, 136, + -45, -139, -14, 147, -13, 149, -129, 149, -128, -13, + -13, 149, 143, -133, 57, -14, 151, 149, -78, 145, + 147, -78, -78, -25, 95, -48, 145, -98, -150, -85, + 144, -94, 147, -137, -92, 147, 28, -28, 142, -45, + 142, 142, 146, 12, 143, -112, 12, 144, 158, -1, + -76, 10, -116, -45, 149, 143, 149, 149, -131, -17, + -78, 58, 144, 145, -85, 147, -85, 142, -148, -25, + 145, 147, -148, 144, -85, 12, -85, -85, -93, 12, + 151, 160, 144, 158, 160, 10, -144, 160, -143, 158, + 144, 142, -78, -85, -147, -25, 145, -85, -85, 143, + 147, 143, 143, 147, 158, 12, -28, 12, -28, 160, 10, -28, -45, -117, -118, -70, -71, -72, -73, -74, - -45, 10, -85, 120, 26, 119, 12, 128, 136, -28, - 123, 120, -70, 121, 121, 45, 29, 78, 24, 121, - -85, 12, -28, -106, -119, -45, -75, -76, 10, 121, - 120, 124, 135, 10, -104, -105, -59, 41, -142, 121, - 119, -45, -59, 123, -85, -45, 120, 12, 124, 119, - -85, 120, + -45, 10, -85, 143, 26, 142, 12, 151, 160, -28, + 146, 143, -70, 144, 144, 45, 29, 78, 24, 144, + -85, 12, -28, -106, -119, -45, -75, -76, 10, 144, + 143, 147, 158, 10, -104, -105, -59, 41, -142, 144, + 142, -45, -59, 146, -85, -45, 143, 12, 147, 142, + -85, 143, } var yyDef = [...]int{ @@ -1924,16 +1974,16 @@ var yyTok1 = [...]int{ 1, 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, 131, 117, 3, 134, 166, 128, 3, - 123, 124, 164, 130, 135, 129, 163, 165, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 122, 121, - 157, 136, 159, 127, 133, 3, 3, 3, 3, 3, + 3, 3, 3, 154, 140, 3, 157, 164, 151, 3, + 146, 147, 162, 153, 158, 152, 167, 163, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 145, 144, + 165, 160, 166, 150, 156, 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, 125, 3, 126, 152, 3, 118, 3, 3, 3, + 3, 148, 3, 149, 161, 3, 141, 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, 119, 151, 120, 132, + 3, 3, 3, 142, 159, 143, 155, } var yyTok2 = [...]int{ @@ -1948,9 +1998,9 @@ var yyTok2 = [...]int{ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 153, - 154, 155, 156, 158, 160, 161, 162, 167, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, } var yyTok3 = [...]int{ 0, @@ -2295,14 +2345,14 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:236 + //line php5/php5.y:268 { yylex.(*Parser).rootNode = stmt.NewStmtList(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) } case 2: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:244 + //line php5/php5.y:276 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2310,13 +2360,13 @@ yydefault: } case 3: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:249 + //line php5/php5.y:281 { yyVAL.list = []node.Node{} } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:254 + //line php5/php5.y:286 { namePart := name.NewNamePart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2325,7 +2375,7 @@ yydefault: } case 5: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:261 + //line php5/php5.y:293 { namePart := name.NewNamePart(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2334,32 +2384,32 @@ yydefault: } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:271 + //line php5/php5.y:303 { // error yyVAL.node = nil } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:276 + //line php5/php5.y:308 { yyVAL.node = yyDollar[1].node } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:278 + //line php5/php5.y:310 { yyVAL.node = yyDollar[1].node } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:280 + //line php5/php5.y:312 { yyVAL.node = yyDollar[1].node } case 10: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:282 + //line php5/php5.y:314 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2367,7 +2417,7 @@ yydefault: } case 11: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:288 + //line php5/php5.y:320 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2379,7 +2429,7 @@ yydefault: } case 12: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:298 + //line php5/php5.y:330 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2391,7 +2441,7 @@ yydefault: } case 13: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:308 + //line php5/php5.y:340 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2399,7 +2449,7 @@ yydefault: } case 14: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:314 + //line php5/php5.y:346 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2407,7 +2457,7 @@ yydefault: } case 15: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:320 + //line php5/php5.y:352 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2419,7 +2469,7 @@ yydefault: } case 16: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:330 + //line php5/php5.y:362 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2431,25 +2481,25 @@ yydefault: } case 17: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:340 + //line php5/php5.y:372 { yyVAL.node = yyDollar[1].node } case 18: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:345 + //line php5/php5.y:377 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:347 + //line php5/php5.y:379 { yyVAL.list = []node.Node{yyDollar[1].node} } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:352 + //line php5/php5.y:384 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2461,7 +2511,7 @@ yydefault: } case 21: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:362 + //line php5/php5.y:394 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2476,7 +2526,7 @@ yydefault: } case 22: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:375 + //line php5/php5.y:407 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2488,7 +2538,7 @@ yydefault: } case 23: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:385 + //line php5/php5.y:417 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2503,19 +2553,19 @@ yydefault: } case 24: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:401 + //line php5/php5.y:433 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:403 + //line php5/php5.y:435 { yyVAL.list = []node.Node{yyDollar[1].node} } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:408 + //line php5/php5.y:440 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2527,7 +2577,7 @@ yydefault: } case 27: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:418 + //line php5/php5.y:450 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2542,7 +2592,7 @@ yydefault: } case 28: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:431 + //line php5/php5.y:463 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2554,7 +2604,7 @@ yydefault: } case 29: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:441 + //line php5/php5.y:473 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2569,19 +2619,19 @@ yydefault: } case 30: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:457 + //line php5/php5.y:489 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:459 + //line php5/php5.y:491 { yyVAL.list = []node.Node{yyDollar[1].node} } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:464 + //line php5/php5.y:496 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2593,7 +2643,7 @@ yydefault: } case 33: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:474 + //line php5/php5.y:506 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2608,7 +2658,7 @@ yydefault: } case 34: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:487 + //line php5/php5.y:519 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2620,7 +2670,7 @@ yydefault: } case 35: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:497 + //line php5/php5.y:529 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2635,7 +2685,7 @@ yydefault: } case 36: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:513 + //line php5/php5.y:545 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2653,7 +2703,7 @@ yydefault: } case 37: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:529 + //line php5/php5.y:561 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2671,7 +2721,7 @@ yydefault: } case 38: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:548 + //line php5/php5.y:580 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2679,38 +2729,38 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:554 + //line php5/php5.y:586 { yyVAL.list = []node.Node{} } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:560 + //line php5/php5.y:592 { // error yyVAL.node = nil } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:565 + //line php5/php5.y:597 { yyVAL.node = yyDollar[1].node } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:567 + //line php5/php5.y:599 { yyVAL.node = yyDollar[1].node } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:569 + //line php5/php5.y:601 { yyVAL.node = yyDollar[1].node } case 44: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:571 + //line php5/php5.y:603 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2718,13 +2768,13 @@ yydefault: } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:581 + //line php5/php5.y:613 { yyVAL.node = yyDollar[1].node } case 46: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:583 + //line php5/php5.y:615 { label := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2736,7 +2786,7 @@ yydefault: } case 47: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:596 + //line php5/php5.y:628 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2744,7 +2794,7 @@ yydefault: } case 48: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:602 + //line php5/php5.y:634 { yyVAL.node = stmt.NewIf(yyDollar[2].node, yyDollar[3].node, yyDollar[4].list, yyDollar[5].node) @@ -2760,7 +2810,7 @@ yydefault: } case 49: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:616 + //line php5/php5.y:648 { stmts := stmt.NewStmtList(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) @@ -2771,7 +2821,7 @@ yydefault: } case 50: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:625 + //line php5/php5.y:657 { if yyDollar[3].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltWhile(yyDollar[2].node, yyDollar[3].altSyntaxNode.node) @@ -2783,7 +2833,7 @@ yydefault: } case 51: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:635 + //line php5/php5.y:667 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2791,7 +2841,7 @@ yydefault: } case 52: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:641 + //line php5/php5.y:673 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltFor(yyDollar[3].list, yyDollar[5].list, yyDollar[7].list, yyDollar[9].altSyntaxNode.node) @@ -2803,7 +2853,7 @@ yydefault: } case 53: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:651 + //line php5/php5.y:683 { if yyDollar[3].nodesWithEndToken.endToken.Value == ";" { yyVAL.node = stmt.NewAltSwitch(yyDollar[2].node, yyDollar[3].nodesWithEndToken.nodes) @@ -2815,7 +2865,7 @@ yydefault: } case 54: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:661 + //line php5/php5.y:693 { yyVAL.node = stmt.NewBreak(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2823,7 +2873,7 @@ yydefault: } case 55: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:667 + //line php5/php5.y:699 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2831,7 +2881,7 @@ yydefault: } case 56: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:673 + //line php5/php5.y:705 { yyVAL.node = stmt.NewContinue(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2839,7 +2889,7 @@ yydefault: } case 57: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:679 + //line php5/php5.y:711 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2847,7 +2897,7 @@ yydefault: } case 58: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:685 + //line php5/php5.y:717 { yyVAL.node = stmt.NewReturn(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2855,7 +2905,7 @@ yydefault: } case 59: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:691 + //line php5/php5.y:723 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2863,7 +2913,7 @@ yydefault: } case 60: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:697 + //line php5/php5.y:729 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2871,7 +2921,7 @@ yydefault: } case 61: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:703 + //line php5/php5.y:735 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2879,7 +2929,7 @@ yydefault: } case 62: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:709 + //line php5/php5.y:741 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2887,7 +2937,7 @@ yydefault: } case 63: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:715 + //line php5/php5.y:747 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2895,7 +2945,7 @@ yydefault: } case 64: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:721 + //line php5/php5.y:753 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2903,7 +2953,7 @@ yydefault: } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:727 + //line php5/php5.y:759 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2911,7 +2961,7 @@ yydefault: } case 66: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:733 + //line php5/php5.y:765 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2919,7 +2969,7 @@ yydefault: } case 67: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:739 + //line php5/php5.y:771 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2927,7 +2977,7 @@ yydefault: } case 68: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:745 + //line php5/php5.y:777 { if yyDollar[6].foreachVariable.node == nil { if yyDollar[8].altSyntaxNode.isAlt { @@ -2947,7 +2997,7 @@ yydefault: } case 69: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:763 + //line php5/php5.y:795 { if yyDollar[6].foreachVariable.node == nil { if yyDollar[8].altSyntaxNode.isAlt { @@ -2967,7 +3017,7 @@ yydefault: } case 70: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:781 + //line php5/php5.y:813 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) @@ -2975,7 +3025,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:787 + //line php5/php5.y:819 { yyVAL.node = stmt.NewNop() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2983,7 +3033,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:793 + //line php5/php5.y:825 { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -2997,7 +3047,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:805 + //line php5/php5.y:837 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -3005,7 +3055,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:811 + //line php5/php5.y:843 { label := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3017,13 +3067,13 @@ yydefault: } case 75: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:824 + //line php5/php5.y:856 { yyVAL.list = []node.Node{} } case 76: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:826 + //line php5/php5.y:858 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3041,13 +3091,13 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:844 + //line php5/php5.y:876 { yyVAL.node = nil } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:846 + //line php5/php5.y:878 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3055,31 +3105,31 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:855 + //line php5/php5.y:887 { yyVAL.list = yyDollar[1].list } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:857 + //line php5/php5.y:889 { yyVAL.list = []node.Node{} } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:862 + //line php5/php5.y:894 { yyVAL.list = []node.Node{yyDollar[1].node} } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:864 + //line php5/php5.y:896 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:869 + //line php5/php5.y:901 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3095,61 +3145,61 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:886 + //line php5/php5.y:918 { yyVAL.list = []node.Node{yyDollar[1].node} } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:888 + //line php5/php5.y:920 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:893 + //line php5/php5.y:925 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:898 + //line php5/php5.y:930 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:903 + //line php5/php5.y:935 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:908 + //line php5/php5.y:940 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:910 + //line php5/php5.y:942 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:915 + //line php5/php5.y:947 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:917 + //line php5/php5.y:949 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:922 + //line php5/php5.y:954 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3161,7 +3211,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:935 + //line php5/php5.y:967 { switch n := yyDollar[1].node.(type) { case *stmt.Class: @@ -3184,7 +3234,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:956 + //line php5/php5.y:988 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3196,7 +3246,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:970 + //line php5/php5.y:1002 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3204,7 +3254,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:976 + //line php5/php5.y:1008 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3216,7 +3266,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:986 + //line php5/php5.y:1018 { yyVAL.node = stmt.NewTrait(nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3224,7 +3274,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:992 + //line php5/php5.y:1024 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3236,85 +3286,85 @@ yydefault: } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1005 + //line php5/php5.y:1037 { yyVAL.node = nil } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1007 + //line php5/php5.y:1039 { yyVAL.node = yyDollar[2].node } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1012 + //line php5/php5.y:1044 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1017 + //line php5/php5.y:1049 { yyVAL.list = nil } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1019 + //line php5/php5.y:1051 { yyVAL.list = yyDollar[2].list } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1024 + //line php5/php5.y:1056 { yyVAL.list = nil } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1026 + //line php5/php5.y:1058 { yyVAL.list = yyDollar[2].list } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1031 + //line php5/php5.y:1063 { yyVAL.list = []node.Node{yyDollar[1].node} } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1033 + //line php5/php5.y:1065 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1038 + //line php5/php5.y:1070 { yyVAL.foreachVariable = foreachVariable{nil, false} } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1040 + //line php5/php5.y:1072 { yyVAL.foreachVariable = yyDollar[2].foreachVariable } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1045 + //line php5/php5.y:1077 { yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1047 + //line php5/php5.y:1079 { yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1049 + //line php5/php5.y:1081 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3323,39 +3373,39 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1059 + //line php5/php5.y:1091 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1061 + //line php5/php5.y:1093 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1070 + //line php5/php5.y:1102 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1072 + //line php5/php5.y:1104 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1081 + //line php5/php5.y:1113 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1083 + //line php5/php5.y:1115 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3363,7 +3413,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1093 + //line php5/php5.y:1125 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3377,7 +3427,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1105 + //line php5/php5.y:1137 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3391,37 +3441,37 @@ yydefault: } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1121 + //line php5/php5.y:1153 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1123 + //line php5/php5.y:1155 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[4].token} } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1125 + //line php5/php5.y:1157 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[4].token} } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1127 + //line php5/php5.y:1159 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[5].token} } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1133 + //line php5/php5.y:1165 { yyVAL.list = []node.Node{} } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1135 + //line php5/php5.y:1167 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) @@ -3430,7 +3480,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1142 + //line php5/php5.y:1174 { _default := stmt.NewDefault(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) @@ -3439,26 +3489,26 @@ yydefault: } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1159 + //line php5/php5.y:1191 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1161 + //line php5/php5.y:1193 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1171 + //line php5/php5.y:1203 { yyVAL.list = nil } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1173 + //line php5/php5.y:1205 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) @@ -3468,13 +3518,13 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1185 + //line php5/php5.y:1217 { yyVAL.list = nil } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1187 + //line php5/php5.y:1219 { stmts := stmt.NewStmtList(yyDollar[5].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[5].list)) @@ -3487,13 +3537,13 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1202 + //line php5/php5.y:1234 { yyVAL.node = nil } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1204 + //line php5/php5.y:1236 { yyVAL.node = stmt.NewElse(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3501,13 +3551,13 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1214 + //line php5/php5.y:1246 { yyVAL.node = nil } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1216 + //line php5/php5.y:1248 { stmts := stmt.NewStmtList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) @@ -3518,31 +3568,31 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1229 + //line php5/php5.y:1261 { yyVAL.list = yyDollar[1].list } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1231 + //line php5/php5.y:1263 { yyVAL.list = nil } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1236 + //line php5/php5.y:1268 { yyVAL.list = []node.Node{yyDollar[1].node} } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1238 + //line php5/php5.y:1270 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1243 + //line php5/php5.y:1275 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3570,7 +3620,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1269 + //line php5/php5.y:1301 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3598,13 +3648,13 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1299 + //line php5/php5.y:1331 { yyVAL.node = nil } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1301 + //line php5/php5.y:1333 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3612,7 +3662,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1307 + //line php5/php5.y:1339 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3620,25 +3670,25 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1313 + //line php5/php5.y:1345 { yyVAL.node = yyDollar[1].node } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1319 + //line php5/php5.y:1351 { yyVAL.nodesWithEndToken = &nodesWithEndToken{[]node.Node{}, yyDollar[2].token} } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1321 + //line php5/php5.y:1353 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1323 + //line php5/php5.y:1355 { arg := node.NewArgument(yyDollar[2].node, false, false) yylex.(*Parser).positions.AddPosition(arg, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -3648,19 +3698,19 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1335 + //line php5/php5.y:1367 { yyVAL.list = []node.Node{yyDollar[1].node} } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1337 + //line php5/php5.y:1369 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1342 + //line php5/php5.y:1374 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3668,7 +3718,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1348 + //line php5/php5.y:1380 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3676,7 +3726,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1354 + //line php5/php5.y:1386 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -3684,7 +3734,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1360 + //line php5/php5.y:1392 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3692,19 +3742,19 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1369 + //line php5/php5.y:1401 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1371 + //line php5/php5.y:1403 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1377 + //line php5/php5.y:1409 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3716,7 +3766,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1387 + //line php5/php5.y:1419 { yyVAL.node = expr.NewVariable(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3724,7 +3774,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1393 + //line php5/php5.y:1425 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3732,7 +3782,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1403 + //line php5/php5.y:1435 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3751,7 +3801,7 @@ yydefault: } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1420 + //line php5/php5.y:1452 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3770,7 +3820,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1437 + //line php5/php5.y:1469 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3789,7 +3839,7 @@ yydefault: } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1454 + //line php5/php5.y:1486 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3808,19 +3858,19 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1476 + //line php5/php5.y:1508 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1478 + //line php5/php5.y:1510 { yyVAL.list = []node.Node{} } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1484 + //line php5/php5.y:1516 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) @@ -3828,19 +3878,19 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1490 + //line php5/php5.y:1522 { yyVAL.node = yyDollar[1].node } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1492 + //line php5/php5.y:1524 { yyVAL.node = yyDollar[1].node } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1494 + //line php5/php5.y:1526 { name := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3852,7 +3902,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1507 + //line php5/php5.y:1539 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].nodesWithEndToken.nodes) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].nodesWithEndToken.endToken)) @@ -3860,67 +3910,67 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1516 + //line php5/php5.y:1548 { yyVAL.list = []node.Node{yyDollar[1].node} } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1518 + //line php5/php5.y:1550 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1523 + //line php5/php5.y:1555 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1525 + //line php5/php5.y:1557 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1530 + //line php5/php5.y:1562 { yyVAL.list = nil } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1532 + //line php5/php5.y:1564 { yyVAL.list = yyDollar[1].list } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1537 + //line php5/php5.y:1569 { yyVAL.list = []node.Node{yyDollar[1].node} } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1539 + //line php5/php5.y:1571 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1544 + //line php5/php5.y:1576 { yyVAL.node = yyDollar[1].node } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1546 + //line php5/php5.y:1578 { yyVAL.node = yyDollar[1].node } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1551 + //line php5/php5.y:1583 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) @@ -3928,19 +3978,19 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1560 + //line php5/php5.y:1592 { yyVAL.list = []node.Node{yyDollar[1].node} } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1562 + //line php5/php5.y:1594 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1567 + //line php5/php5.y:1599 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3952,13 +4002,13 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1577 + //line php5/php5.y:1609 { yyVAL.node = yyDollar[1].node } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1582 + //line php5/php5.y:1614 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3970,7 +4020,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1595 + //line php5/php5.y:1627 { alias := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3982,7 +4032,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1605 + //line php5/php5.y:1637 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -3990,37 +4040,37 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1614 + //line php5/php5.y:1646 { yyVAL.node = nil } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1616 + //line php5/php5.y:1648 { yyVAL.node = yyDollar[1].node } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1621 + //line php5/php5.y:1653 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1623 + //line php5/php5.y:1655 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1628 + //line php5/php5.y:1660 { yyVAL.list = yyDollar[1].list } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1630 + //line php5/php5.y:1662 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4030,31 +4080,31 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1641 + //line php5/php5.y:1673 { yyVAL.list = nil } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1643 + //line php5/php5.y:1675 { yyVAL.list = yyDollar[1].list } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1648 + //line php5/php5.y:1680 { yyVAL.list = []node.Node{yyDollar[1].node} } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1650 + //line php5/php5.y:1682 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 204: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1655 + //line php5/php5.y:1687 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4062,7 +4112,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1661 + //line php5/php5.y:1693 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4070,7 +4120,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1667 + //line php5/php5.y:1699 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4078,7 +4128,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1673 + //line php5/php5.y:1705 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4086,7 +4136,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1679 + //line php5/php5.y:1711 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4094,7 +4144,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1685 + //line php5/php5.y:1717 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4102,7 +4152,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1694 + //line php5/php5.y:1726 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4120,7 +4170,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1710 + //line php5/php5.y:1742 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4138,7 +4188,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1726 + //line php5/php5.y:1758 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4156,7 +4206,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1742 + //line php5/php5.y:1774 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4174,7 +4224,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1761 + //line php5/php5.y:1793 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4191,7 +4241,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1776 + //line php5/php5.y:1808 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -4207,55 +4257,55 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1793 + //line php5/php5.y:1825 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1795 + //line php5/php5.y:1827 { yyVAL.list = []node.Node{yyDollar[1].node} } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1801 + //line php5/php5.y:1833 { yyVAL.list = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1803 + //line php5/php5.y:1835 { yyVAL.list = yyDollar[1].list } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1808 + //line php5/php5.y:1840 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1810 + //line php5/php5.y:1842 { yyVAL.list = []node.Node{yyDollar[1].node} } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1815 + //line php5/php5.y:1847 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1817 + //line php5/php5.y:1849 { yyVAL.list = yyDollar[1].list } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1822 + //line php5/php5.y:1854 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -4264,7 +4314,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1829 + //line php5/php5.y:1861 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -4273,37 +4323,37 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1839 + //line php5/php5.y:1871 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1841 + //line php5/php5.y:1873 { yyVAL.list = yyDollar[1].list } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1843 + //line php5/php5.y:1875 { yyVAL.list = yyDollar[1].list } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1848 + //line php5/php5.y:1880 { yyVAL.list = nil } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1850 + //line php5/php5.y:1882 { yyVAL.list = yyDollar[1].list } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1855 + //line php5/php5.y:1887 { if yyDollar[3].nodesWithEndToken != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].nodesWithEndToken.nodes) @@ -4317,7 +4367,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1870 + //line php5/php5.y:1902 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -4329,7 +4379,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1880 + //line php5/php5.y:1912 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4337,7 +4387,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1886 + //line php5/php5.y:1918 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4345,7 +4395,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1892 + //line php5/php5.y:1924 { _new := expr.NewNew(yyDollar[5].node, nil) yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[5].node)) @@ -4362,7 +4412,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1907 + //line php5/php5.y:1939 { yyVAL.node = expr.NewClone(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4370,7 +4420,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1913 + //line php5/php5.y:1945 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4378,7 +4428,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1919 + //line php5/php5.y:1951 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4386,7 +4436,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1925 + //line php5/php5.y:1957 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4394,7 +4444,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1931 + //line php5/php5.y:1963 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4402,7 +4452,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1937 + //line php5/php5.y:1969 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4410,7 +4460,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1943 + //line php5/php5.y:1975 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4418,7 +4468,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1949 + //line php5/php5.y:1981 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4426,7 +4476,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1955 + //line php5/php5.y:1987 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4434,7 +4484,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1961 + //line php5/php5.y:1993 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4442,7 +4492,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1967 + //line php5/php5.y:1999 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4450,7 +4500,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1973 + //line php5/php5.y:2005 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4458,7 +4508,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1979 + //line php5/php5.y:2011 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4466,7 +4516,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1985 + //line php5/php5.y:2017 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4474,7 +4524,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1991 + //line php5/php5.y:2023 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4482,7 +4532,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1997 + //line php5/php5.y:2029 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4490,7 +4540,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2003 + //line php5/php5.y:2035 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4498,7 +4548,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2009 + //line php5/php5.y:2041 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4506,7 +4556,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2015 + //line php5/php5.y:2047 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4514,7 +4564,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2021 + //line php5/php5.y:2053 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4522,7 +4572,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2027 + //line php5/php5.y:2059 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4530,7 +4580,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2033 + //line php5/php5.y:2065 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4538,7 +4588,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2039 + //line php5/php5.y:2071 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4546,7 +4596,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2045 + //line php5/php5.y:2077 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4554,7 +4604,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2051 + //line php5/php5.y:2083 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4562,7 +4612,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2057 + //line php5/php5.y:2089 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4570,7 +4620,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2063 + //line php5/php5.y:2095 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4578,7 +4628,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2069 + //line php5/php5.y:2101 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4586,7 +4636,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2075 + //line php5/php5.y:2107 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4594,7 +4644,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2081 + //line php5/php5.y:2113 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4602,7 +4652,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2087 + //line php5/php5.y:2119 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4610,7 +4660,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2093 + //line php5/php5.y:2125 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4618,7 +4668,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2099 + //line php5/php5.y:2131 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4626,7 +4676,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2105 + //line php5/php5.y:2137 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4634,7 +4684,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2111 + //line php5/php5.y:2143 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4642,7 +4692,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2117 + //line php5/php5.y:2149 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4650,7 +4700,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2123 + //line php5/php5.y:2155 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4658,7 +4708,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2129 + //line php5/php5.y:2161 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4666,7 +4716,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2135 + //line php5/php5.y:2167 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4674,7 +4724,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2141 + //line php5/php5.y:2173 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4682,7 +4732,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2147 + //line php5/php5.y:2179 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4690,7 +4740,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2153 + //line php5/php5.y:2185 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4698,7 +4748,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2159 + //line php5/php5.y:2191 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4706,7 +4756,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2165 + //line php5/php5.y:2197 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4714,7 +4764,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2171 + //line php5/php5.y:2203 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4722,7 +4772,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2177 + //line php5/php5.y:2209 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4730,7 +4780,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2183 + //line php5/php5.y:2215 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4738,19 +4788,19 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2189 + //line php5/php5.y:2221 { yyVAL.node = yyDollar[1].node } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2191 + //line php5/php5.y:2223 { yyVAL.node = yyDollar[1].node } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2193 + //line php5/php5.y:2225 { yyVAL.node = yyDollar[2].node @@ -4778,7 +4828,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2219 + //line php5/php5.y:2251 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -4786,7 +4836,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2225 + //line php5/php5.y:2257 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4794,13 +4844,13 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2231 + //line php5/php5.y:2263 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2233 + //line php5/php5.y:2265 { yyVAL.node = cast.NewInt(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4808,7 +4858,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2239 + //line php5/php5.y:2271 { yyVAL.node = cast.NewDouble(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4816,7 +4866,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2245 + //line php5/php5.y:2277 { yyVAL.node = cast.NewString(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4824,7 +4874,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2251 + //line php5/php5.y:2283 { yyVAL.node = cast.NewArray(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4832,7 +4882,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2257 + //line php5/php5.y:2289 { yyVAL.node = cast.NewObject(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4840,7 +4890,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2263 + //line php5/php5.y:2295 { yyVAL.node = cast.NewBool(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4848,7 +4898,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2269 + //line php5/php5.y:2301 { yyVAL.node = cast.NewUnset(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4856,7 +4906,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2275 + //line php5/php5.y:2307 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -4868,7 +4918,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2285 + //line php5/php5.y:2317 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4876,25 +4926,25 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2291 + //line php5/php5.y:2323 { yyVAL.node = yyDollar[1].node } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2293 + //line php5/php5.y:2325 { yyVAL.node = yyDollar[1].node } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2295 + //line php5/php5.y:2327 { yyVAL.node = yyDollar[1].node } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2297 + //line php5/php5.y:2329 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -4902,7 +4952,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2303 + //line php5/php5.y:2335 { yyVAL.node = expr.NewPrint(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4910,7 +4960,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2309 + //line php5/php5.y:2341 { yyVAL.node = expr.NewYield(nil, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4918,7 +4968,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:2315 + //line php5/php5.y:2347 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].list, nil, yyDollar[8].list, false, yyDollar[2].boolWithToken.value, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) @@ -4927,7 +4977,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:2322 + //line php5/php5.y:2354 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, nil, yyDollar[9].list, true, yyDollar[3].boolWithToken.value, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) @@ -4936,7 +4986,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2332 + //line php5/php5.y:2364 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4944,7 +4994,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2338 + //line php5/php5.y:2370 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4952,7 +5002,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2344 + //line php5/php5.y:2376 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -4960,7 +5010,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2350 + //line php5/php5.y:2382 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -4968,7 +5018,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2359 + //line php5/php5.y:2391 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -4976,7 +5026,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2365 + //line php5/php5.y:2397 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -4984,7 +5034,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2371 + //line php5/php5.y:2403 { str := scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(str, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4996,7 +5046,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2381 + //line php5/php5.y:2413 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5004,7 +5054,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2390 + //line php5/php5.y:2422 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5012,7 +5062,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2396 + //line php5/php5.y:2428 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5020,25 +5070,25 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2405 + //line php5/php5.y:2437 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2410 + //line php5/php5.y:2442 { yyVAL.list = []node.Node{} } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2412 + //line php5/php5.y:2444 { yyVAL.list = yyDollar[3].list } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2417 + //line php5/php5.y:2449 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5056,7 +5106,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2433 + //line php5/php5.y:2465 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -5074,7 +5124,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2449 + //line php5/php5.y:2481 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5092,7 +5142,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2465 + //line php5/php5.y:2497 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5110,7 +5160,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2484 + //line php5/php5.y:2516 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5122,7 +5172,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2494 + //line php5/php5.y:2526 { funcName := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5134,7 +5184,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2504 + //line php5/php5.y:2536 { funcName := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5146,7 +5196,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2514 + //line php5/php5.y:2546 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) @@ -5154,7 +5204,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2520 + //line php5/php5.y:2552 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) @@ -5162,7 +5212,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2526 + //line php5/php5.y:2558 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) @@ -5170,7 +5220,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2532 + //line php5/php5.y:2564 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) @@ -5178,7 +5228,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2538 + //line php5/php5.y:2570 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].nodesWithEndToken.nodes) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].nodesWithEndToken.endToken)) @@ -5186,7 +5236,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2547 + //line php5/php5.y:2579 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5194,7 +5244,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2553 + //line php5/php5.y:2585 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5202,7 +5252,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2559 + //line php5/php5.y:2591 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5210,7 +5260,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2565 + //line php5/php5.y:2597 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5218,7 +5268,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2574 + //line php5/php5.y:2606 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5226,7 +5276,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2580 + //line php5/php5.y:2612 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5234,7 +5284,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2586 + //line php5/php5.y:2618 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5242,19 +5292,19 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2595 + //line php5/php5.y:2627 { yyVAL.node = yyDollar[1].node } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2597 + //line php5/php5.y:2629 { yyVAL.node = yyDollar[1].node } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2602 + //line php5/php5.y:2634 { yyVAL.node = yyDollar[1].node @@ -5292,79 +5342,79 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2638 + //line php5/php5.y:2670 { yyVAL.node = yyDollar[1].node } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2644 + //line php5/php5.y:2676 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2646 + //line php5/php5.y:2678 { yyVAL.list = []node.Node{} } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2652 + //line php5/php5.y:2684 { yyVAL.list = yyDollar[2].list } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2657 + //line php5/php5.y:2689 { yyVAL.node = nil } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2659 + //line php5/php5.y:2691 { yyVAL.node = nil } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2661 + //line php5/php5.y:2693 { yyVAL.node = yyDollar[1].node } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2666 + //line php5/php5.y:2698 { yyVAL.list = []node.Node{} } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2668 + //line php5/php5.y:2700 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2670 + //line php5/php5.y:2702 { yyVAL.list = yyDollar[1].list } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2675 + //line php5/php5.y:2707 { yyVAL.nodesWithEndToken = nil } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2677 + //line php5/php5.y:2709 { yyVAL.nodesWithEndToken = yyDollar[1].nodesWithEndToken } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2682 + //line php5/php5.y:2714 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5372,7 +5422,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2688 + //line php5/php5.y:2720 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5380,7 +5430,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2694 + //line php5/php5.y:2726 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5388,7 +5438,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2700 + //line php5/php5.y:2732 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5396,7 +5446,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2706 + //line php5/php5.y:2738 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5404,7 +5454,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2712 + //line php5/php5.y:2744 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5412,7 +5462,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2718 + //line php5/php5.y:2750 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5420,7 +5470,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2724 + //line php5/php5.y:2756 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5428,7 +5478,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2730 + //line php5/php5.y:2762 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5436,7 +5486,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2736 + //line php5/php5.y:2768 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5444,7 +5494,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2742 + //line php5/php5.y:2774 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5456,7 +5506,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2752 + //line php5/php5.y:2784 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -5464,7 +5514,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2761 + //line php5/php5.y:2793 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5476,25 +5526,25 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2774 + //line php5/php5.y:2806 { yyVAL.node = yyDollar[1].node } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2779 + //line php5/php5.y:2811 { yyVAL.node = yyDollar[1].node } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2781 + //line php5/php5.y:2813 { yyVAL.node = yyDollar[1].node } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2783 + //line php5/php5.y:2815 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5506,7 +5556,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2793 + //line php5/php5.y:2825 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5518,7 +5568,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2803 + //line php5/php5.y:2835 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5530,7 +5580,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2813 + //line php5/php5.y:2845 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5538,7 +5588,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2819 + //line php5/php5.y:2851 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5546,13 +5596,13 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2825 + //line php5/php5.y:2857 { yyVAL.node = yyDollar[1].node } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2827 + //line php5/php5.y:2859 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5560,13 +5610,13 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2833 + //line php5/php5.y:2865 { yyVAL.node = yyDollar[1].node } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2838 + //line php5/php5.y:2870 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5574,7 +5624,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2844 + //line php5/php5.y:2876 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5582,7 +5632,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2850 + //line php5/php5.y:2882 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5590,7 +5640,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2856 + //line php5/php5.y:2888 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5598,7 +5648,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2862 + //line php5/php5.y:2894 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5606,7 +5656,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2868 + //line php5/php5.y:2900 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5614,7 +5664,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2874 + //line php5/php5.y:2906 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5622,7 +5672,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2880 + //line php5/php5.y:2912 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5630,7 +5680,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2886 + //line php5/php5.y:2918 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5638,7 +5688,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2892 + //line php5/php5.y:2924 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5646,7 +5696,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2898 + //line php5/php5.y:2930 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5654,7 +5704,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2904 + //line php5/php5.y:2936 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5662,7 +5712,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2910 + //line php5/php5.y:2942 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5670,7 +5720,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2916 + //line php5/php5.y:2948 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5678,7 +5728,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2922 + //line php5/php5.y:2954 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5686,7 +5736,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2928 + //line php5/php5.y:2960 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5694,7 +5744,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2934 + //line php5/php5.y:2966 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5702,7 +5752,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2940 + //line php5/php5.y:2972 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5710,7 +5760,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2946 + //line php5/php5.y:2978 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5718,7 +5768,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2952 + //line php5/php5.y:2984 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5726,7 +5776,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2958 + //line php5/php5.y:2990 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5734,7 +5784,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2964 + //line php5/php5.y:2996 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5742,7 +5792,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2970 + //line php5/php5.y:3002 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5750,7 +5800,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2976 + //line php5/php5.y:3008 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5758,7 +5808,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2982 + //line php5/php5.y:3014 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5766,7 +5816,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2988 + //line php5/php5.y:3020 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5774,7 +5824,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2994 + //line php5/php5.y:3026 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5782,7 +5832,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3000 + //line php5/php5.y:3032 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5790,7 +5840,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3006 + //line php5/php5.y:3038 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5798,7 +5848,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3012 + //line php5/php5.y:3044 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -5806,7 +5856,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3018 + //line php5/php5.y:3050 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5814,7 +5864,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3024 + //line php5/php5.y:3056 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5822,19 +5872,19 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3030 + //line php5/php5.y:3062 { yyVAL.node = yyDollar[2].node } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3035 + //line php5/php5.y:3067 { yyVAL.node = yyDollar[1].node } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3037 + //line php5/php5.y:3069 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5846,7 +5896,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3047 + //line php5/php5.y:3079 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5858,7 +5908,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3057 + //line php5/php5.y:3089 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5870,7 +5920,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3070 + //line php5/php5.y:3102 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5882,25 +5932,25 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3080 + //line php5/php5.y:3112 { yyVAL.node = yyDollar[1].node } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3082 + //line php5/php5.y:3114 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3084 + //line php5/php5.y:3116 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3086 + //line php5/php5.y:3118 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5908,7 +5958,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3092 + //line php5/php5.y:3124 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5916,7 +5966,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3098 + //line php5/php5.y:3130 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5924,19 +5974,19 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3107 + //line php5/php5.y:3139 { yyVAL.list = nil } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3109 + //line php5/php5.y:3141 { yyVAL.list = yyDollar[1].list } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3119 + //line php5/php5.y:3151 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -5946,7 +5996,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3127 + //line php5/php5.y:3159 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -5956,7 +6006,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3135 + //line php5/php5.y:3167 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5966,7 +6016,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3143 + //line php5/php5.y:3175 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -5976,49 +6026,49 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3154 + //line php5/php5.y:3186 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3156 + //line php5/php5.y:3188 { yyVAL.node = yyDollar[1].node } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3161 + //line php5/php5.y:3193 { yyVAL.node = yyDollar[2].node } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3163 + //line php5/php5.y:3195 { yyVAL.node = yyDollar[2].node } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3169 + //line php5/php5.y:3201 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3175 + //line php5/php5.y:3207 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3180 + //line php5/php5.y:3212 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3185 + //line php5/php5.y:3217 { yyVAL.node = yyDollar[1].node @@ -6073,25 +6123,25 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3238 + //line php5/php5.y:3270 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3243 + //line php5/php5.y:3275 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3245 + //line php5/php5.y:3277 { yyVAL.list = []node.Node{} } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3251 + //line php5/php5.y:3283 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -6102,7 +6152,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3263 + //line php5/php5.y:3295 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6111,7 +6161,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3270 + //line php5/php5.y:3302 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6120,38 +6170,38 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3280 + //line php5/php5.y:3312 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].nodesWithEndToken.nodes) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].nodesWithEndToken.nodes, yyDollar[1].nodesWithEndToken.endToken)) } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3288 + //line php5/php5.y:3320 { yyVAL.list = []node.Node{yyDollar[1].node} } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3290 + //line php5/php5.y:3322 { yyVAL.list = yyDollar[1].list } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3292 + //line php5/php5.y:3324 { yyVAL.list = nil } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3297 + //line php5/php5.y:3329 { yyVAL.node = yyDollar[1].node } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3299 + //line php5/php5.y:3331 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6163,7 +6213,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3312 + //line php5/php5.y:3344 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6171,7 +6221,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3318 + //line php5/php5.y:3350 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6179,13 +6229,13 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3328 + //line php5/php5.y:3360 { yyVAL.node = yyDollar[1].node } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3333 + //line php5/php5.y:3365 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6193,7 +6243,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3339 + //line php5/php5.y:3371 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6201,31 +6251,31 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3347 + //line php5/php5.y:3379 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3348 + //line php5/php5.y:3380 { yyVAL.node = yyDollar[1].node } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3349 + //line php5/php5.y:3381 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3355 + //line php5/php5.y:3387 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3357 + //line php5/php5.y:3389 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6237,13 +6287,13 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3367 + //line php5/php5.y:3399 { yyVAL.node = yyDollar[1].node } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3372 + //line php5/php5.y:3404 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6251,7 +6301,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3378 + //line php5/php5.y:3410 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6259,13 +6309,13 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3384 + //line php5/php5.y:3416 { yyVAL.node = yyDollar[1].node } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3390 + //line php5/php5.y:3422 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6277,7 +6327,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3400 + //line php5/php5.y:3432 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6285,25 +6335,25 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3409 + //line php5/php5.y:3441 { yyVAL.node = nil } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3411 + //line php5/php5.y:3443 { yyVAL.node = yyDollar[1].node } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3417 + //line php5/php5.y:3449 { yyVAL.list = yyDollar[1].list } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3419 + //line php5/php5.y:3451 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6312,7 +6362,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3429 + //line php5/php5.y:3461 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6321,7 +6371,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3436 + //line php5/php5.y:3468 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6330,7 +6380,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3443 + //line php5/php5.y:3475 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6339,7 +6389,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3453 + //line php5/php5.y:3485 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6347,13 +6397,13 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3459 + //line php5/php5.y:3491 { yyVAL.node = yyDollar[2].node } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3464 + //line php5/php5.y:3496 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6363,7 +6413,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3472 + //line php5/php5.y:3504 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6377,13 +6427,13 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3487 + //line php5/php5.y:3519 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3489 + //line php5/php5.y:3521 { if yyDollar[1].node == nil { yyVAL.list = []node.Node{} @@ -6393,7 +6443,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3501 + //line php5/php5.y:3533 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6401,7 +6451,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3507 + //line php5/php5.y:3539 { item := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6413,25 +6463,25 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3517 + //line php5/php5.y:3549 { yyVAL.node = nil } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3523 + //line php5/php5.y:3555 { yyVAL.list = []node.Node{} } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3525 + //line php5/php5.y:3557 { yyVAL.list = yyDollar[1].list } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3530 + //line php5/php5.y:3562 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -6441,7 +6491,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3538 + //line php5/php5.y:3570 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6451,7 +6501,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3546 + //line php5/php5.y:3578 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6461,7 +6511,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3554 + //line php5/php5.y:3586 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6471,7 +6521,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3562 + //line php5/php5.y:3594 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[6].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) @@ -6481,7 +6531,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3570 + //line php5/php5.y:3602 { arrayItem := expr.NewArrayItem(nil, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) @@ -6491,7 +6541,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3578 + //line php5/php5.y:3610 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -6501,7 +6551,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3586 + //line php5/php5.y:3618 { arrayItem := expr.NewArrayItem(nil, yyDollar[2].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6511,13 +6561,13 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3597 + //line php5/php5.y:3629 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3599 + //line php5/php5.y:3631 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6526,13 +6576,13 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3606 + //line php5/php5.y:3638 { yyVAL.list = []node.Node{yyDollar[1].node} } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3608 + //line php5/php5.y:3640 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6541,7 +6591,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3618 + //line php5/php5.y:3650 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6553,7 +6603,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3628 + //line php5/php5.y:3660 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6568,7 +6618,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3641 + //line php5/php5.y:3673 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6586,7 +6636,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3657 + //line php5/php5.y:3689 { yyVAL.node = yyDollar[2].node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6594,7 +6644,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3663 + //line php5/php5.y:3695 { identifier := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6609,13 +6659,13 @@ yydefault: } case 500: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3677 + //line php5/php5.y:3709 { yyVAL.node = yyDollar[2].node } case 501: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3682 + //line php5/php5.y:3714 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6623,7 +6673,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3688 + //line php5/php5.y:3720 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -6637,7 +6687,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3700 + //line php5/php5.y:3732 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6649,7 +6699,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3713 + //line php5/php5.y:3745 { yyVAL.node = expr.NewIsset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6657,7 +6707,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3719 + //line php5/php5.y:3751 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6665,7 +6715,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3725 + //line php5/php5.y:3757 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6673,7 +6723,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3731 + //line php5/php5.y:3763 { yyVAL.node = expr.NewInclude(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6681,7 +6731,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3737 + //line php5/php5.y:3769 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6689,7 +6739,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3743 + //line php5/php5.y:3775 { yyVAL.node = expr.NewEval(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6697,7 +6747,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3749 + //line php5/php5.y:3781 { yyVAL.node = expr.NewRequire(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6705,7 +6755,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3755 + //line php5/php5.y:3787 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6713,31 +6763,31 @@ yydefault: } case 512: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3764 + //line php5/php5.y:3796 { yyVAL.list = []node.Node{yyDollar[1].node} } case 513: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3766 + //line php5/php5.y:3798 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 514: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3771 + //line php5/php5.y:3803 { yyVAL.node = yyDollar[1].node } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3773 + //line php5/php5.y:3805 { yyVAL.node = yyDollar[1].node } case 516: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3778 + //line php5/php5.y:3810 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6749,7 +6799,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3788 + //line php5/php5.y:3820 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6761,7 +6811,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3801 + //line php5/php5.y:3833 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6773,7 +6823,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3814 + //line php5/php5.y:3846 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) diff --git a/php5/php5.y b/php5/php5.y index 6ea6dd3..52df78e 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -143,6 +143,29 @@ import ( %token T_COALESCE %token T_SPACESHIP %token T_NOELSE +%token T_PLUS_EQUAL +%token T_MINUS_EQUAL +%token T_MUL_EQUAL +%token T_POW_EQUAL +%token T_DIV_EQUAL +%token T_CONCAT_EQUAL +%token T_MOD_EQUAL +%token T_AND_EQUAL +%token T_OR_EQUAL +%token T_XOR_EQUAL +%token T_SL_EQUAL +%token T_SR_EQUAL +%token T_BOOLEAN_OR +%token T_BOOLEAN_AND +%token T_POW +%token T_SL +%token T_SR +%token T_IS_IDENTICAL +%token T_IS_NOT_IDENTICAL +%token T_IS_EQUAL +%token T_IS_NOT_EQUAL +%token T_IS_SMALLER_OR_EQUAL +%token T_IS_GREATER_OR_EQUAL %token '"' %token '`' %token '{' @@ -161,6 +184,15 @@ import ( %token '~' %token '@' %token '$' +%token ',' +%token '|' +%token '=' +%token '^' +%token '*' +%token '/' +%token '%' +%token '<' +%token '>' %left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE %left ',' diff --git a/php7/parser.go b/php7/parser.go index 67e5b59..4ca16d4 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -3,7 +3,6 @@ package php7 import ( "io" - "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/errors" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/parser" @@ -72,16 +71,6 @@ func (l *Parser) Parse() int { return yyParse(l) } -func (l *Parser) listGetFirstNodeComments(list []node.Node) []*comment.Comment { - if len(list) == 0 { - return nil - } - - node := list[0] - - return l.comments[node] -} - // GetPath return path to file func (l *Parser) GetPath() string { return l.path @@ -106,3 +95,19 @@ func (l *Parser) GetComments() parser.Comments { func (l *Parser) GetPositions() parser.Positions { return l.positions } + +// GetPositions returns positions list +func (l *Parser) setCommentsFromChildNode(n node.Node, c node.Node) { + l.comments.AddComments(n, l.comments[c]) + delete(l.comments, c) +} + +// helpers + +func lastNode(nn []node.Node) node.Node { + return nn[len(nn)-1] +} + +func firstNode(nn []node.Node) node.Node { + return nn[0] +} diff --git a/php7/php7.go b/php7/php7.go index da05aaf..3f7b6a8 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -148,26 +148,26 @@ const T_NOELSE = 57458 const T_PLUS_EQUAL = 57459 const T_MINUS_EQUAL = 57460 const T_MUL_EQUAL = 57461 -const T_DIV_EQUAL = 57462 -const T_CONCAT_EQUAL = 57463 -const T_MOD_EQUAL = 57464 -const T_AND_EQUAL = 57465 -const T_OR_EQUAL = 57466 -const T_XOR_EQUAL = 57467 -const T_SL_EQUAL = 57468 -const T_SR_EQUAL = 57469 -const T_POW_EQUAL = 57470 +const T_POW_EQUAL = 57462 +const T_DIV_EQUAL = 57463 +const T_CONCAT_EQUAL = 57464 +const T_MOD_EQUAL = 57465 +const T_AND_EQUAL = 57466 +const T_OR_EQUAL = 57467 +const T_XOR_EQUAL = 57468 +const T_SL_EQUAL = 57469 +const T_SR_EQUAL = 57470 const T_BOOLEAN_OR = 57471 const T_BOOLEAN_AND = 57472 -const T_IS_EQUAL = 57473 -const T_IS_NOT_EQUAL = 57474 -const T_IS_IDENTICAL = 57475 -const T_IS_NOT_IDENTICAL = 57476 -const T_IS_SMALLER_OR_EQUAL = 57477 -const T_IS_GREATER_OR_EQUAL = 57478 -const T_SL = 57479 -const T_SR = 57480 -const T_POW = 57481 +const T_POW = 57473 +const T_SL = 57474 +const T_SR = 57475 +const T_IS_IDENTICAL = 57476 +const T_IS_NOT_IDENTICAL = 57477 +const T_IS_EQUAL = 57478 +const T_IS_NOT_EQUAL = 57479 +const T_IS_SMALLER_OR_EQUAL = 57480 +const T_IS_GREATER_OR_EQUAL = 57481 var yyToknames = [...]string{ "$end", @@ -286,6 +286,29 @@ var yyToknames = [...]string{ "T_COALESCE", "T_SPACESHIP", "T_NOELSE", + "T_PLUS_EQUAL", + "T_MINUS_EQUAL", + "T_MUL_EQUAL", + "T_POW_EQUAL", + "T_DIV_EQUAL", + "T_CONCAT_EQUAL", + "T_MOD_EQUAL", + "T_AND_EQUAL", + "T_OR_EQUAL", + "T_XOR_EQUAL", + "T_SL_EQUAL", + "T_SR_EQUAL", + "T_BOOLEAN_OR", + "T_BOOLEAN_AND", + "T_POW", + "T_SL", + "T_SR", + "T_IS_IDENTICAL", + "T_IS_NOT_IDENTICAL", + "T_IS_EQUAL", + "T_IS_NOT_EQUAL", + "T_IS_SMALLER_OR_EQUAL", + "T_IS_GREATER_OR_EQUAL", "'\"'", "'`'", "'{'", @@ -305,38 +328,15 @@ var yyToknames = [...]string{ "'@'", "'$'", "','", - "'='", - "T_PLUS_EQUAL", - "T_MINUS_EQUAL", - "T_MUL_EQUAL", - "T_DIV_EQUAL", - "T_CONCAT_EQUAL", - "T_MOD_EQUAL", - "T_AND_EQUAL", - "T_OR_EQUAL", - "T_XOR_EQUAL", - "T_SL_EQUAL", - "T_SR_EQUAL", - "T_POW_EQUAL", - "T_BOOLEAN_OR", - "T_BOOLEAN_AND", "'|'", + "'='", "'^'", - "T_IS_EQUAL", - "T_IS_NOT_EQUAL", - "T_IS_IDENTICAL", - "T_IS_NOT_IDENTICAL", - "'<'", - "T_IS_SMALLER_OR_EQUAL", - "'>'", - "T_IS_GREATER_OR_EQUAL", - "T_SL", - "T_SR", - "'.'", "'*'", "'/'", "'%'", - "T_POW", + "'<'", + "'>'", + "'.'", } var yyStatenames = [...]string{} @@ -344,7 +344,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:2635 +//line php7/php7.y:4107 type foreachVariable struct { node node.Node @@ -377,18 +377,18 @@ var yyExca = [...]int{ -1, 44, 57, 422, 78, 422, - 119, 422, - 125, 422, + 142, 422, + 148, 422, -2, 417, -1, 48, - 123, 425, + 146, 425, -2, 434, -1, 84, 57, 424, 78, 424, - 119, 424, - 123, 427, - 125, 424, + 142, 424, + 146, 427, + 148, 424, -2, 412, -1, 107, 78, 385, @@ -396,127 +396,127 @@ var yyExca = [...]int{ -1, 229, 57, 422, 78, 422, - 119, 422, - 125, 422, + 142, 422, + 148, 422, -2, 313, -1, 232, - 123, 427, + 146, 427, -2, 424, -1, 235, 57, 422, 78, 422, - 119, 422, - 125, 422, + 142, 422, + 148, 422, -2, 315, -1, 354, 115, 0, - 153, 0, - 154, 0, - 155, 0, - 156, 0, + 134, 0, + 135, 0, + 136, 0, + 137, 0, -2, 337, -1, 355, 115, 0, - 153, 0, - 154, 0, - 155, 0, - 156, 0, + 134, 0, + 135, 0, + 136, 0, + 137, 0, -2, 338, -1, 356, 115, 0, - 153, 0, - 154, 0, - 155, 0, - 156, 0, + 134, 0, + 135, 0, + 136, 0, + 137, 0, -2, 339, -1, 357, 115, 0, - 153, 0, - 154, 0, - 155, 0, - 156, 0, + 134, 0, + 135, 0, + 136, 0, + 137, 0, -2, 340, -1, 358, - 157, 0, - 158, 0, - 159, 0, - 160, 0, + 138, 0, + 139, 0, + 165, 0, + 166, 0, -2, 341, -1, 359, - 157, 0, - 158, 0, - 159, 0, - 160, 0, + 138, 0, + 139, 0, + 165, 0, + 166, 0, -2, 342, -1, 360, - 157, 0, - 158, 0, - 159, 0, - 160, 0, + 138, 0, + 139, 0, + 165, 0, + 166, 0, -2, 343, -1, 361, - 157, 0, - 158, 0, - 159, 0, - 160, 0, + 138, 0, + 139, 0, + 165, 0, + 166, 0, -2, 344, -1, 362, 115, 0, - 153, 0, - 154, 0, - 155, 0, - 156, 0, + 134, 0, + 135, 0, + 136, 0, + 137, 0, -2, 345, -1, 369, - 124, 163, - 135, 163, + 147, 163, + 158, 163, -2, 422, -1, 413, - 124, 462, - 126, 462, - 135, 462, + 147, 462, + 149, 462, + 158, 462, -2, 422, -1, 417, 57, 423, 78, 423, - 119, 423, - 123, 426, - 125, 423, + 142, 423, + 146, 426, + 148, 423, -2, 347, -1, 431, - 123, 448, + 146, 448, -2, 415, -1, 432, - 123, 450, + 146, 450, -2, 440, -1, 511, - 123, 448, + 146, 448, -2, 416, -1, 512, - 123, 450, + 146, 450, -2, 441, -1, 571, - 124, 213, + 147, 213, -2, 218, -1, 596, - 123, 426, + 146, 426, -2, 423, -1, 648, - 124, 213, + 147, 213, -2, 218, -1, 653, - 124, 183, + 147, 183, -2, 422, -1, 661, - 124, 213, + 147, 213, -2, 218, -1, 686, - 124, 461, - 126, 461, - 135, 461, + 147, 461, + 149, 461, + 158, 461, -2, 422, -1, 719, - 124, 184, + 147, 184, -2, 422, -1, 739, 12, 265, @@ -527,10 +527,10 @@ var yyExca = [...]int{ 95, 208, -2, 0, -1, 778, - 124, 183, + 147, 183, -2, 422, -1, 780, - 124, 186, + 147, 186, -2, 396, -1, 800, 93, 209, @@ -541,7 +541,7 @@ var yyExca = [...]int{ 31, 199, 32, 199, 33, 199, - 120, 199, + 143, 199, -2, 0, -1, 882, 29, 76, @@ -550,16 +550,16 @@ var yyExca = [...]int{ 31, 198, 32, 198, 33, 198, - 120, 198, + 143, 198, -2, 0, -1, 914, - 124, 213, + 147, 213, -2, 218, } const yyPrivate = 57344 -const yyLast = 7331 +const yyLast = 7805 var yyAct = [...]int{ @@ -571,143 +571,199 @@ var yyAct = [...]int{ 132, 189, 8, 225, 228, 128, 143, 236, 237, 238, 239, 240, 147, 2, 241, 242, 243, 244, 245, 246, 247, 127, 250, 125, 513, 258, 259, 260, 315, 314, - 137, 7, 6, 430, 264, 165, 854, 870, 864, 273, - 274, 892, 276, 277, 842, 684, 841, 269, 230, 230, - 82, 868, 893, 140, 141, 835, 179, 406, 832, 105, - 677, 541, 590, 568, 335, 869, 331, 334, 309, 254, - 105, 111, 833, 677, 308, 302, 329, 759, 336, 307, - 332, 301, 319, 115, 121, 704, 324, 325, 84, 728, - 330, 44, 306, 308, 626, 302, 621, 105, 566, 285, - 287, 190, 556, 411, 337, 338, 339, 340, 341, 342, + 137, 7, 6, 430, 264, 870, 864, 684, 835, 273, + 274, 854, 276, 277, 842, 590, 841, 269, 230, 230, + 82, 334, 309, 140, 141, 406, 892, 105, 868, 832, + 677, 541, 335, 568, 331, 329, 307, 893, 677, 254, + 759, 111, 869, 833, 308, 302, 336, 704, 332, 330, + 308, 301, 319, 115, 121, 728, 324, 325, 84, 626, + 621, 44, 306, 105, 566, 302, 556, 411, 105, 285, + 287, 190, 862, 730, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, - 295, 364, 366, 165, 370, 321, 266, 372, 730, 780, - 219, 269, 862, 232, 232, 693, 229, 235, 333, 79, - 424, 380, 388, 390, 391, 392, 393, 394, 395, 396, - 397, 398, 399, 400, 401, 689, 407, 402, 138, 404, - 179, 225, 610, 261, 144, 855, 230, 283, 179, 384, - 597, 106, 415, 606, 290, 225, 292, 600, 607, 603, - 601, 299, 106, 585, 305, 410, 926, 409, 888, 820, - 138, 819, 218, 809, 826, 801, 371, 425, 217, 163, - 162, 416, 138, 784, 363, 773, 431, 511, 423, 106, - 230, 727, 523, 524, 717, 698, 525, 179, 696, 688, - 266, 650, 638, 628, 529, 270, 598, 533, 117, 225, - 589, 168, 169, 161, 164, 166, 167, 165, 403, 291, - 914, 230, 164, 166, 167, 165, 284, 828, 863, 782, - 551, 813, 812, 920, 720, 535, 163, 162, 687, 661, - 306, 232, 648, 646, 369, 286, 647, 5, 571, 554, - 418, 552, 414, 385, 383, 561, 288, 151, 669, 670, - 560, 9, 429, 520, 275, 8, 272, 510, 518, 271, - 161, 164, 166, 167, 165, 249, 602, 134, 538, 220, - 112, 117, 216, 105, 550, 232, 564, 184, 413, 519, - 289, 183, 420, 421, 7, 6, 544, 182, 136, 270, - 135, 131, 570, 562, 580, 113, 581, 558, 577, 582, - 583, 575, 751, 387, 579, 559, 232, 188, 420, 427, - 421, 421, 420, 268, 903, 668, 179, 294, 588, 293, - 517, 902, 225, 592, 887, 225, 516, 850, 930, 408, - 929, 821, 543, 815, 546, 572, 157, 156, 179, 609, - 134, 808, 765, 112, 612, 752, 768, 769, 768, 769, - 716, 595, 714, 712, 710, 163, 162, 587, 707, 233, - 555, 540, 181, 178, 537, 738, 591, 386, 740, 120, - 374, 328, 432, 512, 327, 180, 159, 163, 162, 326, - 296, 909, 611, 174, 175, 176, 177, 168, 169, 161, - 164, 166, 167, 165, 844, 106, 807, 153, 154, 158, - 160, 172, 173, 170, 171, 174, 175, 176, 177, 168, - 169, 161, 164, 166, 167, 165, 214, 215, 804, 745, - 746, 747, 744, 743, 742, 802, 761, 138, 616, 738, - 536, 117, 740, 105, 814, 608, 767, 886, 859, 110, - 144, 883, 117, 536, 857, 627, 803, 536, 201, 202, - 203, 204, 206, 207, 208, 209, 210, 211, 212, 213, - 205, 620, 613, 790, 783, 642, 324, 644, 637, 617, - 733, 625, 676, 536, 649, 306, 576, 634, 619, 185, - 5, 109, 419, 745, 746, 747, 744, 743, 742, 298, - 673, 789, 674, 671, 9, 640, 579, 255, 8, 643, - 134, 685, 422, 112, 304, 865, 304, 615, 117, 117, - 658, 105, 196, 197, 114, 651, 114, 289, 691, 233, - 230, 230, 672, 198, 200, 199, 681, 7, 6, 117, - 906, 117, 523, 253, 117, 123, 124, 533, 515, 702, - 191, 117, 263, 304, 231, 262, 234, 230, 718, 574, - 379, 116, 636, 708, 304, 106, 630, 289, 382, 631, - 701, 256, 257, 715, 304, 705, 634, 225, 904, 695, - 671, 722, 703, 699, 697, 46, 726, 546, 134, 546, - 122, 112, 547, 671, 706, 786, 713, 77, 78, 732, - 671, 669, 670, 721, 753, 754, 549, 233, 225, 749, - 134, 545, 528, 112, 748, 255, 300, 542, 230, 146, - 134, 731, 757, 112, 192, 232, 232, 303, 369, 653, - 750, 324, 255, 905, 755, 614, 320, 422, 408, 618, - 690, 225, 701, 106, 634, 894, 762, 280, 281, 794, - 758, 829, 232, 760, 148, 686, 763, 724, 725, 777, - 671, 770, 255, 772, 766, 117, 797, 779, 798, 775, - 579, 791, 546, 800, 787, 796, 795, 546, 546, 256, - 257, 148, 230, 745, 746, 747, 744, 743, 742, 810, - 117, 635, 123, 124, 604, 527, 256, 257, 818, 805, - 129, 816, 768, 769, 119, 824, 146, 548, 827, 536, - 806, 377, 817, 232, 823, 375, 719, 1, 195, 255, - 194, 834, 193, 845, 278, 526, 256, 257, 830, 639, - 187, 255, 38, 849, 739, 736, 422, 771, 768, 769, - 851, 843, 737, 381, 546, 255, 546, 848, 663, 531, - 282, 222, 521, 860, 853, 367, 867, 738, 671, 255, - 740, 846, 858, 871, 252, 873, 880, 866, 839, 884, - 885, 775, 145, 792, 879, 142, 323, 232, 149, 890, - 778, 891, 279, 256, 257, 895, 836, 889, 660, 822, - 251, 898, 840, 645, 896, 256, 257, 880, 899, 928, - 224, 546, 897, 43, 901, 879, 42, 16, 908, 256, - 257, 745, 746, 747, 744, 743, 742, 15, 599, 912, - 267, 49, 48, 256, 257, 913, 108, 50, 83, 81, - 919, 922, 915, 831, 918, 917, 579, 72, 248, 923, - 62, 265, 924, 61, 878, 877, 671, 876, 875, 927, - 735, 4, 931, 88, 89, 70, 47, 93, 94, 36, - 45, 105, 665, 27, 723, 657, 310, 110, 26, 18, - 17, 118, 19, 297, 30, 3, 31, 435, 788, 20, - 729, 0, 0, 21, 22, 35, 37, 13, 23, 33, + 295, 364, 366, 219, 370, 321, 266, 372, 780, 693, + 689, 269, 610, 232, 232, 606, 229, 235, 333, 79, + 607, 380, 388, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 401, 597, 585, 402, 138, 404, + 424, 225, 179, 410, 144, 600, 230, 603, 601, 384, + 261, 926, 415, 888, 290, 225, 292, 407, 855, 820, + 179, 299, 826, 819, 305, 809, 801, 409, 518, 784, + 138, 773, 106, 727, 717, 698, 371, 425, 696, 688, + 650, 416, 138, 165, 363, 638, 431, 511, 218, 519, + 230, 628, 523, 524, 217, 598, 525, 589, 283, 914, + 266, 165, 168, 169, 529, 270, 291, 533, 106, 225, + 117, 863, 105, 106, 164, 166, 167, 828, 403, 813, + 812, 230, 163, 162, 782, 720, 284, 687, 661, 289, + 551, 423, 164, 166, 167, 535, 648, 161, 286, 646, + 306, 232, 647, 751, 369, 571, 554, 5, 552, 414, + 418, 385, 268, 517, 383, 561, 288, 151, 275, 516, + 560, 9, 429, 520, 179, 8, 272, 510, 271, 249, + 220, 216, 184, 183, 117, 182, 105, 136, 538, 134, + 135, 387, 112, 131, 550, 232, 564, 602, 413, 294, + 113, 293, 420, 421, 7, 6, 544, 188, 233, 270, + 920, 903, 570, 562, 580, 165, 581, 558, 577, 582, + 583, 575, 768, 769, 579, 559, 232, 902, 420, 427, + 421, 421, 420, 930, 887, 929, 163, 162, 588, 850, + 821, 179, 225, 592, 815, 225, 164, 166, 167, 408, + 808, 161, 543, 134, 546, 572, 112, 768, 769, 609, + 765, 752, 716, 714, 612, 712, 710, 106, 707, 555, + 540, 595, 233, 537, 386, 374, 328, 587, 155, 157, + 156, 179, 165, 168, 169, 327, 591, 326, 296, 175, + 177, 117, 432, 512, 536, 844, 807, 804, 802, 761, + 536, 536, 611, 163, 162, 181, 178, 608, 909, 886, + 859, 117, 536, 164, 166, 167, 174, 176, 161, 857, + 153, 154, 165, 168, 169, 170, 171, 172, 173, 175, + 177, 106, 179, 814, 803, 813, 812, 790, 783, 733, + 255, 180, 159, 163, 162, 422, 676, 138, 616, 576, + 158, 185, 160, 164, 166, 167, 174, 176, 161, 419, + 144, 669, 670, 114, 165, 627, 253, 304, 767, 198, + 200, 199, 789, 165, 114, 120, 304, 191, 196, 197, + 134, 620, 613, 112, 117, 642, 324, 644, 637, 617, + 304, 625, 117, 117, 649, 306, 304, 634, 619, 289, + 5, 304, 906, 718, 256, 257, 574, 515, 263, 117, + 673, 262, 674, 671, 9, 640, 579, 379, 8, 643, + 289, 685, 904, 116, 77, 78, 702, 615, 382, 631, + 658, 786, 636, 630, 146, 651, 123, 124, 691, 905, + 230, 230, 672, 549, 547, 320, 681, 7, 6, 542, + 690, 668, 523, 134, 303, 894, 112, 533, 117, 46, + 105, 255, 724, 725, 545, 300, 110, 230, 528, 794, + 280, 281, 829, 708, 745, 746, 747, 744, 743, 742, + 701, 122, 148, 715, 117, 705, 634, 225, 148, 695, + 671, 722, 703, 699, 697, 298, 726, 546, 192, 546, + 796, 795, 117, 671, 706, 604, 713, 146, 109, 732, + 671, 123, 124, 721, 753, 754, 635, 117, 225, 749, + 816, 768, 769, 129, 748, 256, 257, 134, 230, 119, + 112, 731, 757, 548, 536, 232, 232, 255, 369, 653, + 750, 324, 422, 377, 755, 614, 233, 255, 408, 618, + 375, 225, 701, 195, 634, 194, 762, 771, 768, 769, + 758, 193, 232, 760, 187, 686, 763, 669, 670, 777, + 671, 770, 1, 772, 766, 845, 797, 779, 798, 775, + 579, 791, 546, 800, 787, 639, 134, 546, 546, 112, + 38, 739, 230, 736, 231, 737, 234, 381, 663, 810, + 527, 256, 257, 531, 738, 106, 222, 740, 818, 805, + 526, 256, 257, 521, 860, 824, 367, 873, 827, 145, + 806, 792, 817, 232, 823, 142, 719, 323, 149, 255, + 836, 834, 660, 822, 278, 255, 251, 840, 830, 645, + 422, 255, 928, 849, 224, 43, 282, 42, 16, 15, + 851, 843, 599, 267, 546, 49, 546, 848, 745, 746, + 747, 744, 743, 742, 853, 48, 867, 108, 671, 255, + 50, 846, 858, 871, 252, 83, 880, 866, 839, 884, + 885, 775, 81, 72, 879, 248, 62, 232, 265, 890, + 778, 891, 279, 256, 257, 895, 61, 889, 878, 256, + 257, 898, 877, 883, 896, 256, 257, 880, 899, 876, + 875, 546, 897, 735, 901, 879, 45, 665, 908, 723, + 657, 310, 118, 297, 3, 435, 788, 729, 0, 912, + 0, 0, 0, 256, 257, 913, 0, 0, 0, 0, + 919, 922, 915, 0, 918, 917, 579, 0, 0, 923, + 0, 0, 924, 0, 0, 0, 671, 0, 0, 927, + 0, 4, 931, 88, 89, 70, 47, 93, 94, 36, + 0, 105, 0, 27, 0, 0, 0, 110, 26, 18, + 17, 0, 19, 0, 30, 0, 31, 0, 0, 20, + 0, 0, 0, 21, 22, 35, 37, 13, 23, 33, 0, 0, 34, 12, 0, 24, 0, 29, 86, 87, 10, 39, 40, 41, 0, 0, 0, 0, 51, 109, - 0, 102, 98, 99, 100, 95, 96, 0, 0, 0, - 0, 0, 0, 103, 0, 0, 0, 0, 11, 101, + 0, 102, 98, 99, 100, 95, 96, 738, 0, 0, + 740, 0, 0, 103, 0, 0, 0, 0, 11, 101, 97, 112, 0, 90, 91, 92, 0, 0, 0, 0, 85, 53, 0, 0, 0, 74, 75, 25, 77, 78, 0, 0, 0, 54, 55, 76, 63, 64, 65, 66, - 67, 68, 69, 0, 0, 0, 104, 73, 14, 629, - 32, 0, 60, 0, 52, 0, 0, 0, 57, 56, - 58, 59, 71, 106, 4, 0, 88, 89, 70, 47, - 93, 94, 36, 0, 105, 0, 27, 0, 0, 0, - 110, 26, 18, 17, 0, 19, 0, 30, 0, 31, - 0, 0, 20, 0, 0, 0, 21, 22, 35, 37, - 13, 23, 33, 0, 0, 34, 12, 0, 24, 0, - 29, 86, 87, 10, 39, 40, 41, 0, 0, 0, - 0, 51, 109, 0, 102, 98, 99, 100, 95, 96, - 0, 0, 0, 0, 0, 0, 103, 0, 0, 0, - 0, 11, 101, 97, 112, 0, 90, 91, 92, 0, - 0, 0, 0, 85, 53, 0, 0, 0, 74, 75, - 25, 77, 78, 0, 0, 0, 54, 55, 76, 63, - 64, 65, 66, 67, 68, 69, 0, 0, 0, 104, - 73, 14, 539, 32, 0, 60, 0, 52, 0, 0, + 67, 68, 69, 0, 214, 215, 0, 0, 0, 0, + 0, 745, 746, 747, 744, 743, 742, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 104, + 73, 14, 629, 32, 0, 60, 0, 52, 0, 0, 0, 57, 56, 58, 59, 71, 106, 4, 0, 88, - 89, 70, 47, 93, 94, 36, 0, 105, 0, 27, - 0, 0, 0, 110, 26, 18, 17, 0, 19, 0, + 89, 70, 47, 93, 94, 36, 865, 105, 0, 27, + 201, 0, 0, 110, 26, 18, 17, 0, 19, 0, 30, 0, 31, 0, 0, 20, 0, 0, 0, 21, 22, 35, 37, 13, 23, 33, 0, 0, 34, 12, 0, 24, 0, 29, 86, 87, 10, 39, 40, 41, 0, 0, 0, 0, 51, 109, 0, 102, 98, 99, - 100, 95, 96, 0, 0, 0, 0, 0, 0, 103, + 100, 95, 96, 738, 0, 0, 740, 0, 0, 103, 0, 0, 0, 0, 11, 101, 97, 112, 0, 90, 91, 92, 0, 0, 0, 0, 85, 53, 0, 0, 0, 74, 75, 25, 77, 78, 0, 0, 0, 54, 55, 76, 63, 64, 65, 66, 67, 68, 69, 0, - 0, 0, 104, 73, 14, 0, 32, 0, 60, 0, - 52, 0, 0, 0, 57, 56, 58, 59, 71, 106, - 312, 0, 88, 89, 70, 47, 93, 94, 36, 0, - 105, 0, 27, 0, 0, 0, 110, 26, 18, 17, - 0, 19, 0, 30, 0, 31, 0, 0, 20, 0, - 0, 0, 21, 22, 35, 37, 0, 23, 33, 0, - 0, 34, 0, 0, 24, 0, 29, 86, 87, 318, - 39, 40, 41, 0, 0, 0, 0, 51, 109, 0, - 102, 98, 99, 100, 95, 96, 0, 0, 0, 0, - 0, 0, 103, 0, 0, 0, 0, 134, 101, 97, - 112, 0, 90, 91, 92, 0, 0, 0, 0, 85, - 53, 0, 0, 0, 74, 75, 25, 77, 78, 0, - 0, 0, 54, 55, 76, 63, 64, 65, 66, 67, - 68, 69, 0, 0, 0, 104, 73, 14, 932, 32, + 0, 0, 0, 0, 0, 0, 0, 745, 746, 747, + 744, 743, 742, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 104, 73, 14, 539, 32, + 0, 60, 0, 52, 0, 0, 0, 57, 56, 58, + 59, 71, 106, 4, 0, 88, 89, 70, 47, 93, + 94, 36, 831, 105, 0, 27, 0, 0, 0, 110, + 26, 18, 17, 0, 19, 0, 30, 0, 31, 0, + 0, 20, 0, 0, 0, 21, 22, 35, 37, 13, + 23, 33, 0, 0, 34, 12, 0, 24, 0, 29, + 86, 87, 10, 39, 40, 41, 0, 0, 0, 0, + 51, 109, 0, 102, 98, 99, 100, 95, 96, 738, + 0, 0, 740, 0, 0, 103, 0, 0, 0, 0, + 11, 101, 97, 112, 0, 90, 91, 92, 0, 0, + 0, 0, 85, 53, 0, 0, 0, 74, 75, 25, + 77, 78, 0, 0, 0, 54, 55, 76, 63, 64, + 65, 66, 67, 68, 69, 0, 0, 0, 0, 0, + 0, 0, 0, 745, 746, 747, 744, 743, 742, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 104, 73, 14, 0, 32, 0, 60, 0, 52, + 0, 0, 0, 57, 56, 58, 59, 71, 106, 312, + 0, 88, 89, 70, 47, 93, 94, 36, 799, 105, + 0, 27, 0, 0, 0, 110, 26, 18, 17, 0, + 19, 0, 30, 0, 31, 0, 0, 20, 0, 0, + 0, 21, 22, 35, 37, 0, 23, 33, 0, 0, + 34, 0, 0, 24, 0, 29, 86, 87, 318, 39, + 40, 41, 0, 0, 0, 0, 51, 109, 0, 102, + 98, 99, 100, 95, 96, 738, 0, 0, 740, 0, + 0, 103, 0, 0, 0, 0, 134, 101, 97, 112, + 0, 90, 91, 92, 0, 0, 0, 0, 85, 53, + 0, 0, 0, 74, 75, 25, 77, 78, 0, 0, + 0, 54, 55, 76, 63, 64, 65, 66, 67, 68, + 69, 0, 0, 0, 0, 0, 0, 0, 0, 745, + 746, 747, 744, 743, 742, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 104, 73, 14, + 932, 32, 0, 60, 0, 52, 0, 0, 0, 57, + 56, 58, 59, 71, 106, 312, 0, 88, 89, 70, + 47, 93, 94, 36, 734, 105, 0, 27, 0, 0, + 0, 110, 26, 18, 17, 0, 19, 0, 30, 0, + 31, 0, 0, 20, 0, 0, 0, 21, 22, 35, + 37, 0, 23, 33, 0, 0, 34, 0, 0, 24, + 0, 29, 86, 87, 318, 39, 40, 41, 0, 0, + 0, 0, 51, 109, 0, 102, 98, 99, 100, 95, + 96, 0, 0, 0, 0, 0, 0, 103, 0, 0, + 0, 0, 134, 101, 97, 112, 0, 90, 91, 92, + 0, 0, 0, 0, 85, 53, 0, 0, 0, 74, + 75, 25, 77, 78, 0, 0, 0, 54, 55, 76, + 63, 64, 65, 66, 67, 68, 69, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 104, 73, 14, 925, 32, 0, 60, + 0, 52, 0, 0, 0, 57, 56, 58, 59, 71, + 106, 312, 0, 88, 89, 70, 47, 93, 94, 36, + 0, 105, 0, 27, 0, 0, 0, 110, 26, 18, + 17, 0, 19, 0, 30, 0, 31, 0, 0, 20, + 0, 0, 0, 21, 22, 35, 37, 0, 23, 33, + 0, 0, 34, 0, 0, 24, 0, 29, 86, 87, + 318, 39, 40, 41, 0, 0, 0, 0, 51, 109, + 0, 102, 98, 99, 100, 95, 96, 0, 0, 0, + 0, 0, 0, 103, 0, 0, 0, 0, 134, 101, + 97, 112, 0, 90, 91, 92, 0, 0, 0, 0, + 85, 53, 0, 0, 0, 74, 75, 25, 77, 78, + 0, 0, 0, 54, 55, 76, 63, 64, 65, 66, + 67, 68, 69, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 104, + 73, 14, 921, 32, 0, 60, 0, 52, 0, 0, + 0, 57, 56, 58, 59, 71, 106, 312, 0, 88, + 89, 70, 47, 93, 94, 36, 0, 105, 0, 27, + 0, 0, 0, 110, 26, 18, 17, 0, 19, 0, + 30, 0, 31, 0, 0, 20, 0, 0, 0, 21, + 22, 35, 37, 0, 23, 33, 0, 0, 34, 0, + 0, 24, 0, 29, 86, 87, 318, 39, 40, 41, + 0, 0, 0, 0, 51, 109, 0, 102, 98, 99, + 100, 95, 96, 0, 0, 0, 0, 0, 0, 103, + 0, 0, 0, 0, 134, 101, 97, 112, 0, 90, + 91, 92, 0, 0, 0, 0, 85, 53, 0, 0, + 0, 74, 75, 25, 77, 78, 0, 0, 0, 54, + 55, 76, 63, 64, 65, 66, 67, 68, 69, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 104, 73, 14, 911, 32, 0, 60, 0, 52, 0, 0, 0, 57, 56, 58, 59, 71, 106, 312, 0, 88, 89, 70, 47, 93, 94, 36, 0, 105, 0, 27, 0, 0, 0, 110, @@ -720,25 +776,14 @@ var yyAct = [...]int{ 134, 101, 97, 112, 0, 90, 91, 92, 0, 0, 0, 0, 85, 53, 0, 0, 0, 74, 75, 25, 77, 78, 0, 0, 0, 54, 55, 76, 63, 64, - 65, 66, 67, 68, 69, 0, 0, 0, 104, 73, - 14, 925, 32, 0, 60, 0, 52, 0, 0, 0, - 57, 56, 58, 59, 71, 106, 312, 0, 88, 89, - 70, 47, 93, 94, 36, 0, 105, 0, 27, 0, - 0, 0, 110, 26, 18, 17, 0, 19, 0, 30, - 0, 31, 0, 0, 20, 0, 0, 0, 21, 22, - 35, 37, 0, 23, 33, 0, 0, 34, 0, 0, - 24, 0, 29, 86, 87, 318, 39, 40, 41, 0, - 0, 0, 0, 51, 109, 0, 102, 98, 99, 100, - 95, 96, 0, 0, 0, 0, 0, 0, 103, 0, - 0, 0, 0, 134, 101, 97, 112, 0, 90, 91, - 92, 0, 0, 0, 0, 85, 53, 0, 0, 0, - 74, 75, 25, 77, 78, 0, 0, 0, 54, 55, - 76, 63, 64, 65, 66, 67, 68, 69, 0, 0, - 0, 104, 73, 14, 921, 32, 0, 60, 0, 52, + 65, 66, 67, 68, 69, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 104, 73, 14, 910, 32, 0, 60, 0, 52, 0, 0, 0, 57, 56, 58, 59, 71, 106, 312, 0, 88, 89, 70, 47, 93, 94, 36, 0, 105, 0, 27, 0, 0, 0, 110, 26, 18, 17, 0, - 19, 0, 30, 0, 31, 0, 0, 20, 0, 0, + 19, 907, 30, 0, 31, 0, 0, 20, 0, 0, 0, 21, 22, 35, 37, 0, 23, 33, 0, 0, 34, 0, 0, 24, 0, 29, 86, 87, 318, 39, 40, 41, 0, 0, 0, 0, 51, 109, 0, 102, @@ -747,24 +792,13 @@ var yyAct = [...]int{ 0, 90, 91, 92, 0, 0, 0, 0, 85, 53, 0, 0, 0, 74, 75, 25, 77, 78, 0, 0, 0, 54, 55, 76, 63, 64, 65, 66, 67, 68, - 69, 0, 0, 0, 104, 73, 14, 911, 32, 0, - 60, 0, 52, 0, 0, 0, 57, 56, 58, 59, - 71, 106, 312, 0, 88, 89, 70, 47, 93, 94, - 36, 0, 105, 0, 27, 0, 0, 0, 110, 26, - 18, 17, 0, 19, 0, 30, 0, 31, 0, 0, - 20, 0, 0, 0, 21, 22, 35, 37, 0, 23, - 33, 0, 0, 34, 0, 0, 24, 0, 29, 86, - 87, 318, 39, 40, 41, 0, 0, 0, 0, 51, - 109, 0, 102, 98, 99, 100, 95, 96, 0, 0, - 0, 0, 0, 0, 103, 0, 0, 0, 0, 134, - 101, 97, 112, 0, 90, 91, 92, 0, 0, 0, - 0, 85, 53, 0, 0, 0, 74, 75, 25, 77, - 78, 0, 0, 0, 54, 55, 76, 63, 64, 65, - 66, 67, 68, 69, 0, 0, 0, 104, 73, 14, - 910, 32, 0, 60, 0, 52, 0, 0, 0, 57, + 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 104, 73, 14, + 0, 32, 0, 60, 0, 52, 0, 0, 0, 57, 56, 58, 59, 71, 106, 312, 0, 88, 89, 70, 47, 93, 94, 36, 0, 105, 0, 27, 0, 0, - 0, 110, 26, 18, 17, 0, 19, 907, 30, 0, + 0, 110, 26, 18, 17, 0, 19, 0, 30, 0, 31, 0, 0, 20, 0, 0, 0, 21, 22, 35, 37, 0, 23, 33, 0, 0, 34, 0, 0, 24, 0, 29, 86, 87, 318, 39, 40, 41, 0, 0, @@ -774,19 +808,8 @@ var yyAct = [...]int{ 0, 0, 0, 0, 85, 53, 0, 0, 0, 74, 75, 25, 77, 78, 0, 0, 0, 54, 55, 76, 63, 64, 65, 66, 67, 68, 69, 0, 0, 0, - 104, 73, 14, 0, 32, 0, 60, 0, 52, 0, - 0, 0, 57, 56, 58, 59, 71, 106, 312, 0, - 88, 89, 70, 47, 93, 94, 36, 0, 105, 0, - 27, 0, 0, 0, 110, 26, 18, 17, 0, 19, - 0, 30, 0, 31, 0, 0, 20, 0, 0, 0, - 21, 22, 35, 37, 0, 23, 33, 0, 0, 34, - 0, 0, 24, 0, 29, 86, 87, 318, 39, 40, - 41, 0, 0, 0, 0, 51, 109, 0, 102, 98, - 99, 100, 95, 96, 0, 0, 0, 0, 0, 0, - 103, 0, 0, 0, 0, 134, 101, 97, 112, 0, - 90, 91, 92, 0, 0, 0, 0, 85, 53, 0, - 0, 0, 74, 75, 25, 77, 78, 0, 0, 0, - 54, 55, 76, 63, 64, 65, 66, 67, 68, 69, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104, 73, 14, 856, 32, 0, 60, 0, 52, 0, 0, 0, 57, 56, 58, 59, 71, 106, 312, 0, 88, 89, 70, 47, 93, 94, 36, @@ -800,25 +823,14 @@ var yyAct = [...]int{ 97, 112, 0, 90, 91, 92, 0, 0, 0, 0, 85, 53, 0, 0, 0, 74, 75, 25, 77, 78, 0, 0, 0, 54, 55, 76, 63, 64, 65, 66, - 67, 68, 69, 0, 0, 0, 104, 73, 14, 0, - 32, 0, 60, 0, 52, 0, 0, 0, 57, 56, - 58, 59, 71, 106, 312, 0, 88, 89, 70, 47, - 93, 94, 36, 0, 105, 0, 27, 0, 0, 0, - 110, 26, 18, 17, 0, 19, 0, 30, 0, 31, - 781, 0, 20, 0, 0, 0, 21, 22, 35, 37, - 0, 23, 33, 0, 0, 34, 0, 0, 24, 0, - 29, 86, 87, 318, 39, 40, 41, 0, 0, 0, - 0, 51, 109, 0, 102, 98, 99, 100, 95, 96, - 0, 0, 0, 0, 0, 0, 103, 0, 0, 0, - 0, 134, 101, 97, 112, 0, 90, 91, 92, 0, - 0, 0, 0, 85, 53, 0, 0, 0, 74, 75, - 25, 77, 78, 0, 0, 0, 54, 55, 76, 63, - 64, 65, 66, 67, 68, 69, 0, 0, 0, 104, + 67, 68, 69, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 104, 73, 14, 0, 32, 0, 60, 0, 52, 0, 0, 0, 57, 56, 58, 59, 71, 106, 312, 0, 88, 89, 70, 47, 93, 94, 36, 0, 105, 0, 27, - 0, 0, 0, 110, 26, 18, 17, 764, 19, 0, - 30, 0, 31, 0, 0, 20, 0, 0, 0, 21, + 0, 0, 0, 110, 26, 18, 17, 0, 19, 0, + 30, 0, 31, 781, 0, 20, 0, 0, 0, 21, 22, 35, 37, 0, 23, 33, 0, 0, 34, 0, 0, 24, 0, 29, 86, 87, 318, 39, 40, 41, 0, 0, 0, 0, 51, 109, 0, 102, 98, 99, @@ -827,24 +839,13 @@ var yyAct = [...]int{ 91, 92, 0, 0, 0, 0, 85, 53, 0, 0, 0, 74, 75, 25, 77, 78, 0, 0, 0, 54, 55, 76, 63, 64, 65, 66, 67, 68, 69, 0, - 0, 0, 104, 73, 14, 0, 32, 0, 60, 0, - 52, 0, 0, 0, 57, 56, 58, 59, 71, 106, - 312, 0, 88, 89, 70, 47, 93, 94, 36, 0, - 105, 0, 27, 0, 0, 0, 110, 26, 18, 17, - 0, 19, 0, 30, 0, 31, 0, 0, 20, 0, - 0, 0, 21, 22, 35, 37, 0, 23, 33, 0, - 0, 34, 0, 0, 24, 0, 29, 86, 87, 318, - 39, 40, 41, 0, 0, 0, 0, 51, 109, 0, - 102, 98, 99, 100, 95, 96, 0, 0, 0, 0, - 0, 0, 103, 0, 0, 0, 0, 134, 101, 97, - 112, 0, 90, 91, 92, 0, 0, 0, 0, 85, - 53, 0, 0, 680, 74, 75, 25, 77, 78, 0, - 0, 0, 54, 55, 76, 63, 64, 65, 66, 67, - 68, 69, 0, 0, 0, 104, 73, 14, 0, 32, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 104, 73, 14, 0, 32, 0, 60, 0, 52, 0, 0, 0, 57, 56, 58, 59, 71, 106, 312, 0, 88, 89, 70, 47, 93, 94, 36, 0, 105, 0, 27, 0, 0, 0, 110, - 26, 18, 17, 0, 19, 0, 30, 0, 31, 0, + 26, 18, 17, 764, 19, 0, 30, 0, 31, 0, 0, 20, 0, 0, 0, 21, 22, 35, 37, 0, 23, 33, 0, 0, 34, 0, 0, 24, 0, 29, 86, 87, 318, 39, 40, 41, 0, 0, 0, 0, @@ -853,21 +854,10 @@ var yyAct = [...]int{ 134, 101, 97, 112, 0, 90, 91, 92, 0, 0, 0, 0, 85, 53, 0, 0, 0, 74, 75, 25, 77, 78, 0, 0, 0, 54, 55, 76, 63, 64, - 65, 66, 67, 68, 69, 0, 0, 0, 104, 73, - 14, 569, 32, 0, 60, 0, 52, 0, 0, 0, - 57, 56, 58, 59, 71, 106, 312, 0, 88, 89, - 70, 47, 93, 94, 36, 0, 105, 0, 27, 0, - 0, 0, 110, 26, 18, 17, 0, 19, 0, 30, - 0, 31, 0, 0, 20, 0, 0, 0, 21, 22, - 35, 37, 0, 23, 33, 0, 0, 34, 0, 0, - 24, 0, 29, 86, 87, 318, 39, 40, 41, 0, - 0, 0, 0, 51, 109, 0, 102, 98, 99, 100, - 95, 96, 0, 0, 0, 0, 0, 0, 103, 0, - 0, 0, 0, 134, 101, 97, 112, 0, 90, 91, - 92, 0, 0, 0, 0, 85, 53, 0, 0, 0, - 74, 75, 25, 77, 78, 0, 0, 0, 54, 55, - 76, 63, 64, 65, 66, 67, 68, 69, 0, 0, - 0, 104, 73, 14, 311, 32, 0, 60, 0, 52, + 65, 66, 67, 68, 69, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 104, 73, 14, 0, 32, 0, 60, 0, 52, 0, 0, 0, 57, 56, 58, 59, 71, 106, 312, 0, 88, 89, 70, 47, 93, 94, 36, 0, 105, 0, 27, 0, 0, 0, 110, 26, 18, 17, 0, @@ -878,59 +868,84 @@ var yyAct = [...]int{ 98, 99, 100, 95, 96, 0, 0, 0, 0, 0, 0, 103, 0, 0, 0, 0, 134, 101, 97, 112, 0, 90, 91, 92, 0, 0, 0, 0, 85, 53, - 0, 0, 0, 74, 75, 25, 77, 78, 0, 0, + 0, 0, 680, 74, 75, 25, 77, 78, 0, 0, 0, 54, 55, 76, 63, 64, 65, 66, 67, 68, - 69, 0, 0, 0, 104, 73, 14, 0, 32, 0, - 60, 0, 52, 0, 0, 0, 57, 56, 58, 59, - 71, 106, 443, 444, 454, 455, 0, 0, 434, 0, - 105, 0, 0, 0, 0, 0, 0, 459, 460, 461, - 462, 463, 464, 465, 466, 467, 468, 469, 489, 490, - 491, 492, 493, 481, 482, 483, 484, 485, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 0, - 501, 499, 500, 496, 497, 0, 0, 488, 494, 495, - 502, 503, 505, 504, 506, 507, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 498, 509, 508, - 0, 0, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 456, 457, 458, 486, 487, 437, 438, 439, 440, - 441, 442, 0, 0, 88, 89, 70, 47, 93, 94, - 36, 0, 105, 0, 27, 0, 0, 433, 110, 26, - 18, 17, 0, 19, 0, 30, 0, 31, 0, 0, - 20, 0, 106, 0, 21, 22, 35, 133, 0, 23, - 33, 0, 0, 34, 0, 0, 24, 0, 29, 86, - 87, 0, 0, 0, 0, 0, 0, 0, 0, 51, - 109, 0, 102, 98, 99, 100, 95, 96, 0, 0, - 0, 0, 0, 0, 103, 0, 0, 0, 0, 134, - 101, 97, 112, 0, 90, 91, 92, 0, 0, 0, - 0, 85, 53, 0, 0, 0, 74, 75, 25, 0, - 0, 0, 0, 0, 54, 55, 76, 63, 64, 65, - 66, 67, 68, 69, 0, 0, 0, 104, 73, 14, - 0, 32, 776, 60, 0, 52, 0, 0, 0, 57, - 56, 58, 59, 71, 106, 88, 89, 70, 47, 93, - 94, 36, 0, 105, 0, 27, 0, 0, 0, 110, - 26, 18, 17, 0, 19, 0, 30, 0, 31, 0, - 0, 20, 0, 0, 0, 21, 22, 35, 133, 0, - 23, 33, 0, 0, 34, 0, 0, 24, 0, 29, - 86, 87, 0, 0, 0, 0, 0, 0, 0, 0, - 51, 109, 0, 102, 98, 99, 100, 95, 96, 0, - 0, 0, 0, 0, 0, 103, 0, 0, 0, 0, - 134, 101, 97, 112, 0, 90, 91, 92, 0, 0, - 0, 0, 85, 53, 0, 0, 0, 74, 75, 25, - 0, 0, 0, 0, 0, 54, 55, 76, 63, 64, - 65, 66, 67, 68, 69, 0, 0, 0, 104, 73, - 14, 0, 32, 847, 60, 0, 52, 0, 0, 0, - 57, 56, 58, 59, 71, 106, 88, 89, 70, 47, - 93, 94, 36, 0, 105, 0, 27, 0, 0, 0, - 110, 26, 18, 17, 0, 19, 0, 30, 0, 31, - 0, 0, 20, 0, 0, 0, 21, 22, 35, 133, - 0, 23, 33, 0, 0, 34, 0, 0, 24, 0, - 29, 86, 87, 0, 0, 0, 0, 0, 0, 0, - 0, 51, 109, 0, 102, 98, 99, 100, 95, 96, - 0, 0, 0, 0, 0, 0, 103, 0, 0, 0, - 0, 134, 101, 97, 112, 0, 90, 91, 92, 0, - 0, 0, 0, 85, 53, 0, 0, 0, 74, 75, - 25, 0, 0, 0, 0, 0, 54, 55, 76, 63, - 64, 65, 66, 67, 68, 69, 0, 0, 0, 104, - 73, 14, 0, 32, 682, 60, 0, 52, 0, 0, + 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 104, 73, 14, + 0, 32, 0, 60, 0, 52, 0, 0, 0, 57, + 56, 58, 59, 71, 106, 312, 0, 88, 89, 70, + 47, 93, 94, 36, 0, 105, 0, 27, 0, 0, + 0, 110, 26, 18, 17, 0, 19, 0, 30, 0, + 31, 0, 0, 20, 0, 0, 0, 21, 22, 35, + 37, 0, 23, 33, 0, 0, 34, 0, 0, 24, + 0, 29, 86, 87, 318, 39, 40, 41, 0, 0, + 0, 0, 51, 109, 0, 102, 98, 99, 100, 95, + 96, 0, 0, 0, 0, 0, 0, 103, 0, 0, + 0, 0, 134, 101, 97, 112, 0, 90, 91, 92, + 0, 0, 0, 0, 85, 53, 0, 0, 0, 74, + 75, 25, 77, 78, 0, 0, 0, 54, 55, 76, + 63, 64, 65, 66, 67, 68, 69, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 104, 73, 14, 569, 32, 0, 60, + 0, 52, 0, 0, 0, 57, 56, 58, 59, 71, + 106, 312, 0, 88, 89, 70, 47, 93, 94, 36, + 0, 105, 0, 27, 0, 0, 0, 110, 26, 18, + 17, 0, 19, 0, 30, 0, 31, 0, 0, 20, + 0, 0, 0, 21, 22, 35, 37, 0, 23, 33, + 0, 0, 34, 0, 0, 24, 0, 29, 86, 87, + 318, 39, 40, 41, 0, 0, 0, 0, 51, 109, + 0, 102, 98, 99, 100, 95, 96, 0, 0, 0, + 0, 0, 0, 103, 0, 0, 0, 0, 134, 101, + 97, 112, 0, 90, 91, 92, 0, 0, 0, 0, + 85, 53, 0, 0, 0, 74, 75, 25, 77, 78, + 0, 0, 0, 54, 55, 76, 63, 64, 65, 66, + 67, 68, 69, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 104, + 73, 14, 311, 32, 0, 60, 0, 52, 0, 0, + 0, 57, 56, 58, 59, 71, 106, 312, 0, 88, + 89, 70, 47, 93, 94, 36, 0, 105, 0, 27, + 0, 0, 0, 110, 26, 18, 17, 0, 19, 0, + 30, 0, 31, 0, 0, 20, 0, 0, 0, 21, + 22, 35, 37, 0, 23, 33, 0, 0, 34, 0, + 0, 24, 0, 29, 86, 87, 318, 39, 40, 41, + 0, 0, 0, 0, 51, 109, 0, 102, 98, 99, + 100, 95, 96, 0, 0, 0, 0, 0, 0, 103, + 0, 0, 0, 0, 134, 101, 97, 112, 0, 90, + 91, 92, 0, 0, 0, 0, 85, 53, 0, 0, + 0, 74, 75, 25, 77, 78, 0, 0, 0, 54, + 55, 76, 63, 64, 65, 66, 67, 68, 69, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 104, 73, 14, 0, 32, + 0, 60, 0, 52, 0, 0, 0, 57, 56, 58, + 59, 71, 106, 443, 444, 454, 455, 0, 0, 434, + 0, 105, 0, 0, 0, 0, 0, 0, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 489, + 490, 491, 492, 493, 481, 482, 483, 484, 485, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 0, 501, 499, 500, 496, 497, 0, 0, 488, 494, + 495, 502, 503, 505, 504, 506, 507, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 498, 509, + 508, 0, 0, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 456, 457, 458, 486, 487, 437, 438, 439, + 440, 441, 442, 88, 89, 70, 47, 93, 94, 36, + 0, 105, 0, 27, 0, 0, 0, 110, 26, 18, + 17, 0, 19, 0, 30, 0, 31, 0, 0, 20, + 0, 0, 0, 21, 22, 35, 133, 0, 23, 33, + 0, 433, 34, 0, 0, 24, 0, 29, 86, 87, + 0, 0, 0, 0, 0, 0, 106, 0, 51, 109, + 0, 102, 98, 99, 100, 95, 96, 0, 0, 0, + 0, 0, 0, 103, 0, 0, 0, 0, 134, 101, + 97, 112, 0, 90, 91, 92, 0, 0, 0, 0, + 85, 53, 0, 0, 0, 74, 75, 25, 0, 0, + 0, 0, 0, 54, 55, 76, 63, 64, 65, 66, + 67, 68, 69, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 104, + 73, 14, 0, 32, 776, 60, 0, 52, 0, 0, 0, 57, 56, 58, 59, 71, 106, 88, 89, 70, 47, 93, 94, 36, 0, 105, 0, 27, 0, 0, 0, 110, 26, 18, 17, 0, 19, 0, 30, 0, @@ -943,20 +958,40 @@ var yyAct = [...]int{ 0, 0, 0, 0, 85, 53, 0, 0, 0, 74, 75, 25, 0, 0, 0, 0, 0, 54, 55, 76, 63, 64, 65, 66, 67, 68, 69, 0, 0, 0, - 104, 73, 14, 0, 32, 659, 60, 0, 52, 0, - 0, 0, 57, 56, 58, 59, 71, 106, 88, 89, - 70, 47, 93, 94, 36, 0, 105, 0, 27, 0, - 0, 0, 110, 26, 18, 17, 0, 19, 0, 30, - 0, 31, 0, 0, 20, 0, 0, 0, 21, 22, - 35, 133, 0, 23, 33, 0, 0, 34, 0, 0, - 24, 0, 29, 86, 87, 0, 0, 0, 0, 0, - 0, 0, 0, 51, 109, 0, 102, 98, 99, 100, - 95, 96, 0, 0, 0, 0, 0, 0, 103, 0, - 0, 0, 0, 134, 101, 97, 112, 0, 90, 91, - 92, 0, 0, 0, 0, 85, 53, 0, 0, 0, - 74, 75, 25, 0, 0, 0, 0, 0, 54, 55, - 76, 63, 64, 65, 66, 67, 68, 69, 0, 0, - 0, 104, 73, 14, 0, 32, 641, 60, 0, 52, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 104, 73, 14, 0, 32, 847, 60, + 0, 52, 0, 0, 0, 57, 56, 58, 59, 71, + 106, 88, 89, 70, 47, 93, 94, 36, 0, 105, + 0, 27, 0, 0, 0, 110, 26, 18, 17, 0, + 19, 0, 30, 0, 31, 0, 0, 20, 0, 0, + 0, 21, 22, 35, 133, 0, 23, 33, 0, 0, + 34, 0, 0, 24, 0, 29, 86, 87, 0, 0, + 0, 0, 0, 0, 0, 0, 51, 109, 0, 102, + 98, 99, 100, 95, 96, 0, 0, 0, 0, 0, + 0, 103, 0, 0, 0, 0, 134, 101, 97, 112, + 0, 90, 91, 92, 0, 0, 0, 0, 85, 53, + 0, 0, 0, 74, 75, 25, 0, 0, 0, 0, + 0, 54, 55, 76, 63, 64, 65, 66, 67, 68, + 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 104, 73, 14, + 0, 32, 682, 60, 0, 52, 0, 0, 0, 57, + 56, 58, 59, 71, 106, 88, 89, 70, 47, 93, + 94, 36, 0, 105, 0, 27, 0, 0, 0, 110, + 26, 18, 17, 0, 19, 0, 30, 0, 31, 0, + 0, 20, 0, 0, 0, 21, 22, 35, 133, 0, + 23, 33, 0, 0, 34, 0, 0, 24, 0, 29, + 86, 87, 0, 0, 0, 0, 0, 0, 0, 0, + 51, 109, 0, 102, 98, 99, 100, 95, 96, 0, + 0, 0, 0, 0, 0, 103, 0, 0, 0, 0, + 134, 101, 97, 112, 0, 90, 91, 92, 0, 0, + 0, 0, 85, 53, 0, 0, 0, 74, 75, 25, + 0, 0, 0, 0, 0, 54, 55, 76, 63, 64, + 65, 66, 67, 68, 69, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 104, 73, 14, 0, 32, 659, 60, 0, 52, 0, 0, 0, 57, 56, 58, 59, 71, 106, 88, 89, 70, 47, 93, 94, 36, 0, 105, 0, 27, 0, 0, 0, 110, 26, 18, 17, 0, 19, 0, @@ -965,145 +1000,30 @@ var yyAct = [...]int{ 0, 24, 0, 29, 86, 87, 0, 0, 0, 0, 0, 0, 0, 0, 51, 109, 0, 102, 98, 99, 100, 95, 96, 0, 0, 0, 0, 0, 0, 103, - 0, 179, 0, 0, 134, 101, 97, 112, 0, 90, + 0, 0, 0, 0, 134, 101, 97, 112, 0, 90, 91, 92, 0, 0, 0, 0, 85, 53, 0, 0, - 0, 74, 75, 25, 0, 0, 178, 0, 0, 54, - 55, 76, 63, 64, 65, 66, 67, 68, 69, 159, - 163, 162, 104, 73, 14, 0, 32, 0, 60, 0, - 52, 0, 0, 0, 57, 56, 58, 59, 71, 106, - 155, 157, 156, 179, 172, 173, 170, 171, 174, 175, - 176, 177, 168, 169, 161, 164, 166, 167, 165, 0, - 0, 0, 0, 0, 0, 0, 0, 181, 178, 738, - 0, 0, 740, 0, 813, 812, 0, 0, 0, 0, - 180, 159, 163, 162, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 155, 157, 156, 179, 0, 0, - 0, 0, 153, 154, 158, 160, 172, 173, 170, 171, - 174, 175, 176, 177, 168, 169, 161, 164, 166, 167, - 165, 181, 178, 745, 746, 747, 744, 743, 742, 0, - 0, 0, 0, 756, 180, 159, 163, 162, 0, 0, - 0, 0, 0, 0, 0, 799, 0, 0, 155, 157, - 156, 179, 0, 0, 0, 0, 153, 154, 158, 160, - 172, 173, 170, 171, 174, 175, 176, 177, 168, 169, - 161, 164, 166, 167, 165, 181, 178, 0, 0, 0, - 0, 0, 0, 0, 0, 709, 0, 0, 180, 159, - 163, 162, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 155, 157, 156, 179, 0, 0, 0, 0, - 153, 154, 158, 160, 172, 173, 170, 171, 174, 175, - 176, 177, 168, 169, 161, 164, 166, 167, 165, 181, - 178, 0, 0, 0, 0, 694, 0, 0, 0, 0, - 0, 0, 180, 159, 163, 162, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 155, 157, 156, 179, - 0, 0, 0, 0, 153, 154, 158, 160, 172, 173, - 170, 171, 174, 175, 176, 177, 168, 169, 161, 164, - 166, 167, 165, 181, 178, 0, 0, 0, 0, 692, - 0, 0, 0, 0, 0, 0, 180, 159, 163, 162, + 0, 74, 75, 25, 0, 0, 0, 0, 0, 54, + 55, 76, 63, 64, 65, 66, 67, 68, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 155, 157, 156, 179, 0, 0, 0, 0, 153, 154, - 158, 160, 172, 173, 170, 171, 174, 175, 176, 177, - 168, 169, 161, 164, 166, 167, 165, 181, 178, 738, - 0, 0, 740, 683, 0, 0, 0, 0, 0, 0, - 180, 159, 163, 162, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 155, 157, 156, 179, 0, 0, - 0, 0, 153, 154, 158, 160, 172, 173, 170, 171, - 174, 175, 176, 177, 168, 169, 161, 164, 166, 167, - 165, 181, 178, 745, 746, 747, 744, 743, 742, 0, - 0, 679, 0, 0, 180, 159, 163, 162, 0, 0, - 0, 0, 0, 0, 0, 734, 0, 0, 155, 157, - 156, 179, 0, 0, 0, 0, 153, 154, 158, 160, - 172, 173, 170, 171, 174, 175, 176, 177, 168, 169, - 161, 164, 166, 167, 165, 181, 178, 0, 0, 0, - 0, 0, 0, 0, 0, 678, 0, 0, 180, 159, - 163, 162, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 155, 157, 156, 179, 0, 0, 0, 0, - 153, 154, 158, 160, 172, 173, 170, 171, 174, 175, - 176, 177, 168, 169, 161, 164, 166, 167, 165, 181, - 178, 0, 0, 0, 0, 624, 0, 0, 0, 0, - 0, 0, 180, 159, 163, 162, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 155, 157, 156, 179, - 0, 0, 0, 0, 153, 154, 158, 160, 172, 173, - 170, 171, 174, 175, 176, 177, 168, 169, 161, 164, - 166, 167, 165, 181, 178, 0, 0, 0, 0, 0, - 0, 0, 0, 623, 0, 0, 180, 159, 163, 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 155, 157, 156, 179, 0, 0, 0, 0, 153, 154, - 158, 160, 172, 173, 170, 171, 174, 175, 176, 177, - 168, 169, 161, 164, 166, 167, 165, 181, 178, 0, - 0, 0, 0, 0, 0, 0, 0, 622, 0, 0, - 180, 159, 163, 162, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 155, 157, 156, 179, 0, 0, - 0, 0, 153, 154, 158, 160, 172, 173, 170, 171, - 174, 175, 176, 177, 168, 169, 161, 164, 166, 167, - 165, 181, 178, 0, 0, 0, 0, 605, 0, 0, - 0, 0, 0, 0, 180, 159, 163, 162, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 155, 157, - 156, 179, 0, 0, 0, 0, 153, 154, 158, 160, - 172, 173, 170, 171, 174, 175, 176, 177, 168, 169, - 161, 164, 166, 167, 165, 181, 178, 0, 0, 0, - 0, 0, 0, 0, 0, 596, 0, 0, 180, 159, - 163, 162, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 155, 157, 156, 179, 0, 0, 0, 0, - 153, 154, 158, 160, 172, 173, 170, 171, 174, 175, - 176, 177, 168, 169, 161, 164, 166, 167, 165, 181, - 178, 0, 0, 0, 0, 586, 0, 0, 0, 0, - 0, 0, 180, 159, 163, 162, 0, 0, 0, 0, - 0, 0, 567, 0, 0, 0, 155, 157, 156, 179, - 0, 0, 0, 0, 153, 154, 158, 160, 172, 173, - 170, 171, 174, 175, 176, 177, 168, 169, 161, 164, - 166, 167, 165, 181, 178, 0, 0, 0, 0, 0, - 0, 0, 0, 584, 0, 0, 180, 159, 163, 162, + 0, 0, 0, 0, 0, 104, 73, 14, 0, 32, + 641, 60, 0, 52, 0, 0, 0, 57, 56, 58, + 59, 71, 106, 88, 89, 70, 47, 93, 94, 36, + 0, 105, 0, 27, 0, 0, 0, 110, 26, 18, + 17, 0, 19, 0, 30, 0, 31, 0, 0, 20, + 0, 0, 0, 21, 22, 35, 133, 0, 23, 33, + 0, 0, 34, 0, 0, 24, 0, 29, 86, 87, + 0, 0, 0, 0, 0, 0, 0, 0, 51, 109, + 0, 102, 98, 99, 100, 95, 96, 0, 0, 0, + 0, 0, 0, 103, 0, 0, 0, 0, 134, 101, + 97, 112, 0, 90, 91, 92, 0, 0, 0, 0, + 85, 53, 0, 0, 0, 74, 75, 25, 0, 0, + 0, 0, 0, 54, 55, 76, 63, 64, 65, 66, + 67, 68, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 155, 157, 156, 179, 0, 0, 0, 0, 153, 154, - 158, 160, 172, 173, 170, 171, 174, 175, 176, 177, - 168, 169, 161, 164, 166, 167, 165, 181, 178, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 180, 159, 163, 162, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 155, 157, 156, 179, 0, 0, - 0, 0, 153, 154, 158, 160, 172, 173, 170, 171, - 174, 175, 176, 177, 168, 169, 161, 164, 166, 167, - 165, 181, 178, 0, 0, 0, 0, 0, 0, 563, - 0, 0, 0, 0, 180, 159, 163, 162, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 155, 157, - 156, 179, 0, 0, 0, 0, 153, 154, 158, 160, - 172, 173, 170, 171, 174, 175, 176, 177, 168, 169, - 161, 164, 166, 167, 165, 181, 178, 0, 0, 0, - 0, 0, 0, 0, 0, 557, 0, 0, 180, 159, - 163, 162, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 155, 157, 156, 179, 0, 0, 0, 0, - 153, 154, 158, 160, 172, 173, 170, 171, 174, 175, - 176, 177, 168, 169, 161, 164, 166, 167, 165, 181, - 178, 0, 0, 0, 0, 0, 0, 0, 0, 553, - 0, 0, 180, 159, 163, 162, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 155, 157, 156, 179, - 0, 0, 0, 0, 153, 154, 158, 160, 172, 173, - 170, 171, 174, 175, 176, 177, 168, 169, 161, 164, - 166, 167, 165, 181, 178, 412, 0, 0, 0, 0, - 0, 0, 0, 417, 0, 0, 180, 159, 163, 162, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 155, 157, 156, 179, 153, 154, - 158, 160, 172, 173, 170, 171, 174, 175, 176, 177, - 168, 169, 161, 164, 166, 167, 165, 0, 0, 0, - 0, 181, 178, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 180, 159, 163, 162, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 155, 157, - 156, 179, 0, 0, 0, 0, 153, 154, 158, 160, - 172, 173, 170, 171, 174, 175, 176, 177, 168, 169, - 161, 164, 166, 167, 165, 181, 178, 0, 0, 0, - 0, 0, 373, 0, 0, 0, 0, 0, 180, 159, - 163, 162, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 155, 157, 156, 179, 0, 0, 0, 0, - 153, 154, 158, 160, 172, 173, 170, 171, 174, 175, - 176, 177, 168, 169, 161, 164, 166, 167, 165, 181, - 178, 0, 0, 0, 0, 0, 152, 0, 0, 0, - 0, 0, 180, 159, 163, 162, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 155, 157, 156, 179, - 0, 0, 0, 0, 153, 154, 158, 160, 172, 173, - 170, 171, 174, 175, 176, 177, 168, 169, 161, 164, - 166, 167, 165, 181, 178, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 180, 159, 163, 162, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 153, 154, - 158, 160, 172, 173, 170, 171, 174, 175, 176, 177, - 168, 169, 161, 164, 166, 167, 165, 443, 444, 454, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 104, + 73, 14, 0, 32, 0, 60, 0, 52, 0, 0, + 0, 57, 56, 58, 59, 71, 106, 443, 444, 454, 455, 0, 0, 882, 0, 0, 0, 0, 0, 0, 0, 0, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 489, 490, 491, 492, 493, 481, 482, @@ -1113,237 +1033,364 @@ var yyAct = [...]int{ 507, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 881, 509, 508, 112, 0, 445, 446, 447, 448, 449, 450, 451, 452, 453, 456, 457, 458, 486, - 487, 437, 438, 439, 440, 441, 442, 0, 0, 443, - 444, 454, 455, 0, 0, 882, 0, 0, 0, 0, - 0, 0, 0, 900, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 489, 490, 491, 492, 493, - 481, 482, 483, 484, 485, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 0, 501, 499, 500, - 496, 497, 0, 0, 488, 494, 495, 502, 503, 505, - 504, 506, 507, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 881, 509, 508, 112, 0, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 456, 457, - 458, 486, 487, 437, 438, 439, 440, 441, 442, 156, - 179, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 872, 0, 0, 0, 0, - 0, 0, 428, 0, 181, 178, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 180, 159, 163, - 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 179, 0, 0, 0, 0, 153, - 154, 158, 160, 172, 173, 170, 171, 174, 175, 176, - 177, 168, 169, 161, 164, 166, 167, 165, 181, 178, + 487, 437, 438, 439, 440, 441, 442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 180, 159, 163, 162, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 179, 0, - 0, 0, 0, 153, 154, 158, 160, 172, 173, 170, - 171, 174, 175, 176, 177, 168, 169, 161, 164, 166, - 167, 165, 181, 178, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 180, 159, 163, 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 179, 0, 0, 0, 0, 153, 154, 158, - 160, 172, 173, 170, 171, 174, 175, 176, 177, 168, - 169, 161, 164, 166, 167, 165, 181, 178, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 159, 163, 162, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 179, 0, 0, 0, 0, - 0, 153, 154, 158, 160, 172, 173, 170, 171, 174, - 175, 176, 177, 168, 169, 161, 164, 166, 167, 165, - 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 159, 163, 162, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 179, 0, - 0, 0, 0, 0, 0, 154, 158, 160, 172, 173, - 170, 171, 174, 175, 176, 177, 168, 169, 161, 164, - 166, 167, 165, 178, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 159, 163, 162, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 179, 0, 0, 0, 0, 0, 0, 0, 158, - 160, 172, 173, 170, 171, 174, 175, 176, 177, 168, - 169, 161, 164, 166, 167, 165, 178, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 159, - 163, 162, 0, 0, 0, 0, 88, 89, 70, 0, - 93, 94, 117, 0, 105, 0, 0, 0, 0, 0, - 110, 0, 0, 160, 172, 173, 170, 171, 174, 175, - 176, 177, 168, 169, 161, 164, 166, 167, 165, 133, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 86, 87, 0, 0, 0, 0, 0, 0, 0, - 0, 51, 109, 0, 102, 98, 99, 100, 95, 96, - 0, 0, 0, 0, 0, 0, 103, 0, 0, 0, - 0, 134, 101, 97, 112, 534, 90, 91, 92, 0, - 0, 0, 0, 85, 53, 0, 0, 0, 74, 75, - 139, 0, 0, 0, 0, 0, 54, 55, 76, 63, - 64, 65, 66, 67, 68, 69, 0, 0, 0, 104, - 73, 0, 0, 0, 0, 60, 530, 52, 0, 0, - 0, 57, 56, 58, 59, 71, 106, 88, 89, 70, - 0, 93, 94, 117, 0, 105, 0, 0, 0, 0, - 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 133, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 86, 87, 0, 0, 0, 0, 0, 0, - 0, 0, 227, 109, 0, 102, 98, 99, 100, 95, - 96, 0, 0, 0, 0, 0, 0, 103, 0, 0, - 0, 0, 134, 101, 97, 112, 0, 90, 91, 92, - 0, 0, 0, 0, 85, 53, 0, 0, 0, 74, - 75, 139, 0, 0, 0, 0, 0, 54, 55, 76, - 63, 64, 65, 66, 67, 68, 69, 0, 0, 0, - 104, 73, 0, 0, 0, 0, 60, 0, 52, 0, - 0, 226, 57, 56, 58, 59, 71, 106, 88, 89, - 70, 0, 93, 94, 117, 0, 105, 0, 0, 0, - 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 133, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 86, 87, 0, 0, 0, 0, 0, - 0, 0, 0, 51, 109, 0, 102, 98, 99, 100, - 95, 96, 0, 0, 0, 0, 0, 0, 103, 0, - 0, 0, 0, 134, 101, 97, 112, 534, 90, 91, - 92, 0, 0, 0, 0, 85, 53, 0, 0, 0, - 74, 75, 139, 0, 0, 0, 0, 0, 54, 55, - 76, 63, 64, 65, 66, 67, 68, 69, 0, 0, - 0, 104, 73, 0, 0, 0, 0, 60, 0, 52, - 0, 0, 0, 57, 56, 58, 59, 71, 106, 88, - 89, 70, 0, 93, 94, 117, 0, 105, 0, 0, - 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 133, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 86, 87, 0, 0, 0, 0, - 0, 0, 0, 0, 594, 109, 0, 102, 98, 99, - 100, 95, 96, 0, 0, 0, 0, 0, 0, 103, - 0, 0, 0, 0, 134, 101, 97, 112, 0, 90, - 91, 92, 0, 0, 0, 0, 85, 53, 0, 0, - 0, 74, 75, 139, 0, 0, 0, 0, 0, 54, - 55, 76, 63, 64, 65, 66, 67, 68, 69, 0, - 0, 0, 104, 73, 0, 0, 0, 0, 60, 0, - 52, 0, 0, 593, 57, 56, 58, 59, 71, 106, - 88, 89, 70, 0, 93, 94, 117, 426, 105, 0, - 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 133, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 86, 87, 0, 0, 0, - 0, 0, 0, 0, 0, 51, 109, 0, 102, 98, - 99, 100, 95, 96, 0, 0, 0, 0, 0, 0, - 103, 0, 0, 0, 0, 134, 101, 97, 112, 0, - 90, 91, 92, 0, 0, 0, 0, 85, 53, 0, - 0, 0, 74, 75, 139, 0, 0, 0, 0, 0, - 54, 55, 76, 63, 64, 65, 66, 67, 68, 69, - 0, 0, 0, 104, 73, 0, 0, 0, 0, 60, - 0, 52, 0, 0, 0, 57, 56, 58, 59, 71, - 106, 88, 89, 70, 0, 93, 94, 117, 0, 105, - 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 133, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 86, 87, 0, 0, - 0, 0, 0, 0, 0, 0, 51, 109, 0, 102, - 98, 99, 100, 95, 96, 0, 0, 0, 0, 0, - 0, 103, 0, 0, 0, 0, 134, 101, 97, 112, - 0, 90, 91, 92, 0, 0, 0, 0, 85, 53, - 0, 0, 0, 74, 75, 139, 0, 0, 0, 0, - 0, 54, 55, 76, 63, 64, 65, 66, 67, 68, - 69, 0, 0, 0, 104, 73, 0, 0, 0, 0, - 60, 0, 52, 0, 0, 389, 57, 56, 58, 59, - 71, 106, 88, 89, 70, 0, 93, 94, 117, 0, - 105, 0, 0, 0, 0, 0, 110, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 133, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 86, 87, 0, - 0, 0, 0, 0, 0, 0, 0, 51, 109, 0, - 102, 98, 99, 100, 95, 96, 0, 0, 0, 0, - 0, 0, 103, 0, 0, 0, 0, 134, 101, 97, - 112, 0, 90, 91, 92, 0, 0, 0, 0, 85, - 53, 0, 0, 0, 74, 75, 139, 0, 0, 0, - 0, 0, 54, 55, 76, 63, 64, 65, 66, 67, - 68, 69, 0, 0, 0, 104, 73, 0, 0, 0, - 365, 60, 0, 52, 0, 0, 0, 57, 56, 58, - 59, 71, 106, 88, 89, 70, 0, 93, 94, 117, - 0, 105, 0, 0, 0, 0, 0, 110, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 133, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 86, 87, - 0, 0, 0, 0, 0, 0, 0, 0, 51, 109, - 0, 102, 98, 99, 100, 95, 96, 0, 0, 0, - 0, 0, 0, 103, 179, 0, 0, 0, 134, 101, - 97, 112, 0, 90, 91, 92, 0, 0, 0, 0, - 85, 53, 0, 0, 0, 74, 75, 139, 0, 178, - 0, 0, 0, 54, 55, 76, 63, 64, 65, 66, - 67, 68, 69, 163, 162, 0, 104, 73, 0, 0, - 0, 0, 60, 0, 52, 0, 0, 0, 57, 56, - 58, 59, 71, 106, 0, 0, 0, 172, 173, 170, - 171, 174, 175, 176, 177, 168, 169, 161, 164, 166, - 167, 165, 443, 444, 454, 455, 0, 0, 434, 0, - 0, 0, 0, 0, 0, 0, 0, 459, 460, 461, + 0, 0, 443, 444, 454, 455, 0, 0, 882, 0, + 0, 0, 0, 0, 0, 0, 900, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 489, 490, 491, 492, 493, 481, 482, 483, 484, 485, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 0, 501, 499, 500, 496, 497, 0, 0, 488, 494, 495, 502, 503, 505, 504, 506, 507, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 498, 509, 508, - 0, 0, 445, 446, 447, 448, 449, 450, 451, 452, + 0, 0, 0, 0, 0, 0, 0, 881, 509, 508, + 112, 0, 445, 446, 447, 448, 449, 450, 451, 452, 453, 456, 457, 458, 486, 487, 437, 438, 439, 440, - 441, 442, 443, 444, 454, 455, 0, 0, 916, 0, - 0, 0, 0, 0, 0, 0, 0, 459, 460, 461, - 462, 463, 464, 465, 466, 467, 468, 469, 489, 490, - 491, 492, 493, 481, 482, 483, 484, 485, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 0, - 501, 499, 500, 496, 497, 0, 0, 488, 494, 495, - 502, 503, 505, 504, 506, 507, 117, 0, 105, 0, - 0, 0, 0, 0, 110, 0, 0, 498, 509, 508, - 0, 0, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 456, 457, 458, 486, 487, 745, 746, 747, 744, - 743, 742, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 655, 109, 0, 0, 0, + 441, 442, 88, 89, 70, 0, 93, 94, 117, 0, + 105, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 134, 0, 0, 112, 0, + 0, 0, 0, 0, 0, 133, 0, 0, 0, 0, + 0, 872, 0, 0, 0, 0, 0, 86, 87, 0, + 0, 0, 0, 0, 0, 0, 0, 51, 109, 0, + 102, 98, 99, 100, 95, 96, 0, 0, 0, 0, + 0, 0, 103, 0, 0, 0, 0, 134, 101, 97, + 112, 534, 90, 91, 92, 0, 0, 0, 0, 85, + 53, 0, 0, 0, 74, 75, 139, 0, 0, 0, + 0, 0, 54, 55, 76, 63, 64, 65, 66, 67, + 68, 69, 0, 0, 88, 89, 70, 0, 93, 94, + 117, 0, 105, 0, 0, 0, 0, 0, 110, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 104, 73, + 0, 0, 0, 0, 60, 530, 52, 133, 0, 0, + 57, 56, 58, 59, 71, 106, 0, 0, 0, 86, + 87, 0, 0, 0, 0, 0, 0, 0, 0, 227, + 109, 0, 102, 98, 99, 100, 95, 96, 0, 0, + 0, 0, 0, 0, 103, 0, 0, 0, 0, 134, + 101, 97, 112, 0, 90, 91, 92, 0, 0, 0, + 0, 85, 53, 0, 0, 0, 74, 75, 139, 0, + 0, 0, 0, 0, 54, 55, 76, 63, 64, 65, + 66, 67, 68, 69, 88, 89, 70, 0, 93, 94, + 117, 0, 105, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 233, 0, 0, 0, 0, 0, + 104, 73, 0, 0, 0, 0, 60, 133, 52, 0, + 0, 226, 57, 56, 58, 59, 71, 106, 0, 86, + 87, 0, 0, 0, 0, 0, 0, 0, 0, 51, + 109, 0, 102, 98, 99, 100, 95, 96, 0, 0, + 0, 0, 0, 0, 103, 0, 0, 0, 0, 134, + 101, 97, 112, 534, 90, 91, 92, 0, 0, 0, + 0, 85, 53, 0, 0, 0, 74, 75, 139, 0, + 0, 0, 0, 0, 54, 55, 76, 63, 64, 65, + 66, 67, 68, 69, 88, 89, 70, 0, 93, 94, + 117, 0, 105, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, - 0, 656, 0, 0, 654, 0, 0, 0, 0, 0, - 106, + 104, 73, 0, 0, 0, 0, 60, 133, 52, 0, + 0, 0, 57, 56, 58, 59, 71, 106, 0, 86, + 87, 0, 0, 0, 0, 0, 0, 0, 0, 594, + 109, 0, 102, 98, 99, 100, 95, 96, 0, 0, + 0, 0, 0, 0, 103, 0, 0, 0, 0, 134, + 101, 97, 112, 0, 90, 91, 92, 0, 0, 0, + 0, 85, 53, 0, 0, 0, 74, 75, 139, 0, + 0, 0, 0, 0, 54, 55, 76, 63, 64, 65, + 66, 67, 68, 69, 88, 89, 70, 0, 93, 94, + 117, 426, 105, 0, 0, 0, 0, 0, 110, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 104, 73, 0, 0, 0, 0, 60, 133, 52, 0, + 0, 593, 57, 56, 58, 59, 71, 106, 0, 86, + 87, 0, 0, 0, 0, 0, 0, 0, 0, 51, + 109, 0, 102, 98, 99, 100, 95, 96, 0, 0, + 0, 0, 0, 0, 103, 0, 0, 0, 0, 134, + 101, 97, 112, 0, 90, 91, 92, 0, 0, 0, + 0, 85, 53, 0, 0, 0, 74, 75, 139, 0, + 0, 0, 0, 0, 54, 55, 76, 63, 64, 65, + 66, 67, 68, 69, 88, 89, 70, 0, 93, 94, + 117, 0, 105, 0, 0, 0, 0, 0, 110, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 104, 73, 0, 0, 0, 0, 60, 133, 52, 0, + 0, 0, 57, 56, 58, 59, 71, 106, 0, 86, + 87, 0, 0, 0, 0, 0, 0, 0, 0, 51, + 109, 0, 102, 98, 99, 100, 95, 96, 0, 0, + 0, 0, 0, 0, 103, 0, 0, 0, 0, 134, + 101, 97, 112, 0, 90, 91, 92, 0, 0, 0, + 0, 85, 53, 0, 0, 0, 74, 75, 139, 0, + 0, 0, 0, 0, 54, 55, 76, 63, 64, 65, + 66, 67, 68, 69, 88, 89, 70, 0, 93, 94, + 117, 0, 105, 0, 0, 0, 0, 0, 110, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 104, 73, 0, 0, 0, 0, 60, 133, 52, 0, + 0, 389, 57, 56, 58, 59, 71, 106, 0, 86, + 87, 0, 0, 0, 0, 0, 0, 0, 0, 51, + 109, 0, 102, 98, 99, 100, 95, 96, 0, 0, + 0, 0, 0, 0, 103, 0, 0, 0, 0, 134, + 101, 97, 112, 0, 90, 91, 92, 0, 0, 0, + 0, 85, 53, 0, 0, 0, 74, 75, 139, 0, + 0, 0, 0, 0, 54, 55, 76, 63, 64, 65, + 66, 67, 68, 69, 88, 89, 70, 0, 93, 94, + 117, 0, 105, 0, 0, 0, 0, 0, 110, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 104, 73, 0, 0, 0, 365, 60, 133, 52, 0, + 0, 0, 57, 56, 58, 59, 71, 106, 0, 86, + 87, 0, 0, 0, 0, 0, 0, 0, 0, 51, + 109, 0, 102, 98, 99, 100, 95, 96, 0, 0, + 0, 0, 0, 0, 103, 0, 0, 0, 0, 134, + 101, 97, 112, 0, 90, 91, 92, 0, 0, 0, + 0, 85, 53, 0, 0, 0, 74, 75, 139, 0, + 0, 0, 0, 0, 54, 55, 76, 63, 64, 65, + 66, 67, 68, 69, 0, 0, 155, 157, 156, 179, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 104, 73, 0, 181, 178, 0, 60, 0, 52, 0, + 0, 0, 57, 56, 58, 59, 71, 106, 153, 154, + 165, 168, 169, 170, 171, 172, 173, 175, 177, 0, + 155, 157, 156, 179, 0, 0, 0, 0, 756, 180, + 159, 163, 162, 0, 0, 0, 0, 0, 158, 0, + 160, 164, 166, 167, 174, 176, 161, 181, 178, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 153, 154, 165, 168, 169, 170, 171, 172, + 173, 175, 177, 0, 155, 157, 156, 179, 0, 0, + 709, 0, 0, 180, 159, 163, 162, 0, 0, 0, + 0, 0, 158, 0, 160, 164, 166, 167, 174, 176, + 161, 181, 178, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 153, 154, 165, 168, + 169, 170, 171, 172, 173, 175, 177, 0, 0, 0, + 694, 155, 157, 156, 179, 0, 0, 180, 159, 163, + 162, 0, 0, 0, 0, 0, 158, 0, 160, 164, + 166, 167, 174, 176, 161, 0, 0, 0, 181, 178, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 153, 154, 165, 168, 169, 170, 171, + 172, 173, 175, 177, 0, 0, 0, 692, 155, 157, + 156, 179, 0, 0, 180, 159, 163, 162, 0, 0, + 0, 0, 0, 158, 0, 160, 164, 166, 167, 174, + 176, 161, 0, 0, 0, 181, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 153, 154, 165, 168, 169, 170, 171, 172, 173, 175, + 177, 0, 0, 0, 683, 155, 157, 156, 179, 0, + 0, 180, 159, 163, 162, 0, 0, 0, 0, 0, + 158, 0, 160, 164, 166, 167, 174, 176, 161, 0, + 0, 0, 181, 178, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 153, 154, 165, + 168, 169, 170, 171, 172, 173, 175, 177, 0, 155, + 157, 156, 179, 0, 0, 679, 0, 0, 180, 159, + 163, 162, 0, 0, 0, 0, 0, 158, 0, 160, + 164, 166, 167, 174, 176, 161, 181, 178, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 153, 154, 165, 168, 169, 170, 171, 172, 173, + 175, 177, 0, 155, 157, 156, 179, 0, 0, 678, + 0, 0, 180, 159, 163, 162, 0, 0, 0, 0, + 0, 158, 0, 160, 164, 166, 167, 174, 176, 161, + 181, 178, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 153, 154, 165, 168, 169, + 170, 171, 172, 173, 175, 177, 0, 0, 0, 624, + 155, 157, 156, 179, 0, 0, 180, 159, 163, 162, + 0, 0, 0, 0, 0, 158, 0, 160, 164, 166, + 167, 174, 176, 161, 0, 0, 0, 181, 178, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 153, 154, 165, 168, 169, 170, 171, 172, + 173, 175, 177, 0, 155, 157, 156, 179, 0, 0, + 623, 0, 0, 180, 159, 163, 162, 0, 0, 0, + 0, 0, 158, 0, 160, 164, 166, 167, 174, 176, + 161, 181, 178, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 153, 154, 165, 168, + 169, 170, 171, 172, 173, 175, 177, 0, 155, 157, + 156, 179, 0, 0, 622, 0, 0, 180, 159, 163, + 162, 0, 0, 0, 0, 0, 158, 0, 160, 164, + 166, 167, 174, 176, 161, 181, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 153, 154, 165, 168, 169, 170, 171, 172, 173, 175, + 177, 0, 0, 0, 605, 155, 157, 156, 179, 0, + 0, 180, 159, 163, 162, 0, 0, 0, 0, 0, + 158, 0, 160, 164, 166, 167, 174, 176, 161, 0, + 0, 0, 181, 178, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 153, 154, 165, + 168, 169, 170, 171, 172, 173, 175, 177, 0, 155, + 157, 156, 179, 0, 0, 596, 0, 0, 180, 159, + 163, 162, 0, 0, 0, 0, 0, 158, 0, 160, + 164, 166, 167, 174, 176, 161, 181, 178, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 153, 154, 165, 168, 169, 170, 171, 172, 173, + 175, 177, 567, 0, 0, 586, 155, 157, 156, 179, + 0, 0, 180, 159, 163, 162, 0, 0, 0, 0, + 0, 158, 0, 160, 164, 166, 167, 174, 176, 161, + 0, 0, 0, 181, 178, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 153, 154, + 165, 168, 169, 170, 171, 172, 173, 175, 177, 0, + 155, 157, 156, 179, 0, 0, 584, 0, 0, 180, + 159, 163, 162, 0, 0, 0, 0, 0, 158, 0, + 160, 164, 166, 167, 174, 176, 161, 181, 178, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 153, 154, 165, 168, 169, 170, 171, 172, + 173, 175, 177, 0, 155, 157, 156, 179, 0, 0, + 0, 0, 0, 180, 159, 163, 162, 0, 0, 0, + 0, 0, 158, 0, 160, 164, 166, 167, 174, 176, + 161, 181, 178, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 153, 154, 165, 168, + 169, 170, 171, 172, 173, 175, 177, 0, 155, 157, + 156, 179, 563, 0, 0, 0, 0, 180, 159, 163, + 162, 0, 0, 0, 0, 0, 158, 0, 160, 164, + 166, 167, 174, 176, 161, 181, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 153, 154, 165, 168, 169, 170, 171, 172, 173, 175, + 177, 0, 155, 157, 156, 179, 0, 0, 557, 0, + 0, 180, 159, 163, 162, 0, 0, 0, 0, 0, + 158, 0, 160, 164, 166, 167, 174, 176, 161, 181, + 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 153, 154, 165, 168, 169, 170, + 171, 172, 173, 175, 177, 0, 155, 157, 156, 179, + 0, 0, 553, 0, 0, 180, 159, 163, 162, 0, + 0, 0, 0, 0, 158, 0, 160, 164, 166, 167, + 174, 176, 161, 181, 178, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 412, 0, 0, 0, 153, 154, + 165, 168, 169, 170, 171, 172, 173, 175, 177, 0, + 0, 0, 0, 0, 0, 0, 417, 0, 0, 180, + 159, 163, 162, 155, 157, 156, 179, 0, 158, 0, + 160, 164, 166, 167, 174, 176, 161, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 181, 178, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 153, 154, 165, 168, 169, + 170, 171, 172, 173, 175, 177, 0, 155, 157, 156, + 179, 0, 0, 0, 0, 0, 180, 159, 163, 162, + 0, 0, 0, 0, 0, 158, 0, 160, 164, 166, + 167, 174, 176, 161, 181, 178, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 153, + 154, 165, 168, 169, 170, 171, 172, 173, 175, 177, + 0, 0, 0, 0, 373, 155, 157, 156, 179, 0, + 180, 159, 163, 162, 0, 0, 0, 0, 0, 158, + 0, 160, 164, 166, 167, 174, 176, 161, 0, 0, + 0, 0, 181, 178, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 153, 154, 165, + 168, 169, 170, 171, 172, 173, 175, 177, 0, 0, + 0, 0, 152, 155, 157, 156, 179, 0, 180, 159, + 163, 162, 0, 0, 0, 0, 0, 158, 0, 160, + 164, 166, 167, 174, 176, 161, 0, 0, 0, 0, + 181, 178, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 153, 154, 165, 168, 169, + 170, 171, 172, 173, 175, 177, 0, 0, 157, 156, + 179, 0, 0, 0, 0, 0, 180, 159, 163, 162, + 0, 0, 0, 0, 0, 158, 0, 160, 164, 166, + 167, 174, 176, 161, 181, 178, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 153, + 154, 165, 168, 169, 170, 171, 172, 173, 175, 177, + 0, 0, 0, 156, 179, 0, 0, 0, 0, 0, + 180, 159, 163, 162, 0, 0, 0, 0, 0, 158, + 0, 160, 164, 166, 167, 174, 176, 161, 181, 178, + 428, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 153, 154, 165, 168, 169, 170, 171, + 172, 173, 175, 177, 0, 0, 0, 0, 0, 0, + 0, 0, 179, 0, 180, 159, 163, 162, 0, 0, + 0, 0, 0, 158, 0, 160, 164, 166, 167, 174, + 176, 161, 0, 0, 0, 0, 181, 178, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 153, 154, 165, 168, 169, 170, 171, 172, 173, + 175, 177, 0, 0, 0, 0, 179, 0, 0, 0, + 0, 0, 180, 159, 163, 162, 0, 0, 0, 0, + 0, 158, 0, 160, 164, 166, 167, 174, 176, 161, + 181, 178, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 153, 154, 165, 168, 169, + 170, 171, 172, 173, 175, 177, 0, 0, 0, 0, + 179, 0, 0, 0, 0, 0, 180, 159, 163, 162, + 0, 0, 0, 0, 0, 158, 0, 160, 164, 166, + 167, 174, 176, 161, 181, 178, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 153, + 154, 165, 168, 169, 170, 171, 172, 173, 175, 177, + 0, 0, 0, 179, 0, 0, 0, 0, 0, 0, + 0, 159, 163, 162, 0, 0, 0, 0, 0, 158, + 0, 160, 164, 166, 167, 174, 176, 161, 178, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 179, 154, 165, 168, 169, 170, 171, 172, + 173, 175, 177, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 159, 163, 162, 178, 0, 0, + 0, 0, 158, 0, 160, 164, 166, 167, 174, 176, + 161, 179, 0, 165, 168, 169, 170, 171, 172, 173, + 175, 177, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 159, 163, 162, 178, 0, 0, 0, + 0, 158, 0, 160, 164, 166, 167, 174, 176, 161, + 179, 0, 165, 168, 169, 170, 171, 172, 173, 175, + 177, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 159, 163, 162, 178, 0, 0, 0, 0, + 0, 0, 160, 164, 166, 167, 174, 176, 161, 179, + 0, 165, 168, 169, 170, 171, 172, 173, 175, 177, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 159, 163, 162, 178, 0, 0, 0, 0, 0, + 0, 0, 164, 166, 167, 174, 176, 161, 0, 0, + 165, 168, 169, 170, 171, 172, 173, 175, 177, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 163, 162, 443, 444, 454, 455, 0, 0, 434, + 0, 164, 166, 167, 174, 176, 161, 0, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 489, + 490, 491, 492, 493, 481, 482, 483, 484, 485, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 0, 501, 499, 500, 496, 497, 0, 0, 488, 494, + 495, 502, 503, 505, 504, 506, 507, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 498, 509, + 508, 0, 0, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 456, 457, 458, 486, 487, 437, 438, 439, + 440, 441, 442, 443, 444, 454, 455, 0, 0, 916, + 0, 0, 0, 0, 0, 0, 0, 0, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 489, + 490, 491, 492, 493, 481, 482, 483, 484, 485, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 0, 501, 499, 500, 496, 497, 0, 0, 488, 494, + 495, 502, 503, 505, 504, 506, 507, 117, 0, 105, + 0, 0, 0, 0, 0, 110, 0, 0, 498, 509, + 508, 0, 0, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 456, 457, 458, 486, 487, 745, 746, 747, + 744, 743, 742, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 655, 109, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 134, 0, 0, 112, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 233, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 231, 0, 656, 0, 0, 654, 0, + 0, 0, 0, 0, 106, } var yyPact = [...]int{ - -1000, -1000, 1195, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - 262, 522, 588, 770, -1000, -1000, -1000, 258, 3945, 257, - 255, 6889, 6889, 6889, 135, 749, 6889, -1000, 5185, 254, - 248, 244, -1000, 450, 6889, 800, 275, 23, 578, 792, - 790, 788, 509, 520, 402, -1000, -1000, 239, -1000, -1000, - 133, 236, 6103, 6889, 511, 511, 6889, 6889, 6889, 6889, - 6889, -1000, -1000, 6889, 6889, 6889, 6889, 6889, 6889, 6889, - 232, 6889, -1000, 827, 6889, 6889, 6889, -1000, -1000, -1000, - 98, -1000, 557, 554, -1000, 351, 226, 223, 6889, 6889, - 221, 6889, 6889, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, 787, 813, -1000, 108, 202, 202, 213, - -1000, 525, 760, 175, 760, 288, -1000, -1000, 349, 614, - 10, 625, 760, -1000, -1000, -1000, -1000, 8, -1000, -18, - 2924, 6889, 695, 23, 524, 6889, 6889, 348, 5239, 662, - 343, 340, 5, -1000, -1000, -5, 23, -1000, -19, -7, - -1000, 5239, -1000, 6889, 6889, 6889, 6889, 6889, 6889, 6889, - 6889, 6889, 6889, 6889, 6889, 6889, 6889, 6889, 6889, 6889, - 6889, 6889, 6889, 6889, 6889, 6889, 6889, 6889, 6889, 589, - 6758, 6889, 511, 6889, 770, -1000, 5131, 339, -1000, 785, - -1000, 781, -1000, 585, -1000, 593, 211, 3945, 210, 336, - 271, 6627, 6889, 6889, 6889, 6889, 6889, 6889, 6889, 6889, - 6889, 6889, 6889, 6889, -1000, -1000, 6889, 6889, 6889, 97, - 6103, 119, 18, -1000, -1000, 5077, 511, 209, -1000, -1000, - 98, 6889, -1000, -1000, 6103, -1000, -82, -82, 16, -82, - 5019, -82, -82, -82, -82, -82, -82, -82, -1000, 6889, - -82, 454, 683, 799, -1000, 143, 6496, 511, 5628, 5574, - 5628, 6889, 3188, 3188, 202, -1000, 550, 291, 202, -1000, - -1000, 6889, 6889, 5239, 5239, 6889, 5239, 5239, 730, -1000, - 700, 575, 683, 6889, -1000, -1000, 5972, -1000, 6103, 779, - 525, 333, 525, -1000, -1000, 1062, -1000, 330, -10, 615, - 760, -1000, 609, 553, 777, 604, -1000, -1000, 770, 6889, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 208, 4965, - 206, -1000, 329, 17, 5239, 4911, -1000, -1000, -1000, -1000, - 135, -1000, 722, -1000, 6889, -1000, 6889, 5735, 5788, 338, - 5628, 5520, 5841, 6874, 3931, 138, 138, 138, 16, -82, - 16, 16, 187, 187, 316, 316, 316, 316, 130, 130, - 130, 130, 316, -1000, 4857, 6889, 5682, 13, -1000, -1000, - 4803, -11, 2791, -1000, -1000, -1000, 205, 585, 583, 611, - 447, -1000, 611, 6889, -1000, 6889, -1000, -1000, 5628, 6889, - 5628, 5628, 5628, 5628, 5628, 5628, 5628, 5628, 5628, 5628, - 5628, 5628, 4749, 117, 4695, 202, -1000, 6889, -1000, 166, - -24, 6103, 6365, -1000, 6103, 4641, 104, -1000, 162, -1000, - -1000, -1000, -1000, 227, 764, 4587, 113, 405, 6889, 96, - 202, -1000, -1000, 6889, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, 1241, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + 224, 451, 569, 683, -1000, -1000, -1000, 217, 4449, 214, + 211, 5600, 5600, 5600, 131, 640, 5600, -1000, 6798, 209, + 207, 206, -1000, 379, 5600, 724, 232, 0, 495, 721, + 715, 713, 455, 446, 940, -1000, -1000, 205, -1000, -1000, + 126, 204, 4940, 5600, 618, 618, 5600, 5600, 5600, 5600, + 5600, -1000, -1000, 5600, 5600, 5600, 5600, 5600, 5600, 5600, + 203, 5600, -1000, 827, 5600, 5600, 5600, -1000, -1000, -1000, + 82, -1000, 503, 500, -1000, 280, 202, 200, 5600, 5600, + 192, 5600, 5600, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, 787, 799, -1000, 136, 172, 172, 190, + -1000, 487, 662, 139, 662, 227, -1000, -1000, 314, 553, + -13, 542, 662, -1000, -1000, -1000, -1000, -28, -1000, -58, + 3269, 5600, 594, 0, 462, 5600, 5600, 313, 6856, 567, + 311, 302, -29, -1000, -1000, -30, 0, -1000, -59, -32, + -1000, 6856, -1000, 5600, 5600, 5600, 5600, 5600, 5600, 5600, + 5600, 5600, 5600, 5600, 5600, 5600, 5600, 5600, 5600, 5600, + 5600, 5600, 5600, 5600, 5600, 5600, 5600, 5600, 5600, 344, + 5490, 5600, 618, 5600, 683, -1000, 6740, 301, -1000, 710, + -1000, 703, -1000, 532, -1000, 543, 188, 4449, 185, 300, + 216, 5380, 5600, 5600, 5600, 5600, 5600, 5600, 5600, 5600, + 5600, 5600, 5600, 5600, -1000, -1000, 5600, 5600, 5600, 95, + 4940, 74, -11, -1000, -1000, 6686, 618, 183, -1000, -1000, + 82, 5600, -1000, -1000, 4940, -1000, 403, 403, 412, 403, + 6619, 403, 403, 403, 403, 403, 403, 403, -1000, 5600, + 403, 388, 619, 793, -1000, 163, 5270, 618, 7076, 7022, + 7076, 5600, 3579, 3579, 172, -1000, 499, 191, 172, -1000, + -1000, 5600, 5600, 6856, 6856, 5600, 6856, 6856, 705, -1000, + 695, 498, 619, 5600, -1000, -1000, 4828, -1000, 4940, 694, + 487, 299, 487, -1000, -1000, 1085, -1000, 296, -33, 537, + 662, -1000, 552, 472, 693, 531, -1000, -1000, 683, 5600, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 182, 6565, + 180, -1000, 295, -12, 6856, 6511, -1000, -1000, -1000, -1000, + 131, -1000, 646, -1000, 5600, -1000, 5600, 7183, 7222, 6910, + 7076, 6964, 7261, 7339, 7300, 132, 132, 132, 412, 403, + 412, 412, 254, 254, 321, 321, 321, 321, 150, 150, + 150, 150, 321, -1000, 6457, 5600, 7130, -14, -1000, -1000, + 6403, -34, 3113, -1000, -1000, -1000, 179, 532, 520, 544, + 377, -1000, 544, 5600, -1000, 5600, -1000, -1000, 7076, 5600, + 7076, 7076, 7076, 7076, 7076, 7076, 7076, 7076, 7076, 7076, + 7076, 7076, 6349, 67, 6292, 172, -1000, 5600, -1000, 130, + -65, 4940, 5160, -1000, 4940, 6238, 66, -1000, 128, -1000, + -1000, -1000, -1000, 215, 665, 6181, 52, 334, 5600, 43, + 172, -1000, -1000, 5600, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, @@ -1351,117 +1398,117 @@ var yyPact = [...]int{ -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - 202, -1000, -1000, -1000, -1000, 135, 6889, 6889, 97, 135, - 585, 11, -1000, 5239, 4533, 4479, -1000, -1000, -1000, 4425, - -1000, 9, -1000, 5239, 6889, 159, -1000, -1000, 929, -1000, - -1000, -1000, 527, 567, -1000, 760, 565, 735, -1000, 523, - -1000, 5239, 158, 3814, 6889, 6889, 6889, 204, -1000, -1000, - 199, 5239, -1000, 6889, 5682, 157, 511, 7196, 3683, -1000, - 196, 278, 583, -1000, 611, -1000, -1000, 443, -12, -1000, - 4371, 4317, 2658, 6874, 3552, -1000, -1000, -1000, 4263, -41, - 6889, -1000, 5239, 511, 195, 155, -1000, -1000, -1000, 89, - -1000, -1000, 707, -1000, -1000, -1000, -1000, 6889, -1000, 5628, - -1000, -1000, 4209, -1000, -1000, 69, 4155, -1000, -1000, 583, - 154, 6889, -1000, -1000, -1000, 151, 6234, 5239, -1000, -1000, - 760, 510, 0, -1000, -1000, 760, 735, -1000, 327, -1000, - -1000, -1000, 4101, 323, 5239, -1000, 322, 321, 278, 5682, - 319, -1000, 150, 580, 511, 191, 6103, -1000, -1000, -1000, - 696, 278, 147, 4, -1000, 60, -1000, -1000, 621, -1000, - -1000, -1000, -1000, 441, -12, 4335, -1000, 611, 3945, 270, - 314, -1000, -1000, -1000, 6889, 5628, -1000, 6103, -41, -1000, - -1000, 4047, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -8, -1000, 760, 396, 735, -1000, 0, -1000, 2525, 311, - 6889, 406, -1000, 786, -1000, 141, -1000, 3290, 7196, -1000, - 6103, 63, 2392, -1000, 186, 435, 139, 631, 278, 498, - -1000, -1000, 434, -1000, -1000, -1000, 717, 718, 611, 665, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 4065, -1000, - -1000, -1000, -1000, 3057, 5628, 131, 395, 417, 388, 760, - -8, -1000, -1000, 366, 310, -1000, 129, -1000, 6889, 190, - 404, 302, 750, 631, -1000, -1000, -1000, 127, -1000, 125, - -1000, 300, 611, -1000, 132, 132, 184, -1000, 719, -1000, - -1000, 793, -13, -1000, -31, 7038, 23, -25, -1000, -1000, - 3057, -41, -1000, -1000, -1000, -1000, 364, -1000, -1000, 3421, - 3993, -1000, -1000, -1000, -1000, -1000, 296, 132, 2259, 3290, - -1000, -1000, 74, -1000, 2126, 415, 278, 409, 180, -48, - 475, -1000, -1000, 717, -1000, 6889, -20, -1000, -49, 7038, - -1000, -1000, 5505, 411, -1000, -1000, -1000, -1000, -1000, 3057, - -1000, 408, 293, -1000, 124, 611, -1000, -1000, -1000, -1000, - -33, -1000, -1000, 713, 6889, -1000, -1000, 5239, -1000, 7038, - 6889, -1000, -1000, 5403, -1000, 290, 283, 613, 684, 542, - -1000, 524, -1000, -1000, 1993, 3057, -1000, -1000, 352, -1000, - 1860, 1727, -1000, 180, -1000, 5239, -1000, -1000, 5239, 177, - -1000, -1000, -1000, -1000, 611, 7138, 7038, 192, 1594, -1000, - -1000, -1000, -1000, -1000, 278, -12, -1000, -1000, 7038, -1000, - -1000, -1000, 1461, 122, -1000, -1000, 132, 299, -1000, -1000, - -1000, 1328, -1000, + 172, -1000, -1000, -1000, -1000, 131, 5600, 5600, 95, 131, + 532, -18, -1000, 6856, 6127, 6073, -1000, -1000, -1000, 6016, + -1000, -19, -1000, 6856, 5600, 124, -1000, -1000, 929, -1000, + -1000, -1000, 461, 517, -1000, 662, 508, 644, -1000, 460, + -1000, 6856, 118, 4295, 5600, 5600, 5600, 177, -1000, -1000, + 170, 6856, -1000, 5600, 7130, 113, 618, 7647, 4141, -1000, + 162, 471, 520, -1000, 544, -1000, -1000, 374, -40, -1000, + 5962, 5908, 2957, 7339, 3987, -1000, -1000, -1000, 5851, -73, + 5600, -1000, 6856, 618, 161, 112, -1000, -1000, -1000, 41, + -1000, -1000, 607, -1000, -1000, -1000, -1000, 5600, -1000, 7076, + -1000, -1000, 5794, -1000, -1000, 40, 5737, -1000, -1000, 520, + 111, 5600, -1000, -1000, -1000, 108, 5050, 6856, -1000, -1000, + 662, 454, -31, -1000, -1000, 662, 644, -1000, 294, -1000, + -1000, -1000, 5683, 292, 6856, -1000, 291, 289, 471, 7130, + 288, -1000, 107, 515, 618, 159, 4940, -1000, -1000, -1000, + 591, 471, 106, -23, -1000, 2, -1000, -1000, 677, -1000, + -1000, -1000, -1000, 367, -40, 1421, -1000, 544, 4449, 178, + 287, -1000, -1000, -1000, 5600, 7076, -1000, 4940, -73, -1000, + -1000, 5629, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + -38, -1000, 662, 326, 644, -1000, -31, -1000, 2801, 286, + 5600, 395, -1000, 696, -1000, 104, -1000, 3679, 7647, -1000, + 4940, 39, 2645, -1000, 158, 366, 102, 557, 471, 459, + -1000, -1000, 365, -1000, -1000, -1000, 627, 633, 544, 546, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 1265, -1000, + -1000, -1000, -1000, 3425, 7076, 99, 325, 362, 324, 662, + -38, -1000, -1000, 323, 276, -1000, 98, -1000, 5600, 155, + 360, 270, 659, 557, -1000, -1000, -1000, 96, -1000, 92, + -1000, 266, 544, -1000, 97, 97, 151, -1000, 630, -1000, + -1000, 1109, -35, -1000, -72, 7489, 0, -48, -1000, -1000, + 3425, -73, -1000, -1000, -1000, -1000, 322, -1000, -1000, 3833, + 361, -1000, -1000, -1000, -1000, -1000, 265, 97, 2489, 3679, + -1000, -1000, 79, -1000, 2333, 347, 471, 338, 140, -74, + 953, -1000, -1000, 627, -1000, 5600, -36, -1000, -75, 7489, + -1000, -1000, 4728, 730, -1000, -1000, -1000, -1000, -1000, 3425, + -1000, 337, 260, -1000, 86, 544, -1000, -1000, -1000, -1000, + -41, -1000, -1000, 613, 5600, -1000, -1000, 6856, -1000, 7489, + 5600, -1000, -1000, 4603, -1000, 253, 237, 547, 580, 494, + -1000, 462, -1000, -1000, 2177, 3425, -1000, -1000, 336, -1000, + 2021, 1865, -1000, 140, -1000, 6856, -1000, -1000, 6856, 133, + -1000, -1000, -1000, -1000, 544, 7589, 7489, 236, 1709, -1000, + -1000, -1000, -1000, -1000, 471, -40, -1000, -1000, 7489, -1000, + -1000, -1000, 1553, 84, -1000, -1000, 97, 261, -1000, -1000, + -1000, 1397, -1000, } var yyPgo = [...]int{ - 0, 960, 958, 51, 9, 957, 3, 955, 11, 31, - 79, 78, 49, 45, 953, 21, 951, 73, 19, 55, - 946, 0, 80, 945, 944, 38, 141, 47, 25, 942, - 36, 940, 56, 62, 930, 10, 928, 927, 925, 924, - 13, 46, 923, 921, 100, 84, 199, 920, 918, 917, - 5, 909, 83, 40, 908, 138, 43, 907, 906, 902, - 901, 900, 119, 898, 897, 887, 886, 12, 883, 880, - 44, 42, 32, 2, 15, 665, 8, 771, 20, 879, - 873, 872, 41, 74, 623, 870, 121, 869, 868, 866, - 71, 858, 33, 856, 855, 30, 37, 853, 852, 28, - 845, 835, 459, 833, 18, 832, 831, 26, 829, 63, - 1, 4, 828, 17, 823, 39, 822, 815, 814, 7, - 812, 6, 809, 803, 14, 797, 29, 16, + 0, 897, 896, 51, 9, 895, 3, 29, 16, 894, + 11, 31, 79, 78, 49, 45, 893, 21, 892, 73, + 19, 55, 891, 0, 80, 890, 889, 38, 141, 47, + 25, 887, 36, 886, 56, 62, 883, 10, 880, 879, + 872, 868, 13, 46, 866, 858, 100, 84, 199, 856, + 855, 853, 5, 852, 83, 40, 845, 138, 43, 840, + 837, 835, 825, 823, 119, 822, 819, 818, 817, 12, + 815, 814, 44, 42, 32, 2, 15, 629, 8, 686, + 20, 812, 809, 807, 41, 74, 536, 806, 121, 803, + 802, 800, 71, 798, 33, 797, 795, 30, 37, 791, + 789, 28, 787, 786, 545, 784, 18, 783, 776, 26, + 773, 63, 1, 4, 768, 17, 767, 39, 765, 763, + 761, 7, 760, 6, 755, 745, 14, 742, } var yyR1 = [...]int{ - 0, 125, 4, 4, 4, 4, 4, 4, 4, 4, + 0, 127, 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, 4, 4, 4, 5, - 5, 5, 5, 5, 5, 5, 6, 6, 109, 109, - 86, 86, 8, 8, 8, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 77, 77, 14, 14, 16, 16, 126, 126, 96, 96, - 95, 95, 102, 102, 15, 15, 18, 18, 17, 17, - 90, 90, 110, 110, 20, 20, 20, 20, 20, 20, - 20, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 5, 5, 5, 5, 5, 5, 6, 6, 111, 111, + 88, 88, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 88, 88, 87, 87, 24, - 24, 101, 101, 25, 10, 1, 1, 2, 2, 11, - 11, 120, 120, 75, 75, 12, 13, 27, 27, 114, - 114, 115, 115, 78, 78, 78, 78, 123, 123, 124, - 124, 23, 23, 80, 80, 80, 80, 99, 99, 99, - 127, 127, 122, 122, 66, 66, 64, 64, 68, 68, - 65, 65, 111, 111, 112, 112, 28, 28, 29, 29, - 74, 74, 72, 72, 72, 73, 73, 82, 82, 108, - 108, 30, 30, 94, 94, 32, 98, 98, 33, 33, - 113, 113, 34, 34, 34, 34, 119, 119, 81, 81, - 81, 100, 100, 35, 35, 36, 37, 37, 37, 37, - 39, 39, 38, 79, 79, 117, 117, 116, 116, 118, - 118, 76, 76, 76, 76, 76, 76, 97, 97, 40, - 40, 89, 89, 67, 19, 91, 91, 41, 92, 92, - 93, 93, 43, 42, 42, 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, 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, 121, 3, 3, 104, 104, 103, 103, 50, 50, - 51, 51, 51, 51, 44, 44, 45, 45, 48, 48, - 85, 85, 85, 83, 83, 55, 55, 55, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 56, 56, 56, 21, 21, 22, - 22, 54, 57, 57, 57, 58, 58, 58, 59, 59, - 59, 59, 59, 59, 26, 26, 26, 46, 46, 46, - 60, 60, 61, 61, 61, 61, 61, 61, 52, 52, - 52, 53, 53, 53, 107, 70, 70, 106, 106, 69, - 69, 69, 69, 69, 69, 84, 84, 84, 84, 62, - 62, 62, 62, 62, 62, 62, 63, 63, 63, 63, - 47, 47, 47, 47, 47, 47, 47, 105, 105, 71, + 79, 79, 16, 16, 18, 18, 7, 7, 98, 98, + 97, 97, 104, 104, 17, 17, 20, 20, 19, 19, + 92, 92, 112, 112, 22, 22, 22, 22, 22, 22, + 22, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 90, 90, 89, 89, 26, + 26, 103, 103, 27, 12, 1, 1, 2, 2, 13, + 13, 122, 122, 77, 77, 14, 15, 29, 29, 116, + 116, 117, 117, 80, 80, 80, 80, 125, 125, 126, + 126, 25, 25, 82, 82, 82, 82, 101, 101, 101, + 8, 8, 124, 124, 68, 68, 66, 66, 70, 70, + 67, 67, 113, 113, 114, 114, 30, 30, 31, 31, + 76, 76, 74, 74, 74, 75, 75, 84, 84, 110, + 110, 32, 32, 96, 96, 34, 100, 100, 35, 35, + 115, 115, 36, 36, 36, 36, 121, 121, 83, 83, + 83, 102, 102, 37, 37, 38, 39, 39, 39, 39, + 41, 41, 40, 81, 81, 119, 119, 118, 118, 120, + 120, 78, 78, 78, 78, 78, 78, 99, 99, 42, + 42, 91, 91, 69, 21, 93, 93, 43, 94, 94, + 95, 95, 45, 44, 44, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 123, 3, 3, 106, 106, 105, 105, 52, 52, + 53, 53, 53, 53, 46, 46, 47, 47, 50, 50, + 87, 87, 87, 85, 85, 57, 57, 57, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 58, 58, 58, 23, 23, 24, + 24, 56, 59, 59, 59, 60, 60, 60, 61, 61, + 61, 61, 61, 61, 28, 28, 28, 48, 48, 48, + 62, 62, 63, 63, 63, 63, 63, 63, 54, 54, + 54, 55, 55, 55, 109, 72, 72, 108, 108, 71, + 71, 71, 71, 71, 71, 86, 86, 86, 86, 64, + 64, 64, 64, 64, 64, 64, 65, 65, 65, 65, + 49, 49, 49, 49, 49, 49, 49, 107, 107, 73, } var yyR2 = [...]int{ @@ -1517,50 +1564,50 @@ var yyR2 = [...]int{ } var yyChk = [...]int{ - -1000, -125, -109, -7, 2, -9, -10, -11, -12, -13, - 51, 79, 44, 38, 119, -64, -65, 21, 20, 23, - 30, 34, 35, 39, 46, 98, 19, 14, -21, 48, - 25, 27, 121, 40, 43, 36, 10, 37, -120, 52, - 53, 54, -66, -68, -26, -31, -75, 7, -59, -60, - -57, 59, 125, 92, 104, 105, 130, 129, 131, 132, - 123, -42, -47, 107, 108, 109, 110, 111, 112, 113, - 6, 133, -49, 118, 96, 97, 106, 99, 100, -46, - -56, -51, -44, -54, -55, 91, 49, 50, 4, 5, + -1000, -127, -111, -9, 2, -11, -12, -13, -14, -15, + 51, 79, 44, 38, 142, -66, -67, 21, 20, 23, + 30, 34, 35, 39, 46, 98, 19, 14, -23, 48, + 25, 27, 144, 40, 43, 36, 10, 37, -122, 52, + 53, 54, -68, -70, -28, -33, -77, 7, -61, -62, + -59, 59, 148, 92, 104, 105, 153, 152, 154, 155, + 146, -44, -49, 107, 108, 109, 110, 111, 112, 113, + 6, 156, -51, 141, 96, 97, 106, 99, 100, -48, + -58, -53, -46, -56, -57, 91, 49, 50, 4, 5, 84, 85, 86, 8, 9, 66, 67, 81, 63, 64, - 65, 80, 62, 74, 117, 12, 134, -8, -58, 60, - 18, -86, 82, 123, 82, -86, 119, 10, -16, -77, - -102, -86, 82, 37, 38, -17, -18, -90, -19, 10, - -110, 123, -9, 37, 79, 123, 123, -22, -21, 98, - -22, -22, -94, -32, -46, -98, 37, -33, 12, -91, - -41, -21, 121, 149, 150, 87, 89, 88, 151, 128, - 152, 163, 130, 129, 164, 167, 165, 166, 161, 162, - 155, 156, 153, 154, 157, 158, 159, 160, 115, 90, - 127, 114, 123, 123, 123, 119, -21, 10, 122, -3, - 128, 52, -75, 10, 10, 10, 93, 94, 93, 95, - 94, 136, 137, 138, 139, 148, 140, 141, 142, 143, - 144, 145, 146, 147, 104, 105, 123, 125, 119, 57, - 123, -107, -106, -70, -69, -21, 128, 59, -21, -26, - -56, 123, -55, 98, 125, -26, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -48, 123, - -21, -85, 17, -84, -62, 12, 76, 77, -21, -21, - -21, 125, 78, 78, -45, -43, -44, -61, 52, -8, - -46, 123, 123, -21, -21, 123, -21, -21, 17, 75, - -84, -84, 17, 119, -46, -82, 123, -82, 123, 82, - -86, 124, -86, 121, 119, -109, 121, -14, -102, -86, - 82, 121, 135, 82, 29, -86, -18, 121, 135, 136, - -20, 120, 2, -9, -10, -11, -12, -13, 51, -21, - 21, -3, -92, -93, -21, -21, 121, 121, 121, 121, - 135, 121, 135, -3, 136, 121, 135, -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, -45, -21, 122, -21, -101, -25, -26, - -21, -90, -110, 121, 121, 10, -121, 10, -27, 55, - -121, -114, 55, 123, -9, 123, 121, 122, -21, 128, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -22, -21, -53, 10, 119, -46, -107, - 126, 135, 58, -26, 123, -21, -107, 124, -22, 118, - -62, -62, 17, 125, 57, -21, 11, -26, 58, -22, - -52, -6, -46, 119, 10, -5, -4, 98, 99, 100, + 65, 80, 62, 74, 140, 12, 157, -10, -60, 60, + 18, -88, 82, 146, 82, -88, 142, 10, -18, -79, + -104, -88, 82, 37, 38, -19, -20, -92, -21, 10, + -112, 146, -11, 37, 79, 146, 146, -24, -23, 98, + -24, -24, -96, -34, -48, -100, 37, -35, 12, -93, + -43, -23, 144, 129, 130, 87, 89, 88, 159, 151, + 161, 167, 153, 152, 162, 131, 163, 164, 132, 133, + 134, 135, 136, 137, 165, 138, 166, 139, 115, 90, + 150, 114, 146, 146, 146, 142, -23, 10, 145, -3, + 151, 52, -77, 10, 10, 10, 93, 94, 93, 95, + 94, 160, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 104, 105, 146, 148, 142, 57, + 146, -109, -108, -72, -71, -23, 151, 59, -23, -28, + -58, 146, -57, 98, 148, -28, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -50, 146, + -23, -87, 17, -86, -64, 12, 76, 77, -23, -23, + -23, 148, 78, 78, -47, -45, -46, -63, 52, -10, + -48, 146, 146, -23, -23, 146, -23, -23, 17, 75, + -86, -86, 17, 142, -48, -84, 146, -84, 146, 82, + -88, 147, -88, 144, 142, -111, 144, -16, -104, -88, + 82, 144, 158, 82, 29, -88, -20, 144, 158, 160, + -22, 143, 2, -11, -12, -13, -14, -15, 51, -23, + 21, -3, -94, -95, -23, -23, 144, 144, 144, 144, + 158, 144, 158, -3, 160, 144, 158, -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, -47, -23, 145, -23, -103, -27, -28, + -23, -92, -112, 144, 144, 10, -123, 10, -29, 55, + -123, -116, 55, 146, -11, 146, 144, 145, -23, 151, + -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -24, -23, -55, 10, 142, -48, -109, + 149, 158, 58, -28, 146, -23, -109, 147, -24, 141, + -64, -64, 17, 148, 57, -23, 11, -28, 58, -24, + -54, -6, -48, 142, 10, -5, -4, 98, 99, 100, 101, 102, 103, 4, 5, 84, 85, 86, 87, 88, 89, 90, 91, 92, 6, 7, 93, 94, 95, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, @@ -1568,49 +1615,49 @@ var yyChk = [...]int{ 50, 35, 36, 37, 38, 39, 96, 97, 59, 30, 31, 32, 33, 34, 60, 61, 55, 56, 79, 53, 54, 52, 62, 63, 65, 64, 66, 67, 81, 80, - -52, -6, -46, -83, -82, 78, 125, 119, 57, 78, - -83, -105, -71, -21, -21, -21, 75, 75, 117, -21, - 124, -108, -30, -21, 83, -107, 10, 121, -109, 120, - 121, 121, 82, -86, -17, 82, -86, 119, 10, 82, - -19, -21, 123, 124, 123, 121, 135, 124, -32, -33, - -121, -21, -41, 122, -21, -126, 135, 29, 124, 120, - -121, 123, -27, -115, 56, -8, 119, -121, -119, -8, - -21, -21, -110, -21, 124, 126, 120, -82, -21, 124, - 136, -70, -21, 128, 59, -107, 124, 126, 124, -63, - 10, 13, 129, 12, 10, 120, 120, 125, 120, -21, - 126, -82, -21, -82, -46, -22, -21, -53, -46, -27, - -126, 135, 124, 124, 120, -126, 135, -21, 124, 120, - 119, 82, -96, -15, -18, -77, 119, -121, 124, -122, - -9, 122, -21, -92, -21, -80, 119, 122, 123, -21, - 124, -25, -78, -26, 128, 59, 125, -23, -9, 122, - -88, 123, -111, -112, -28, -29, -74, -72, 127, 60, - 61, -8, -115, -121, -119, -113, 119, 135, 124, 124, - 95, -9, 122, 120, 136, -21, -26, 123, 124, 126, - 13, -21, 120, 126, 120, -115, 124, -71, 124, -30, - -95, -18, 119, -126, 135, -18, -96, 121, -110, 124, - 121, -99, 121, -99, 121, -111, 121, 124, 58, -26, - 123, -107, -110, -24, 41, 42, -111, 124, 135, -1, - 128, -72, -121, 119, 120, -34, -117, -116, 44, -118, - 47, -76, 103, 102, 101, 98, 99, 100, -113, -8, - -9, 122, 121, -110, -21, -107, 126, -121, -126, 135, - -95, 120, -15, -126, 22, 121, -92, 120, 32, 33, - -99, 31, -99, 124, -124, -9, 122, -78, -26, -107, - 126, 28, 123, 119, 124, -104, 44, -28, -2, 83, - 119, -113, -97, -40, 12, 38, 37, -119, -76, 120, - -110, 124, 120, 119, 120, -18, -126, 120, 121, 124, - -21, -127, 122, 121, 120, 121, 31, -104, -110, 124, - 124, 121, -87, -8, -110, -73, 122, -73, 123, 12, - -113, 120, 121, 135, -121, 136, -89, -67, -6, -3, - -81, 121, 119, -113, 120, -123, -9, 122, -127, -110, - 121, -73, 26, -124, 12, 151, 120, 119, -74, 119, - -103, -50, 12, 128, 136, 120, -40, -21, 121, 135, - 136, -6, 120, -100, -35, -36, -37, -38, -39, -8, - -6, 79, 10, 120, -110, -110, 119, 121, 124, -8, - -110, -110, 124, 135, 12, -21, -121, -67, -21, -121, - 120, -35, 121, 121, 45, 29, 78, 24, -110, 119, - 120, 120, -50, -121, 123, -119, 10, -4, -76, -6, - 121, 120, -110, -111, -6, 120, 124, -73, -79, 121, - 119, -110, 120, + -54, -6, -48, -85, -84, 78, 148, 142, 57, 78, + -85, -107, -73, -23, -23, -23, 75, 75, 140, -23, + 147, -110, -32, -23, 83, -109, 10, 144, -111, 143, + 144, 144, 82, -88, -19, 82, -88, 142, 10, 82, + -21, -23, 146, 147, 146, 144, 158, 147, -34, -35, + -123, -23, -43, 145, -23, -7, 158, 29, 147, 143, + -123, 146, -29, -117, 56, -10, 142, -123, -121, -10, + -23, -23, -112, -23, 147, 149, 143, -84, -23, 147, + 160, -72, -23, 151, 59, -109, 147, 149, 147, -65, + 10, 13, 152, 12, 10, 143, 143, 148, 143, -23, + 149, -84, -23, -84, -48, -24, -23, -55, -48, -29, + -7, 158, 147, 147, 143, -7, 158, -23, 147, 143, + 142, 82, -98, -17, -20, -79, 142, -123, 147, -124, + -11, 145, -23, -94, -23, -82, 142, 145, 146, -23, + 147, -27, -80, -28, 151, 59, 148, -25, -11, 145, + -90, 146, -113, -114, -30, -31, -76, -74, 150, 60, + 61, -10, -117, -123, -121, -115, 142, 158, 147, 147, + 95, -11, 145, 143, 160, -23, -28, 146, 147, 149, + 13, -23, 143, 149, 143, -117, 147, -73, 147, -32, + -97, -20, 142, -7, 158, -20, -98, 144, -112, 147, + 144, -101, 144, -101, 144, -113, 144, 147, 58, -28, + 146, -109, -112, -26, 41, 42, -113, 147, 158, -1, + 151, -74, -123, 142, 143, -36, -119, -118, 44, -120, + 47, -78, 103, 102, 101, 98, 99, 100, -115, -10, + -11, 145, 144, -112, -23, -109, 149, -123, -7, 158, + -97, 143, -17, -7, 22, 144, -94, 143, 32, 33, + -101, 31, -101, 147, -126, -11, 145, -80, -28, -109, + 149, 28, 146, 142, 147, -106, 44, -30, -2, 83, + 142, -115, -99, -42, 12, 38, 37, -121, -78, 143, + -112, 147, 143, 142, 143, -20, -7, 143, 144, 147, + -23, -8, 145, 144, 143, 144, 31, -106, -112, 147, + 147, 144, -89, -10, -112, -75, 145, -75, 146, 12, + -115, 143, 144, 158, -123, 160, -91, -69, -6, -3, + -83, 144, 142, -115, 143, -125, -11, 145, -8, -112, + 144, -75, 26, -126, 12, 159, 143, 142, -76, 142, + -105, -52, 12, 151, 160, 143, -42, -23, 144, 158, + 160, -6, 143, -102, -37, -38, -39, -40, -41, -10, + -6, 79, 10, 143, -112, -112, 142, 144, 147, -10, + -112, -112, 147, 158, 12, -23, -123, -69, -23, -123, + 143, -37, 144, 144, 45, 29, 78, 24, -112, 142, + 143, 143, -52, -123, 146, -121, 10, -4, -78, -6, + 144, 143, -112, -113, -6, 143, 147, -75, -81, 144, + 142, -112, 143, } var yyDef = [...]int{ @@ -1714,16 +1761,16 @@ var yyTok1 = [...]int{ 1, 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, 131, 117, 3, 134, 166, 128, 3, - 123, 124, 164, 130, 135, 129, 163, 165, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 122, 121, - 157, 136, 159, 127, 133, 3, 3, 3, 3, 3, + 3, 3, 3, 154, 140, 3, 157, 164, 151, 3, + 146, 147, 162, 153, 158, 152, 167, 163, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 145, 144, + 165, 160, 166, 150, 156, 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, 125, 3, 126, 152, 3, 118, 3, 3, 3, + 3, 148, 3, 149, 161, 3, 141, 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, 119, 151, 120, 132, + 3, 3, 3, 142, 159, 143, 155, } var yyTok2 = [...]int{ @@ -1738,9 +1785,9 @@ var yyTok2 = [...]int{ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 153, - 154, 155, 156, 158, 160, 161, 162, 167, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, } var yyTok3 = [...]int{ 0, @@ -2085,470 +2132,472 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:257 + //line php7/php7.y:291 { yylex.(*Parser).rootNode = stmt.NewStmtList(yyDollar[1].list) + + // save position yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) } case 2: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:264 + //line php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 3: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:264 + //line php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:264 + //line php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 5: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:264 + //line php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:264 + //line php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:264 + //line php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:264 + //line php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:264 + //line php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 10: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:265 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 11: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:265 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 12: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:265 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 13: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:265 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 14: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:265 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 15: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:265 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 16: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:265 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 17: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:265 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 18: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:265 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:265 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:265 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 21: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:265 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 22: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:266 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 23: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:266 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 24: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:266 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:266 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:266 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 27: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:266 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 28: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:266 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 29: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:266 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 30: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:266 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:266 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:267 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 33: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:267 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 34: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:267 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 35: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:267 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 36: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:267 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 37: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:267 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 38: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:267 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 39: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:267 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:267 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:267 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:268 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:268 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 44: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:268 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:268 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 46: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:268 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 47: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:268 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 48: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:268 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 49: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:268 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 50: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:268 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 51: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:268 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 52: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:268 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 53: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:269 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 54: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:269 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 55: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:269 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 56: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:269 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 57: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:269 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 58: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:269 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 59: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:269 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 60: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:269 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 61: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:270 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 62: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:270 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 63: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:270 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 64: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:270 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:270 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 66: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:270 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 67: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:270 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 68: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:270 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 69: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:274 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 70: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:275 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:275 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 72: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:275 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 73: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:275 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 74: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:275 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 75: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:275 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 76: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:279 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 77: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:280 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 78: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:285 + //line php7/php7.y:324 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2556,327 +2605,465 @@ yydefault: } case 79: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:290 + //line php7/php7.y:330 { yyVAL.list = []node.Node{} } case 80: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:295 + //line php7/php7.y:335 { namePart := name.NewNamePart(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.list = []node.Node{namePart} + + // save position + yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(namePart, yyDollar[1].token.Comments()) } case 81: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:346 { namePart := name.NewNamePart(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.list = append(yyDollar[1].list, namePart) + + // save position + yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) yylex.(*Parser).comments.AddComments(namePart, yyDollar[3].token.Comments()) } case 82: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:361 { yyVAL.node = name.NewName(yyDollar[1].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) } case 83: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:318 + //line php7/php7.y:368 { yyVAL.node = name.NewRelative(yyDollar[3].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 84: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:324 + //line php7/php7.y:379 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 85: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:333 + //line php7/php7.y:392 { // error yyVAL.node = nil } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:337 + //line php7/php7.y:397 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:338 + //line php7/php7.y:399 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:339 + //line php7/php7.y:401 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:340 + //line php7/php7.y:403 { yyVAL.node = yyDollar[1].node } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:341 + //line php7/php7.y:405 { yyVAL.node = yyDollar[1].node } case 91: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:342 + //line php7/php7.y:407 { yyVAL.node = stmt.NewHaltCompiler() + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 92: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:344 + //line php7/php7.y:420 { name := name.NewName(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yyVAL.node = stmt.NewNamespace(name, nil) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 93: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:354 + //line php7/php7.y:433 { name := name.NewName(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) } case 94: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:364 + //line php7/php7.y:447 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 95: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:369 + //line php7/php7.y:459 { yyVAL.node = yyDollar[2].node + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 96: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:370 + //line php7/php7.y:470 { yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 97: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:372 + //line php7/php7.y:481 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 98: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:377 + //line php7/php7.y:492 { yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 99: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:379 + //line php7/php7.y:503 { yyVAL.node = stmt.NewConstList(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:388 + //line php7/php7.y:517 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:394 + //line php7/php7.y:527 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 102: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:403 + //line php7/php7.y:540 { name := name.NewName(yyDollar[1].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + if yyDollar[5].token != nil { + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) + } + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) } case 103: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:413 + //line php7/php7.y:557 { name := name.NewName(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + if yyDollar[6].token != nil { + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + } + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[7].token.Comments()) } case 104: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:426 + //line php7/php7.y:578 { name := name.NewName(yyDollar[1].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + if yyDollar[5].token != nil { + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) + } + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:436 + //line php7/php7.y:595 { name := name.NewName(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + if yyDollar[6].token != nil { + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + } + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[7].token.Comments()) + } + case 106: + yyDollar = yyS[yypt-0 : yypt+1] + //line php7/php7.y:616 + { + yyVAL.token = nil + } + case 107: + yyDollar = yyS[yypt-1 : yypt+1] + //line php7/php7.y:618 + { + yyVAL.token = yyDollar[1].token } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:454 + //line php7/php7.y:623 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:455 + //line php7/php7.y:630 { yyVAL.list = []node.Node{yyDollar[1].node} } case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:460 + //line php7/php7.y:635 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:461 + //line php7/php7.y:642 { yyVAL.list = []node.Node{yyDollar[1].node} } case 112: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:465 + //line php7/php7.y:647 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:466 + //line php7/php7.y:654 { yyVAL.list = []node.Node{yyDollar[1].node} } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:470 + //line php7/php7.y:659 { yyVAL.node = yyDollar[1].node } case 115: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:471 + //line php7/php7.y:661 { yyVAL.node = yyDollar[2].node.(*stmt.Use).SetUseType(yyDollar[1].node) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:476 + //line php7/php7.y:666 { name := name.NewName(yyDollar[1].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yyVAL.node = stmt.NewUse(nil, name, nil) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) } case 117: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:486 + //line php7/php7.y:675 { name := name.NewName(yyDollar[1].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) alias := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.node = stmt.NewUse(nil, name, alias) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) yylex.(*Parser).comments.AddComments(alias, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:501 + //line php7/php7.y:693 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:502 + //line php7/php7.y:695 { yyVAL.node = yyDollar[2].node + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:506 + //line php7/php7.y:705 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:507 + //line php7/php7.y:712 { yyVAL.list = []node.Node{yyDollar[1].node} } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:512 + //line php7/php7.y:717 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2884,234 +3071,347 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:517 + //line php7/php7.y:723 { yyVAL.list = []node.Node{} } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:522 + //line php7/php7.y:728 { // error yyVAL.node = nil } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:526 + //line php7/php7.y:733 { yyVAL.node = yyDollar[1].node } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:527 + //line php7/php7.y:735 { yyVAL.node = yyDollar[1].node } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:528 + //line php7/php7.y:737 { yyVAL.node = yyDollar[1].node } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:529 + //line php7/php7.y:739 { yyVAL.node = yyDollar[1].node } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:530 + //line php7/php7.y:741 { yyVAL.node = yyDollar[1].node } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:532 + //line php7/php7.y:743 { yyVAL.node = stmt.NewHaltCompiler() + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:540 + //line php7/php7.y:758 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 132: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:545 + //line php7/php7.y:769 { yyVAL.node = yyDollar[1].node } case 133: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:546 + //line php7/php7.y:771 { yyVAL.node = yyDollar[1].node } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:548 + //line php7/php7.y:773 { if yyDollar[5].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltWhile(yyDollar[3].node, yyDollar[5].altSyntaxNode.node) } else { yyVAL.node = stmt.NewWhile(yyDollar[3].node, yyDollar[5].altSyntaxNode.node) } + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].altSyntaxNode.node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:558 + //line php7/php7.y:789 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[7].token.Comments()) } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:564 + //line php7/php7.y:803 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltFor(yyDollar[3].list, yyDollar[5].list, yyDollar[7].list, yyDollar[9].altSyntaxNode.node) } else { yyVAL.node = stmt.NewFor(yyDollar[3].list, yyDollar[5].list, yyDollar[7].list, yyDollar[9].altSyntaxNode.node) } + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].altSyntaxNode.node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[8].token.Comments()) } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:574 + //line php7/php7.y:821 { if yyDollar[5].nodesWithEndToken.endToken.Value == ";" { yyVAL.node = stmt.NewAltSwitch(yyDollar[3].node, yyDollar[5].nodesWithEndToken.nodes) } else { yyVAL.node = stmt.NewSwitch(yyDollar[3].node, yyDollar[5].nodesWithEndToken.nodes) } + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].nodesWithEndToken.endToken)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:584 + //line php7/php7.y:837 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:590 + //line php7/php7.y:848 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:596 + //line php7/php7.y:859 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:602 + //line php7/php7.y:870 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:608 + //line php7/php7.y:881 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:614 + //line php7/php7.y:892 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:620 + //line php7/php7.y:903 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:626 + //line php7/php7.y:913 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:632 + //line php7/php7.y:923 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + if yyDollar[4].token != nil { + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + } + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:638 + //line php7/php7.y:939 { if yyDollar[7].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, nil, yyDollar[5].foreachVariable.node, yyDollar[7].altSyntaxNode.node, yyDollar[5].foreachVariable.byRef) } else { yyVAL.node = stmt.NewForeach(yyDollar[3].node, nil, yyDollar[5].foreachVariable.node, yyDollar[7].altSyntaxNode.node, yyDollar[5].foreachVariable.byRef) } + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[7].altSyntaxNode.node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:648 + //line php7/php7.y:956 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, yyDollar[5].node, yyDollar[7].foreachVariable.node, yyDollar[9].altSyntaxNode.node, yyDollar[7].foreachVariable.byRef) } else { yyVAL.node = stmt.NewForeach(yyDollar[3].node, yyDollar[5].node, yyDollar[7].foreachVariable.node, yyDollar[9].altSyntaxNode.node, yyDollar[7].foreachVariable.byRef) } + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].altSyntaxNode.node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[8].token.Comments()) } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:658 + //line php7/php7.y:974 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:664 + //line php7/php7.y:986 { yyVAL.node = stmt.NewNop() + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:670 + //line php7/php7.y:996 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3121,1131 +3421,1491 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) } + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:682 + //line php7/php7.y:1011 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:688 + //line php7/php7.y:1022 { label := node.NewIdentifier(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yyVAL.node = stmt.NewGoto(label) + + // save position + yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(label, yyDollar[2].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(label, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:698 + //line php7/php7.y:1036 { label := node.NewIdentifier(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = stmt.NewLabel(label) + + // save position + yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + // save comments yylex.(*Parser).comments.AddComments(label, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:709 + //line php7/php7.y:1051 { yyVAL.list = []node.Node{} } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:711 + //line php7/php7.y:1053 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[5].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[5].token)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[5].token)) catch := stmt.NewCatch(yyDollar[4].list, variable, yyDollar[8].list) - yylex.(*Parser).positions.AddPosition(catch, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].token, yyDollar[9].token)) yyVAL.list = append(yyDollar[1].list, catch) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[5].token.Comments()) - yylex.(*Parser).comments.AddComments(variable, yyDollar[5].token.Comments()) + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[5].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[5].token)) + yylex.(*Parser).positions.AddPosition(catch, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].token, yyDollar[9].token)) + + // save comments yylex.(*Parser).comments.AddComments(catch, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(catch, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddComments(variable, yyDollar[5].token.Comments()) + yylex.(*Parser).comments.AddComments(catch, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddComments(catch, yyDollar[7].token.Comments()) + yylex.(*Parser).comments.AddComments(catch, yyDollar[9].token.Comments()) } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:726 + //line php7/php7.y:1075 { yyVAL.list = []node.Node{yyDollar[1].node} } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:727 + //line php7/php7.y:1077 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:731 + //line php7/php7.y:1087 { yyVAL.node = nil } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:733 + //line php7/php7.y:1089 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:741 + //line php7/php7.y:1104 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:742 + //line php7/php7.y:1106 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:746 + //line php7/php7.y:1116 { yyVAL.node = yyDollar[1].node } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:751 + //line php7/php7.y:1121 { name := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.node = stmt.NewFunction(name, yyDollar[2].boolWithToken.value, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[3].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + if yyDollar[2].boolWithToken.token != nil { + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].boolWithToken.token.Comments()) + } + yylex.(*Parser).comments.AddComments(name, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddComments(name, yyDollar[5].token.Comments()) + yylex.(*Parser).comments.AddComments(name, yyDollar[7].token.Comments()) + yylex.(*Parser).comments.AddComments(name, yyDollar[9].token.Comments()) + yylex.(*Parser).comments.AddComments(name, yyDollar[11].token.Comments()) } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:763 + //line php7/php7.y:1144 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:764 + //line php7/php7.y:1146 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:768 + //line php7/php7.y:1151 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:769 + //line php7/php7.y:1153 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:774 + //line php7/php7.y:1158 { name := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].node, yyDollar[5].list, yyDollar[8].list, yyDollar[6].str) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[9].token)) + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) yylex.(*Parser).comments.AddComments(name, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) + if yyDollar[4].node != nil { + yylex.(*Parser).setCommentsFromChildNode(yyVAL.node, yyDollar[4].node) + } + if yyDollar[5].list != nil { + yylex.(*Parser).setCommentsFromChildNode(yyVAL.node, firstNode(yyDollar[5].list)) + } + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[7].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[9].token.Comments()) } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:784 + //line php7/php7.y:1179 { name := node.NewIdentifier(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[2].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(name, yyDollar[2].token.Comments()) + if yyDollar[3].node != nil { + yylex.(*Parser).setCommentsFromChildNode(yyVAL.node, yyDollar[3].node) + } + if yyDollar[4].list != nil { + yylex.(*Parser).setCommentsFromChildNode(yyVAL.node, firstNode(yyDollar[4].list)) + } + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[8].token.Comments()) } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:796 + //line php7/php7.y:1203 { yyVAL.list = []node.Node{yyDollar[1].node} } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:797 + //line php7/php7.y:1205 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:802 + //line php7/php7.y:1210 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:808 + //line php7/php7.y:1220 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:817 + //line php7/php7.y:1233 { name := node.NewIdentifier(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[2].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(name, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:830 + //line php7/php7.y:1251 { name := node.NewIdentifier(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yyVAL.node = stmt.NewInterface(name, yyDollar[3].list, yyDollar[6].list, yyDollar[4].str) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[2].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(name, yyDollar[2].token.Comments()) + if yyDollar[3].list != nil { + yylex.(*Parser).setCommentsFromChildNode(yyVAL.node, firstNode(yyDollar[3].list)) + } + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[7].token.Comments()) } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:842 + //line php7/php7.y:1272 { yyVAL.node = nil } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:843 + //line php7/php7.y:1274 { yyVAL.node = yyDollar[2].node + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:847 + //line php7/php7.y:1284 { yyVAL.list = nil } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:848 + //line php7/php7.y:1286 { yyVAL.list = yyDollar[2].list + + // save comments + yylex.(*Parser).comments.AddComments(firstNode(yyVAL.list), yyDollar[1].token.Comments()) } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:852 + //line php7/php7.y:1296 { yyVAL.list = nil } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:853 + //line php7/php7.y:1298 { yyVAL.list = yyDollar[2].list + + // save comments + yylex.(*Parser).comments.AddComments(firstNode(yyVAL.list), yyDollar[1].token.Comments()) } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:857 + //line php7/php7.y:1308 { yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:858 + //line php7/php7.y:1310 { yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} + + // save position + yylex.(*Parser).positions.AddPosition(yyDollar[2].node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments + yylex.(*Parser).comments.AddComments(yyDollar[2].node, yyDollar[1].token.Comments()) } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:860 + //line php7/php7.y:1320 { list := expr.NewList(yyDollar[3].list) - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) yyVAL.foreachVariable = foreachVariable{list, false} + + // save position + yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments yylex.(*Parser).comments.AddComments(list, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(list, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(list, yyDollar[4].token.Comments()) } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:867 + //line php7/php7.y:1333 { list := expr.NewShortList(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) yyVAL.foreachVariable = foreachVariable{list, false} + + // save position + yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments yylex.(*Parser).comments.AddComments(list, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(list, yyDollar[3].token.Comments()) } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:877 + //line php7/php7.y:1348 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:879 + //line php7/php7.y:1350 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[4].token.Comments()) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:887 + //line php7/php7.y:1365 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:889 + //line php7/php7.y:1367 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[4].token.Comments()) } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:896 + //line php7/php7.y:1382 { yyVAL.node = yyDollar[1].node } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:898 + //line php7/php7.y:1384 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:906 + //line php7/php7.y:1398 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:907 + //line php7/php7.y:1399 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[4].token} } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:908 + //line php7/php7.y:1400 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[4].token} } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:909 + //line php7/php7.y:1401 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[5].token} } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:913 + //line php7/php7.y:1406 { yyVAL.list = []node.Node{} } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:915 + //line php7/php7.y:1408 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) - yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) yyVAL.list = append(yyDollar[1].list, _case) + + // save position + yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) + + // save comments yylex.(*Parser).comments.AddComments(_case, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(_case, yyDollar[4].token.Comments()) } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:922 + //line php7/php7.y:1420 { _default := stmt.NewDefault(yyDollar[4].list) - yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) yyVAL.list = append(yyDollar[1].list, _default) + + // save position + yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) + + // save comments yylex.(*Parser).comments.AddComments(_default, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(_default, yyDollar[3].token.Comments()) + } + case 200: + yyDollar = yyS[yypt-1 : yypt+1] + //line php7/php7.y:1435 + { + yyVAL.token = yyDollar[1].token + } + case 201: + yyDollar = yyS[yypt-1 : yypt+1] + //line php7/php7.y:1437 + { + yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:937 + //line php7/php7.y:1442 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:939 + //line php7/php7.y:1444 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[4].token.Comments()) } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:947 + //line php7/php7.y:1459 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:953 + //line php7/php7.y:1471 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) - yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[6].node)) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) + + // save position + yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[6].node)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) + // save comments yylex.(*Parser).comments.AddComments(_elseIf, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(_elseIf, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddComments(_elseIf, yyDollar[5].token.Comments()) } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:964 + //line php7/php7.y:1488 { yyVAL.node = yyDollar[1].node } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:966 + //line php7/php7.y:1490 { _else := stmt.NewElse(yyDollar[3].node) - yylex.(*Parser).positions.AddPosition(_else, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[3].node)) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) + + // save position + yylex.(*Parser).positions.AddPosition(_else, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[3].node)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:978 + //line php7/php7.y:1505 { stmts := stmt.NewStmtList(yyDollar[6].list) - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[6].list)) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) + + // save position + yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[6].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[6].list)) - yylex.(*Parser).comments.AddComments(stmts, yyDollar[5].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:988 + //line php7/php7.y:1520 { stmts := stmt.NewStmtList(yyDollar[7].list) - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[7].list)) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) - yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[7].list)) yyVAL.node = yyDollar[1].node.(*stmt.AltIf).AddElseIf(_elseIf) - yylex.(*Parser).comments.AddComments(stmts, yyDollar[6].token.Comments()) + // save position + yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[7].list)) + yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[7].list)) + + // save comments yylex.(*Parser).comments.AddComments(_elseIf, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(_elseIf, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddComments(_elseIf, yyDollar[5].token.Comments()) + yylex.(*Parser).comments.AddComments(_elseIf, yyDollar[6].token.Comments()) } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1002 + //line php7/php7.y:1539 { yyVAL.node = yyDollar[1].node + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1007 + //line php7/php7.y:1550 { stmts := stmt.NewStmtList(yyDollar[4].list) - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) _else := stmt.NewAltElse(stmts) - yylex.(*Parser).positions.AddPosition(_else, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) yyVAL.node = yyDollar[1].node.(*stmt.AltIf).SetElse(_else) + + // save position + yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) + yylex.(*Parser).positions.AddPosition(_else, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[6].token)) - yylex.(*Parser).comments.AddComments(stmts, yyDollar[3].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(_else, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(_else, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1021 + //line php7/php7.y:1570 { yyVAL.list = yyDollar[1].list } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1022 + //line php7/php7.y:1572 { yyVAL.list = nil } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1026 + //line php7/php7.y:1577 { yyVAL.list = []node.Node{yyDollar[1].node} } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1027 + //line php7/php7.y:1579 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1032 + //line php7/php7.y:1589 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) if yyDollar[1].node != nil { yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) - } else if yyDollar[2].boolWithToken.value == true { + } else if yyDollar[2].boolWithToken.value { yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].boolWithToken.token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].boolWithToken.token.Comments()) - } else if yyDollar[3].boolWithToken.value == true { + } else if yyDollar[3].boolWithToken.value { yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].boolWithToken.token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].boolWithToken.token.Comments()) } else { yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + if yyDollar[1].node != nil { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + } else if yyDollar[2].boolWithToken.value { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].boolWithToken.token, yyDollar[4].token)) + } else if yyDollar[3].boolWithToken.value { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].boolWithToken.token, yyDollar[4].token)) + } else { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + } + + // save comments + if yyDollar[2].boolWithToken.value { + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].boolWithToken.token.Comments()) + } + if yyDollar[3].boolWithToken.value { + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].boolWithToken.token.Comments()) + } + yylex.(*Parser).comments.AddComments(variable, yyDollar[4].token.Comments()) } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1060 + //line php7/php7.y:1626 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) - if yyDollar[1].node != nil { yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } else if yyDollar[2].boolWithToken.value == true { yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].boolWithToken.token, yyDollar[6].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].boolWithToken.token.Comments()) } else if yyDollar[3].boolWithToken.value == true { yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].boolWithToken.token, yyDollar[6].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].boolWithToken.token.Comments()) } else { yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[6].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + if yyDollar[1].node != nil { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) + } else if yyDollar[2].boolWithToken.value == true { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].boolWithToken.token, yyDollar[6].node)) + } else if yyDollar[3].boolWithToken.value == true { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].boolWithToken.token, yyDollar[6].node)) + } else { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[6].node)) + } + + // save comments + if yyDollar[2].boolWithToken.value { + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].boolWithToken.token.Comments()) + } + if yyDollar[3].boolWithToken.value { + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].boolWithToken.token.Comments()) + } + yylex.(*Parser).comments.AddComments(variable, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1090 + //line php7/php7.y:1666 { yyVAL.node = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1091 + //line php7/php7.y:1668 { yyVAL.node = yyDollar[1].node } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1095 + //line php7/php7.y:1673 { yyVAL.node = yyDollar[1].node } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1097 + //line php7/php7.y:1675 { yyVAL.node = node.NewNullable(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1106 + //line php7/php7.y:1688 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1112 + //line php7/php7.y:1698 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1117 + //line php7/php7.y:1708 { yyVAL.node = yyDollar[1].node } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1121 + //line php7/php7.y:1713 { yyVAL.node = nil } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1122 + //line php7/php7.y:1715 { yyVAL.node = yyDollar[2].node + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1126 + //line php7/php7.y:1725 { yyVAL.nodesWithEndToken = &nodesWithEndToken{[]node.Node{}, yyDollar[2].token} } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1127 + //line php7/php7.y:1727 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[4].token} } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1131 + //line php7/php7.y:1732 { yyVAL.list = []node.Node{yyDollar[1].node} } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1132 + //line php7/php7.y:1734 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1137 + //line php7/php7.y:1744 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1143 + //line php7/php7.y:1751 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1151 + //line php7/php7.y:1764 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1152 + //line php7/php7.y:1771 { yyVAL.list = []node.Node{yyDollar[1].node} } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1156 + //line php7/php7.y:1776 { yyVAL.node = yyDollar[1].node } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1160 + //line php7/php7.y:1781 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1161 + //line php7/php7.y:1788 { yyVAL.list = []node.Node{yyDollar[1].node} } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1166 + //line php7/php7.y:1793 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = stmt.NewStaticVar(variable, nil) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[1].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1179 + //line php7/php7.y:1807 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = stmt.NewStaticVar(variable, yyDollar[3].node) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[1].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1194 + //line php7/php7.y:1825 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1195 + //line php7/php7.y:1827 { yyVAL.list = []node.Node{} } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1200 + //line php7/php7.y:1832 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1206 + //line php7/php7.y:1842 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1212 + //line php7/php7.y:1853 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].nodesWithEndToken.nodes) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].nodesWithEndToken.endToken)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:1218 + //line php7/php7.y:1863 { name := node.NewIdentifier(yyDollar[4].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].boolWithToken.value, yyDollar[7].list, yyDollar[9].node, yyDollar[10].nodesWithEndToken.nodes, yyDollar[5].str) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[10].nodesWithEndToken.endToken)) + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + if yyDollar[3].boolWithToken.value { + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].boolWithToken.token.Comments()) + } yylex.(*Parser).comments.AddComments(name, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[8].token.Comments()) } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1230 + //line php7/php7.y:1884 { yyVAL.list = []node.Node{yyDollar[1].node} } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1231 + //line php7/php7.y:1886 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1235 + //line php7/php7.y:1896 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1236 + //line php7/php7.y:1898 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[2].token} } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1237 + //line php7/php7.y:1900 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1241 + //line php7/php7.y:1905 { yyVAL.list = []node.Node{yyDollar[1].node} } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1242 + //line php7/php7.y:1907 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1246 + //line php7/php7.y:1912 { yyVAL.node = yyDollar[1].node + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1247 + //line php7/php7.y:1919 { yyVAL.node = yyDollar[1].node + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1252 + //line php7/php7.y:1929 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1261 + //line php7/php7.y:1942 { alias := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) + + // save position + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) yylex.(*Parser).comments.AddComments(alias, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1271 + //line php7/php7.y:1955 { alias := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) + + // save position + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) yylex.(*Parser).comments.AddComments(alias, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1281 + //line php7/php7.y:1968 { alias := node.NewIdentifier(yyDollar[4].token.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) + + // save position + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) yylex.(*Parser).comments.AddComments(alias, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1291 + //line php7/php7.y:1981 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1300 + //line php7/php7.y:1994 { name := node.NewIdentifier(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = stmt.NewTraitMethodRef(nil, name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + // save comments yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1309 + //line php7/php7.y:2006 { yyVAL.node = yyDollar[1].node } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1314 + //line php7/php7.y:2011 { target := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) + + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) yylex.(*Parser).comments.AddComments(target, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1326 + //line php7/php7.y:2026 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1327 + //line php7/php7.y:2027 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1331 + //line php7/php7.y:2032 { yyVAL.list = yyDollar[1].list } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1333 + //line php7/php7.y:2034 { modifier := node.NewIdentifier(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.list = []node.Node{modifier} + + // save position + yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(modifier, yyDollar[1].token.Comments()) } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1342 + //line php7/php7.y:2048 { yyVAL.list = nil } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1343 + //line php7/php7.y:2050 { yyVAL.list = yyDollar[1].list } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1347 + //line php7/php7.y:2055 { yyVAL.list = []node.Node{yyDollar[1].node} } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1348 + //line php7/php7.y:2057 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1353 + //line php7/php7.y:2062 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1359 + //line php7/php7.y:2072 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1365 + //line php7/php7.y:2082 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1371 + //line php7/php7.y:2092 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1377 + //line php7/php7.y:2102 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1383 + //line php7/php7.y:2112 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1391 + //line php7/php7.y:2125 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1392 + //line php7/php7.y:2132 { yyVAL.list = []node.Node{yyDollar[1].node} } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1397 + //line php7/php7.y:2137 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = stmt.NewProperty(variable, nil, yyDollar[2].str) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[1].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1410 + //line php7/php7.y:2151 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = stmt.NewProperty(variable, yyDollar[3].node, yyDollar[4].str) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[1].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1425 + //line php7/php7.y:2169 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1426 + //line php7/php7.y:2176 { yyVAL.list = []node.Node{yyDollar[1].node} } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1431 + //line php7/php7.y:2181 { name := node.NewIdentifier(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + // save comments yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1444 + //line php7/php7.y:2197 { name := node.NewIdentifier(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + // save comments yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1456 + //line php7/php7.y:2213 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1457 + //line php7/php7.y:2220 { yyVAL.list = []node.Node{yyDollar[1].node} } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1461 + //line php7/php7.y:2225 { yyVAL.node = yyDollar[1].node } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1465 + //line php7/php7.y:2230 { yyVAL.list = nil } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1466 + //line php7/php7.y:2232 { yyVAL.list = yyDollar[1].list } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1469 + //line php7/php7.y:2237 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1470 + //line php7/php7.y:2244 { yyVAL.list = []node.Node{yyDollar[1].node} } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1475 + //line php7/php7.y:2249 { if yyDollar[2].nodesWithEndToken != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].nodesWithEndToken.nodes, yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) } else { yyVAL.node = stmt.NewClass(nil, nil, nil, yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) } + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + if yyDollar[3].node != nil { + yylex.(*Parser).setCommentsFromChildNode(yyVAL.node, yyDollar[3].node) + } + if yyDollar[4].list != nil { + yylex.(*Parser).setCommentsFromChildNode(yyVAL.node, firstNode(yyDollar[4].list)) + } + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[8].token.Comments()) } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1490 + //line php7/php7.y:2274 { if yyDollar[3].nodesWithEndToken != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].nodesWithEndToken.nodes) @@ -4255,1248 +4915,1746 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) } + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1501 + //line php7/php7.y:2287 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1506 + //line php7/php7.y:2300 { list := expr.NewList(yyDollar[3].list) - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) + + // save position + yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) + // save comments yylex.(*Parser).comments.AddComments(list, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(list, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(list, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1516 + //line php7/php7.y:2315 { shortList := expr.NewShortList(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(shortList, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) + + // save position + yylex.(*Parser).positions.AddPosition(shortList, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) + // save comments yylex.(*Parser).comments.AddComments(shortList, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(shortList, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1526 + //line php7/php7.y:2329 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1532 + //line php7/php7.y:2339 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1538 + //line php7/php7.y:2350 { yyVAL.node = expr.NewClone(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1544 + //line php7/php7.y:2360 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1550 + //line php7/php7.y:2370 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1556 + //line php7/php7.y:2380 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1562 + //line php7/php7.y:2390 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1568 + //line php7/php7.y:2400 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1574 + //line php7/php7.y:2410 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1580 + //line php7/php7.y:2420 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1586 + //line php7/php7.y:2430 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1592 + //line php7/php7.y:2440 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1598 + //line php7/php7.y:2450 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1604 + //line php7/php7.y:2460 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1610 + //line php7/php7.y:2470 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1616 + //line php7/php7.y:2480 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1622 + //line php7/php7.y:2490 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1628 + //line php7/php7.y:2500 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1634 + //line php7/php7.y:2510 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1640 + //line php7/php7.y:2520 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1646 + //line php7/php7.y:2530 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1652 + //line php7/php7.y:2540 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1658 + //line php7/php7.y:2550 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1664 + //line php7/php7.y:2560 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1670 + //line php7/php7.y:2570 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1676 + //line php7/php7.y:2580 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1682 + //line php7/php7.y:2590 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1688 + //line php7/php7.y:2600 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1694 + //line php7/php7.y:2605 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1700 + //line php7/php7.y:2615 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1706 + //line php7/php7.y:2625 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1712 + //line php7/php7.y:2635 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1718 + //line php7/php7.y:2645 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1724 + //line php7/php7.y:2655 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1730 + //line php7/php7.y:2665 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1736 + //line php7/php7.y:2675 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1742 + //line php7/php7.y:2685 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1748 + //line php7/php7.y:2695 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1754 + //line php7/php7.y:2705 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1760 + //line php7/php7.y:2715 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1766 + //line php7/php7.y:2725 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1772 + //line php7/php7.y:2735 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1778 + //line php7/php7.y:2745 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1784 + //line php7/php7.y:2755 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1790 + //line php7/php7.y:2765 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1796 + //line php7/php7.y:2775 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1802 + //line php7/php7.y:2785 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1808 + //line php7/php7.y:2795 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1814 + //line php7/php7.y:2805 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1820 + //line php7/php7.y:2815 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1825 + //line php7/php7.y:2825 { yyVAL.node = yyDollar[2].node + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1826 + //line php7/php7.y:2833 { yyVAL.node = yyDollar[1].node } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1828 + //line php7/php7.y:2835 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1834 + //line php7/php7.y:2846 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1840 + //line php7/php7.y:2857 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1845 + //line php7/php7.y:2867 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1847 + //line php7/php7.y:2869 { yyVAL.node = cast.NewInt(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1853 + //line php7/php7.y:2879 { yyVAL.node = cast.NewDouble(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1859 + //line php7/php7.y:2889 { yyVAL.node = cast.NewString(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1865 + //line php7/php7.y:2899 { yyVAL.node = cast.NewArray(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1871 + //line php7/php7.y:2909 { yyVAL.node = cast.NewObject(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1877 + //line php7/php7.y:2919 { yyVAL.node = cast.NewBool(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1883 + //line php7/php7.y:2929 { yyVAL.node = cast.NewUnset(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1889 + //line php7/php7.y:2939 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) } else { yyVAL.node = expr.NewExit(yyDollar[2].node) } + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1899 + //line php7/php7.y:2953 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1904 + //line php7/php7.y:2963 { yyVAL.node = yyDollar[1].node } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1906 + //line php7/php7.y:2965 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1912 + //line php7/php7.y:2976 { yyVAL.node = expr.NewPrint(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1918 + //line php7/php7.y:2986 { yyVAL.node = expr.NewYield(nil, nil) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1924 + //line php7/php7.y:2996 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1930 + //line php7/php7.y:3006 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1936 + //line php7/php7.y:3017 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1942 + //line php7/php7.y:3027 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].boolWithToken.value, yyDollar[3].str) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + if yyDollar[2].boolWithToken.value { + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].boolWithToken.token.Comments()) + } + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[9].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[11].token.Comments()) } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:1949 + //line php7/php7.y:3044 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].list, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].boolWithToken.value, yyDollar[4].str) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[12].token)) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + if yyDollar[3].boolWithToken.value { + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].boolWithToken.token.Comments()) + } + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[7].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[10].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[12].token.Comments()) } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1958 + //line php7/php7.y:3065 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1962 + //line php7/php7.y:3073 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1963 + //line php7/php7.y:3075 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1967 + //line php7/php7.y:3080 { yyVAL.list = []node.Node{} } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1968 + //line php7/php7.y:3082 { yyVAL.list = yyDollar[3].list } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1972 + //line php7/php7.y:3087 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1973 + //line php7/php7.y:3094 { yyVAL.list = []node.Node{yyDollar[1].node} } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1978 + //line php7/php7.y:3099 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = expr.NewClosureUse(variable, false) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[1].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1991 + //line php7/php7.y:3113 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yyVAL.node = expr.NewClosureUse(variable, true) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddComments(variable, yyDollar[2].token.Comments()) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2007 + //line php7/php7.y:3131 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].nodesWithEndToken.nodes) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].nodesWithEndToken.endToken)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2013 + //line php7/php7.y:3138 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2019 + //line php7/php7.y:3148 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2025 + //line php7/php7.y:3158 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].nodesWithEndToken.nodes) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].nodesWithEndToken.endToken)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2034 + //line php7/php7.y:3168 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2039 + //line php7/php7.y:3178 { yyVAL.node = yyDollar[1].node } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2043 + //line php7/php7.y:3183 { yyVAL.node = yyDollar[1].node } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2044 + //line php7/php7.y:3185 { yyVAL.node = yyDollar[1].node } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2048 + //line php7/php7.y:3190 { yyVAL.node = nil } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2049 + //line php7/php7.y:3192 { yyVAL.node = yyDollar[2].node } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2053 + //line php7/php7.y:3197 { yyVAL.list = []node.Node{} } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2054 + //line php7/php7.y:3199 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2055 + //line php7/php7.y:3201 { yyVAL.list = yyDollar[1].list } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2059 + //line php7/php7.y:3206 { yyVAL.nodesWithEndToken = nil } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2060 + //line php7/php7.y:3208 { yyVAL.nodesWithEndToken = yyDollar[1].nodesWithEndToken } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2065 + //line php7/php7.y:3213 { yyVAL.node = expr.NewArray(yyDollar[3].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2071 + //line php7/php7.y:3225 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2077 + //line php7/php7.y:3236 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2086 + //line php7/php7.y:3249 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2092 + //line php7/php7.y:3259 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2098 + //line php7/php7.y:3269 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2104 + //line php7/php7.y:3279 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2110 + //line php7/php7.y:3289 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2116 + //line php7/php7.y:3299 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2122 + //line php7/php7.y:3309 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2128 + //line php7/php7.y:3319 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2134 + //line php7/php7.y:3329 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2140 + //line php7/php7.y:3339 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2146 + //line php7/php7.y:3349 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(encapsed, yyDollar[2].token.Comments()) - yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) + + // save position + yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2156 + //line php7/php7.y:3361 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2162 + //line php7/php7.y:3371 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2168 + //line php7/php7.y:3381 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2173 + //line php7/php7.y:3391 { yyVAL.node = yyDollar[1].node } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2174 + //line php7/php7.y:3393 { yyVAL.node = yyDollar[1].node } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2179 + //line php7/php7.y:3398 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2185 + //line php7/php7.y:3405 { target := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) + + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) yylex.(*Parser).comments.AddComments(target, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2195 + //line php7/php7.y:3418 { target := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) + + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) yylex.(*Parser).comments.AddComments(target, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2207 + //line php7/php7.y:3434 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2208 + //line php7/php7.y:3436 { yyVAL.node = yyDollar[1].node } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2212 + //line php7/php7.y:3441 { yyVAL.node = nil } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2213 + //line php7/php7.y:3443 { yyVAL.node = yyDollar[1].node } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2217 + //line php7/php7.y:3448 { yyVAL.node = yyDollar[1].node } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2221 + //line php7/php7.y:3453 { yyVAL.node = yyDollar[1].node } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2222 + //line php7/php7.y:3455 { yyVAL.node = yyDollar[2].node + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2223 + //line php7/php7.y:3463 { yyVAL.node = yyDollar[1].node } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2227 + //line php7/php7.y:3468 { yyVAL.node = yyDollar[1].node } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2228 + //line php7/php7.y:3470 { yyVAL.node = yyDollar[2].node + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2229 + //line php7/php7.y:3478 { yyVAL.node = yyDollar[1].node } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2233 + //line php7/php7.y:3483 { yyVAL.node = yyDollar[1].node } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2235 + //line php7/php7.y:3485 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2241 + //line php7/php7.y:3496 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2247 + //line php7/php7.y:3507 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2253 + //line php7/php7.y:3518 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2258 + //line php7/php7.y:3528 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2262 + //line php7/php7.y:3533 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2263 + //line php7/php7.y:3535 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2265 + //line php7/php7.y:3537 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2274 + //line php7/php7.y:3550 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = expr.NewVariable(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2284 + //line php7/php7.y:3562 { yyVAL.node = expr.NewVariable(yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2290 + //line php7/php7.y:3574 { yyVAL.node = expr.NewVariable(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2299 + //line php7/php7.y:3587 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2305 + //line php7/php7.y:3597 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2313 + //line php7/php7.y:3610 { yyVAL.node = yyDollar[1].node } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2315 + //line php7/php7.y:3612 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2321 + //line php7/php7.y:3623 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2327 + //line php7/php7.y:3634 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2333 + //line php7/php7.y:3644 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2339 + //line php7/php7.y:3654 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2348 + //line php7/php7.y:3667 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2353 + //line php7/php7.y:3677 { yyVAL.node = yyDollar[2].node + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2354 + //line php7/php7.y:3685 { yyVAL.node = yyDollar[1].node } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2359 + //line php7/php7.y:3690 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2364 + //line php7/php7.y:3700 { yyVAL.node = yyDollar[2].node + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2365 + //line php7/php7.y:3708 { yyVAL.node = yyDollar[1].node } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2370 + //line php7/php7.y:3713 { if yyDollar[1].list[len(yyDollar[1].list)-1] == nil { yyVAL.list = yyDollar[1].list[:len(yyDollar[1].list)-1] @@ -5506,327 +6664,442 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2380 + //line php7/php7.y:3724 { yyVAL.node = nil } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2381 + //line php7/php7.y:3726 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2386 + //line php7/php7.y:3731 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2387 + //line php7/php7.y:3738 { yyVAL.list = []node.Node{yyDollar[1].node} } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2392 + //line php7/php7.y:3743 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2398 + //line php7/php7.y:3753 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2404 + //line php7/php7.y:3760 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2410 + //line php7/php7.y:3771 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[2].node, true) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2416 + //line php7/php7.y:3781 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[6].token)) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, list, false) + + // save position + yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[6].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[6].token)) + // save comments + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) yylex.(*Parser).comments.AddComments(list, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + yylex.(*Parser).comments.AddComments(list, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddComments(list, yyDollar[6].token.Comments()) } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2427 + //line php7/php7.y:3797 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) yyVAL.node = expr.NewArrayItem(nil, list, false) + + // save position + yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + // save comments yylex.(*Parser).comments.AddComments(list, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(list, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(list, yyDollar[4].token.Comments()) } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2440 + //line php7/php7.y:3815 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2442 + //line php7/php7.y:3817 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yyVAL.list = append(yyDollar[1].list, encapsed) + + // save position + yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + + // save comments yylex.(*Parser).comments.AddComments(encapsed, yyDollar[2].token.Comments()) } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2448 + //line php7/php7.y:3828 { yyVAL.list = []node.Node{yyDollar[1].node} } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2450 + //line php7/php7.y:3830 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} + + // save position + yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(encapsed, yyDollar[1].token.Comments()) } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2460 + //line php7/php7.y:3844 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = expr.NewVariable(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2470 + //line php7/php7.y:3856 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = expr.NewArrayDimFetch(variable, yyDollar[3].node) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[1].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2483 + //line php7/php7.y:3872 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) fetch := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.node = expr.NewPropertyFetch(variable, fetch) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[1].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) yylex.(*Parser).comments.AddComments(fetch, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2499 + //line php7/php7.y:3890 { yyVAL.node = expr.NewVariable(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2505 + //line php7/php7.y:3901 { name := node.NewIdentifier(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yyVAL.node = expr.NewVariable(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[2].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(name, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2515 + //line php7/php7.y:3915 { identifier := node.NewIdentifier(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yyVAL.node = expr.NewArrayDimFetch(variable, yyDollar[4].node) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(variable, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2528 + //line php7/php7.y:3933 { yyVAL.node = yyDollar[2].node } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2532 + //line php7/php7.y:3939 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2538 + //line php7/php7.y:3949 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) } else { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) } + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2550 + //line php7/php7.y:3964 { + var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer - if _, err := strconv.Atoi(yyDollar[2].token.Value); err == nil { - lnumber := scalar.NewLnumber(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(lnumber, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) - yyVAL.node = expr.NewUnaryMinus(lnumber) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + _, err := strconv.Atoi(yyDollar[2].token.Value) + isInt := err == nil - yylex.(*Parser).comments.AddComments(lnumber, yyDollar[1].token.Comments()) + if isInt { + lnumber = scalar.NewLnumber(yyDollar[2].token.Value) + yyVAL.node = expr.NewUnaryMinus(lnumber) } else { yyDollar[2].token.Value = "-" + yyDollar[2].token.Value yyVAL.node = scalar.NewString(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) } + // save position + if isInt { + yylex.(*Parser).positions.AddPosition(lnumber, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + } + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + if isInt { + yylex.(*Parser).comments.AddComments(lnumber, yyDollar[2].token.Comments()) + } else { + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + } } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2568 + //line php7/php7.y:3993 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = expr.NewVariable(identifier) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[1].token.Comments()) + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:2581 + //line php7/php7.y:4008 { yyVAL.node = expr.NewIsset(yyDollar[3].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + if yyDollar[4].token != nil { + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + } + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2587 + //line php7/php7.y:4023 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2593 + //line php7/php7.y:4035 { yyVAL.node = expr.NewInclude(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2599 + //line php7/php7.y:4045 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2605 + //line php7/php7.y:4055 { yyVAL.node = expr.NewEval(yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2611 + //line php7/php7.y:4067 { yyVAL.node = expr.NewRequire(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2617 + //line php7/php7.y:4077 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2625 + //line php7/php7.y:4090 { yyVAL.list = []node.Node{yyDollar[1].node} } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2626 + //line php7/php7.y:4092 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2630 + //line php7/php7.y:4102 { yyVAL.node = yyDollar[1].node } diff --git a/php7/php7.y b/php7/php7.y index 581e578..bb72887 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -143,6 +143,29 @@ import ( %token T_COALESCE %token T_SPACESHIP %token T_NOELSE +%token T_PLUS_EQUAL +%token T_MINUS_EQUAL +%token T_MUL_EQUAL +%token T_POW_EQUAL +%token T_DIV_EQUAL +%token T_CONCAT_EQUAL +%token T_MOD_EQUAL +%token T_AND_EQUAL +%token T_OR_EQUAL +%token T_XOR_EQUAL +%token T_SL_EQUAL +%token T_SR_EQUAL +%token T_BOOLEAN_OR +%token T_BOOLEAN_AND +%token T_POW +%token T_SL +%token T_SR +%token T_IS_IDENTICAL +%token T_IS_NOT_IDENTICAL +%token T_IS_EQUAL +%token T_IS_NOT_EQUAL +%token T_IS_SMALLER_OR_EQUAL +%token T_IS_GREATER_OR_EQUAL %token '"' %token '`' %token '{' @@ -161,6 +184,15 @@ import ( %token '~' %token '@' %token '$' +%token ',' +%token '|' +%token '=' +%token '^' +%token '*' +%token '/' +%token '%' +%token '<' +%token '>' %left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE %left ',' @@ -201,6 +233,8 @@ import ( %type reserved_non_modifiers %type semi_reserved %type identifier +%type possible_comma +%type case_separator %type top_statement name statement function_declaration_statement %type class_declaration_statement trait_declaration_statement @@ -253,11 +287,13 @@ import ( ///////////////////////////////////////////////////////////////////////// start: - top_statement_list - { - yylex.(*Parser).rootNode = stmt.NewStmtList($1) - yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - } + top_statement_list + { + yylex.(*Parser).rootNode = stmt.NewStmtList($1) + + // save position + yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + } ; reserved_non_modifiers: @@ -271,153 +307,269 @@ reserved_non_modifiers: ; semi_reserved: - reserved_non_modifiers {$$=$1} - | T_STATIC {$$=$1} | T_ABSTRACT {$$=$1} | T_FINAL {$$=$1} | T_PRIVATE {$$=$1} | T_PROTECTED {$$=$1} | T_PUBLIC {$$=$1} + reserved_non_modifiers + { $$ = $1 } + | T_STATIC {$$=$1} | T_ABSTRACT {$$=$1} | T_FINAL {$$=$1} | T_PRIVATE {$$=$1} | T_PROTECTED {$$=$1} | T_PUBLIC {$$=$1} ; identifier: - T_STRING { $$ = $1 } - | semi_reserved { $$ = $1 } + T_STRING + { $$ = $1 } + | semi_reserved + { $$ = $1 } ; top_statement_list: - top_statement_list top_statement - { - if $2 != nil { - $$ = append($1, $2) + top_statement_list top_statement + { + if $2 != nil { + $$ = append($1, $2) + } } - } - | /* empty */ { $$ = []node.Node{} } + | /* empty */ + { $$ = []node.Node{} } ; namespace_name: - T_STRING - { - namePart := name.NewNamePart($1.Value) - yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$ = []node.Node{namePart} - yylex.(*Parser).comments.AddComments(namePart, $1.Comments()) - } + T_STRING + { + namePart := name.NewNamePart($1.Value) + $$ = []node.Node{namePart} + + // save position + yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments(namePart, $1.Comments()) + } | namespace_name T_NS_SEPARATOR T_STRING - { - namePart := name.NewNamePart($3.Value) - yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$ = append($1, namePart) - yylex.(*Parser).comments.AddComments(namePart, $3.Comments()) - } + { + namePart := name.NewNamePart($3.Value) + $$ = append($1, namePart) + + // save position + yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddComments(namePart, $3.Comments()) + } ; name: - namespace_name - { - $$ = name.NewName($1) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) - } + namespace_name + { + $$ = name.NewName($1) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + } | T_NAMESPACE T_NS_SEPARATOR namespace_name - { - $$ = name.NewRelative($3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = name.NewRelative($3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } | T_NS_SEPARATOR namespace_name - { - $$ = name.NewFullyQualified($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = name.NewFullyQualified($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } ; top_statement: - error - { - // error - $$ = nil - } - | statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | trait_declaration_statement { $$ = $1; } - | interface_declaration_statement { $$ = $1; } - | T_HALT_COMPILER '(' ')' ';' { $$ = stmt.NewHaltCompiler() } + error + { + // error + $$ = nil + } + | statement + { $$ = $1; } + | function_declaration_statement + { $$ = $1; } + | class_declaration_statement + { $$ = $1; } + | trait_declaration_statement + { $$ = $1; } + | interface_declaration_statement + { $$ = $1; } + | T_HALT_COMPILER '(' ')' ';' + { + $$ = stmt.NewHaltCompiler() + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } | T_NAMESPACE namespace_name ';' - { - name := name.NewName($2) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$ = stmt.NewNamespace(name, nil) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + { + name := name.NewName($2) + $$ = stmt.NewNamespace(name, nil) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } | T_NAMESPACE namespace_name '{' top_statement_list '}' - { - name := name.NewName($2) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$ = stmt.NewNamespace(name, $4) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + { + name := name.NewName($2) + $$ = stmt.NewNamespace(name, $4) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddComments($$, $5.Comments()) + } | T_NAMESPACE '{' top_statement_list '}' - { - $$ = stmt.NewNamespace(nil, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_USE mixed_group_use_declaration ';' { $$ = $2 } - | T_USE use_type group_use_declaration ';' { $$ = $3.(*stmt.GroupUse).SetUseType($2) } + { + $$ = stmt.NewNamespace(nil, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } + | T_USE mixed_group_use_declaration ';' + { + $$ = $2 + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } + | T_USE use_type group_use_declaration ';' + { + $$ = $3.(*stmt.GroupUse).SetUseType($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } | T_USE use_declarations ';' - { - $$ = stmt.NewUseList(nil, $2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_USE use_type use_declarations ';' { $$ = stmt.NewUseList($2, $3) } + { + $$ = stmt.NewUseList(nil, $2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } + | T_USE use_type use_declarations ';' + { + $$ = stmt.NewUseList($2, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } | T_CONST const_list ';' - { - $$ = stmt.NewConstList($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = stmt.NewConstList($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } ; use_type: - T_FUNCTION - { - $$ = node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + T_FUNCTION + { + $$ = node.NewIdentifier($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_CONST - { - $$ = node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = node.NewIdentifier($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } ; group_use_declaration: namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { name := name.NewName($1) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) $$ = stmt.NewGroupUse(nil, name, $4) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($1)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + if $5 != nil { + yylex.(*Parser).comments.AddComments($$, $5.Comments()) + } + yylex.(*Parser).comments.AddComments($$, $6.Comments()) } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { name := name.NewName($2) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) $$ = stmt.NewGroupUse(nil, name, $5) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($2)) + // save comments yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + if $6 != nil { + yylex.(*Parser).comments.AddComments($$, $6.Comments()) + } + yylex.(*Parser).comments.AddComments($$, $7.Comments()) } ; @@ -425,247 +577,421 @@ mixed_group_use_declaration: namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { name := name.NewName($1) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) $$ = stmt.NewGroupUse(nil, name, $4) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($1)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + if $5 != nil { + yylex.(*Parser).comments.AddComments($$, $5.Comments()) + } + yylex.(*Parser).comments.AddComments($$, $6.Comments()) } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { name := name.NewName($2) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) $$ = stmt.NewGroupUse(nil, name, $5) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($2)) + // save comments yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + if $6 != nil { + yylex.(*Parser).comments.AddComments($$, $6.Comments()) + } + yylex.(*Parser).comments.AddComments($$, $7.Comments()) } ; possible_comma: /* empty */ + { $$ = nil } | ',' + { $$ = $1 } ; inline_use_declarations: inline_use_declarations ',' inline_use_declaration - { $$ = append($1, $3) } - | inline_use_declaration { $$ = []node.Node{$1} } + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } + | inline_use_declaration + { $$ = []node.Node{$1} } ; unprefixed_use_declarations: unprefixed_use_declarations ',' unprefixed_use_declaration - { $$ = append($1, $3) } - | unprefixed_use_declaration { $$ = []node.Node{$1} } + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } + | unprefixed_use_declaration + { $$ = []node.Node{$1} } ; use_declarations: - use_declarations ',' use_declaration { $$ = append($1, $3) } - | use_declaration { $$ = []node.Node{$1} } + use_declarations ',' use_declaration + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } + | use_declaration + { $$ = []node.Node{$1} } ; inline_use_declaration: - unprefixed_use_declaration { $$ = $1; } - | use_type unprefixed_use_declaration { $$ = $2.(*stmt.Use).SetUseType($1) } + unprefixed_use_declaration + { $$ = $1 } + | use_type unprefixed_use_declaration + { $$ = $2.(*stmt.Use).SetUseType($1) } ; unprefixed_use_declaration: - namespace_name - { - name := name.NewName($1) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$ = stmt.NewUse(nil, name, nil) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + namespace_name + { + name := name.NewName($1) + $$ = stmt.NewUse(nil, name, nil) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($1)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) - } + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + } | namespace_name T_AS T_STRING - { - name := name.NewName($1) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - alias := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$ = stmt.NewUse(nil, name, alias) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) + { + name := name.NewName($1) + alias := node.NewIdentifier($3.Value) + $$ = stmt.NewUse(nil, name, alias) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($1)) - yylex.(*Parser).comments.AddComments(alias, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) - } + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments(alias, $3.Comments()) + } ; use_declaration: - unprefixed_use_declaration { $$ = $1; } - | T_NS_SEPARATOR unprefixed_use_declaration { $$ = $2; } + unprefixed_use_declaration + { $$ = $1; } + | T_NS_SEPARATOR unprefixed_use_declaration + { + $$ = $2; + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } ; const_list: - const_list ',' const_decl { $$ = append($1, $3) } - | const_decl { $$ = []node.Node{$1} } + const_list ',' const_decl + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } + | const_decl + { $$ = []node.Node{$1} } ; inner_statement_list: - inner_statement_list inner_statement - { - if $2 != nil { - $$ = append($1, $2) + inner_statement_list inner_statement + { + if $2 != nil { + $$ = append($1, $2) + } } - } - | /* empty */ { $$ = []node.Node{} } + | /* empty */ + { $$ = []node.Node{} } ; inner_statement: - error - { - // error - $$ = nil - } - | statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | trait_declaration_statement { $$ = $1; } - | interface_declaration_statement { $$ = $1; } + error + { + // error + $$ = nil + } + | statement + { $$ = $1; } + | function_declaration_statement + { $$ = $1; } + | class_declaration_statement + { $$ = $1; } + | trait_declaration_statement + { $$ = $1; } + | interface_declaration_statement + { $$ = $1; } | T_HALT_COMPILER '(' ')' ';' - { - $$ = stmt.NewHaltCompiler() - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = stmt.NewHaltCompiler() + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } statement: - '{' inner_statement_list '}' - { - $$ = stmt.NewStmtList($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | if_stmt { $$ = $1; } - | alt_if_stmt { $$ = $1; } + '{' inner_statement_list '}' + { + $$ = stmt.NewStmtList($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } + | if_stmt + { $$ = $1; } + | alt_if_stmt + { $$ = $1; } | T_WHILE '(' expr ')' while_statement - { - if ($5.isAlt) { - $$ = stmt.NewAltWhile($3, $5.node) - } else { - $$ = stmt.NewWhile($3, $5.node) + { + if ($5.isAlt) { + $$ = stmt.NewAltWhile($3, $5.node) + } else { + $$ = stmt.NewWhile($3, $5.node) + } + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5.node)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) } - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5.node)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } | T_DO statement T_WHILE '(' expr ')' ';' - { - $$ = stmt.NewDo($2, $5) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = stmt.NewDo($2, $5) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddComments($$, $6.Comments()) + yylex.(*Parser).comments.AddComments($$, $7.Comments()) + } | T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement - { - if ($9.isAlt) { - $$ = stmt.NewAltFor($3, $5, $7, $9.node) - } else { - $$ = stmt.NewFor($3, $5, $7, $9.node) + { + if ($9.isAlt) { + $$ = stmt.NewAltFor($3, $5, $7, $9.node) + } else { + $$ = stmt.NewFor($3, $5, $7, $9.node) + } + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9.node)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddComments($$, $6.Comments()) + yylex.(*Parser).comments.AddComments($$, $8.Comments()) } - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9.node)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } | T_SWITCH '(' expr ')' switch_case_list - { - if ($5.endToken.Value == ";") { - $$ = stmt.NewAltSwitch($3, $5.nodes) - } else { - $$ = stmt.NewSwitch($3, $5.nodes) + { + if ($5.endToken.Value == ";") { + $$ = stmt.NewAltSwitch($3, $5.nodes) + } else { + $$ = stmt.NewSwitch($3, $5.nodes) + } + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5.endToken)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) } - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5.endToken)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } | T_BREAK optional_expr ';' - { - $$ = stmt.NewBreak($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = stmt.NewBreak($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } | T_CONTINUE optional_expr ';' - { - $$ = stmt.NewContinue($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = stmt.NewContinue($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } | T_RETURN optional_expr ';' - { - $$ = stmt.NewReturn($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = stmt.NewReturn($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } | T_GLOBAL global_var_list ';' - { - $$ = stmt.NewGlobal($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = stmt.NewGlobal($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } | T_STATIC static_var_list ';' - { - $$ = stmt.NewStatic($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = stmt.NewStatic($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } | T_ECHO echo_expr_list ';' - { - $$ = stmt.NewEcho($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = stmt.NewEcho($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } | T_INLINE_HTML - { - $$ = stmt.NewInlineHtml($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = stmt.NewInlineHtml($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | expr ';' - { - $$ = stmt.NewExpression($1) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + { + $$ = stmt.NewExpression($1) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } | T_UNSET '(' unset_variables possible_comma ')' ';' - { - $$ = stmt.NewUnset($3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = stmt.NewUnset($3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + if $4 != nil { + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } + yylex.(*Parser).comments.AddComments($$, $5.Comments()) + yylex.(*Parser).comments.AddComments($$, $6.Comments()) + } | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement - { - if ($7.isAlt) { - $$ = stmt.NewAltForeach($3, nil, $5.node, $7.node, $5.byRef) - } else { - $$ = stmt.NewForeach($3, nil, $5.node, $7.node, $5.byRef) + { + if ($7.isAlt) { + $$ = stmt.NewAltForeach($3, nil, $5.node, $7.node, $5.byRef) + } else { + $$ = stmt.NewForeach($3, nil, $5.node, $7.node, $5.byRef) + } + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7.node)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddComments($$, $6.Comments()) } - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7.node)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement - { - if ($9.isAlt) { - $$ = stmt.NewAltForeach($3, $5, $7.node, $9.node, $7.byRef) - } else { - $$ = stmt.NewForeach($3, $5, $7.node, $9.node, $7.byRef) + { + if ($9.isAlt) { + $$ = stmt.NewAltForeach($3, $5, $7.node, $9.node, $7.byRef) + } else { + $$ = stmt.NewForeach($3, $5, $7.node, $9.node, $7.byRef) + } + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9.node)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddComments($$, $6.Comments()) + yylex.(*Parser).comments.AddComments($$, $8.Comments()) } - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9.node)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } | T_DECLARE '(' const_list ')' declare_statement - { - $$ = stmt.NewDeclare($3, $5) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = stmt.NewDeclare($3, $5) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } | ';' - { - $$ = stmt.NewNop() - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = stmt.NewNop() + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_TRY '{' inner_statement_list '}' catch_list finally_statement { if $6 == nil { @@ -676,200 +1002,345 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) } + // save comments yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) } | T_THROW expr ';' - { - $$ = stmt.NewThrow($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = stmt.NewThrow($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } | T_GOTO T_STRING ';' - { - label := node.NewIdentifier($2.Value) - yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$ = stmt.NewGoto(label) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + { + label := node.NewIdentifier($2.Value) + $$ = stmt.NewGoto(label) - yylex.(*Parser).comments.AddComments(label, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments(label, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } | T_STRING ':' - { - label := node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$ = stmt.NewLabel(label) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + { + label := node.NewIdentifier($1.Value) + $$ = stmt.NewLabel(label) - yylex.(*Parser).comments.AddComments(label, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments(label, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } catch_list: - /* empty */ { $$ = []node.Node{} } + /* empty */ + { $$ = []node.Node{} } | catch_list T_CATCH '(' catch_name_list T_VARIABLE ')' '{' inner_statement_list '}' - { - identifier := node.NewIdentifier(strings.TrimLeft($5.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($5)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($5)) - catch := stmt.NewCatch($4, variable, $8) - yylex.(*Parser).positions.AddPosition(catch, yylex.(*Parser).positionBuilder.NewTokensPosition($2, $9)) - $$ = append($1, catch) + { + identifier := node.NewIdentifier(strings.TrimLeft($5.Value, "$")) + variable := expr.NewVariable(identifier) + catch := stmt.NewCatch($4, variable, $8) + $$ = append($1, catch) - yylex.(*Parser).comments.AddComments(identifier, $5.Comments()) - yylex.(*Parser).comments.AddComments(variable, $5.Comments()) - yylex.(*Parser).comments.AddComments(catch, $2.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($5)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($5)) + yylex.(*Parser).positions.AddPosition(catch, yylex.(*Parser).positionBuilder.NewTokensPosition($2, $9)) + + // save comments + yylex.(*Parser).comments.AddComments(catch, $2.Comments()) + yylex.(*Parser).comments.AddComments(catch, $3.Comments()) + yylex.(*Parser).comments.AddComments(variable, $5.Comments()) + yylex.(*Parser).comments.AddComments(catch, $6.Comments()) + yylex.(*Parser).comments.AddComments(catch, $7.Comments()) + yylex.(*Parser).comments.AddComments(catch, $9.Comments()) + } ; catch_name_list: - name { $$ = []node.Node{$1} } - | catch_name_list '|' name { $$ = append($1, $3) } + name + { $$ = []node.Node{$1} } + | catch_name_list '|' name + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } ; finally_statement: - /* empty */ { $$ = nil } + /* empty */ + { $$ = nil } | T_FINALLY '{' inner_statement_list '}' - { - $$ = stmt.NewFinally($3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = stmt.NewFinally($3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } ; unset_variables: - unset_variable { $$ = []node.Node{$1} } - | unset_variables ',' unset_variable { $$ = append($1, $3) } + unset_variable + { $$ = []node.Node{$1} } + | unset_variables ',' unset_variable + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } ; unset_variable: - variable { $$ = $1 } + variable + { $$ = $1 } ; function_declaration_statement: - T_FUNCTION returns_ref T_STRING backup_doc_comment '(' parameter_list ')' return_type '{' inner_statement_list '}' - { - name := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$ = stmt.NewFunction(name, $2.value, $6, $8, $10, $4) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) + T_FUNCTION returns_ref T_STRING backup_doc_comment '(' parameter_list ')' return_type '{' inner_statement_list '}' + { + name := node.NewIdentifier($3.Value) + $$ = stmt.NewFunction(name, $2.value, $6, $8, $10, $4) - yylex.(*Parser).comments.AddComments(name, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + if $2.token != nil { + yylex.(*Parser).comments.AddComments($$, $2.token.Comments()) + } + yylex.(*Parser).comments.AddComments(name, $3.Comments()) + yylex.(*Parser).comments.AddComments(name, $5.Comments()) + yylex.(*Parser).comments.AddComments(name, $7.Comments()) + yylex.(*Parser).comments.AddComments(name, $9.Comments()) + yylex.(*Parser).comments.AddComments(name, $11.Comments()) + } ; is_reference: - /* empty */ { $$ = boolWithToken{false, nil} } - | '&' { $$ = boolWithToken{true, $1} } + /* empty */ + { $$ = boolWithToken{false, nil} } + | '&' + { $$ = boolWithToken{true, $1} } ; is_variadic: - /* empty */ { $$ = boolWithToken{false, nil} } - | T_ELLIPSIS { $$ = boolWithToken{true, $1} } + /* empty */ + { $$ = boolWithToken{false, nil} } + | T_ELLIPSIS + { $$ = boolWithToken{true, $1} } ; class_declaration_statement: class_modifiers T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' - { - name := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$ = stmt.NewClass(name, $1, nil, $4, $5, $8, $6) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $9)) - - yylex.(*Parser).comments.AddComments(name, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) - } - | T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' - { - name := node.NewIdentifier($2.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$ = stmt.NewClass(name, nil, nil, $3, $4, $7, $5) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) + { + name := node.NewIdentifier($3.Value) + $$ = stmt.NewClass(name, $1, nil, $4, $5, $8, $6) - yylex.(*Parser).comments.AddComments(name, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $9)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments(name, $3.Comments()) + if $4 != nil { + yylex.(*Parser).setCommentsFromChildNode($$, $4) + } + if $5 != nil { + yylex.(*Parser).setCommentsFromChildNode($$, firstNode($5)) + } + yylex.(*Parser).comments.AddComments($$, $7.Comments()) + yylex.(*Parser).comments.AddComments($$, $9.Comments()) + } + | T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' + { + name := node.NewIdentifier($2.Value) + $$ = stmt.NewClass(name, nil, nil, $3, $4, $7, $5) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments(name, $2.Comments()) + if $3 != nil { + yylex.(*Parser).setCommentsFromChildNode($$, $3) + } + if $4 != nil { + yylex.(*Parser).setCommentsFromChildNode($$, firstNode($4)) + } + yylex.(*Parser).comments.AddComments($$, $6.Comments()) + yylex.(*Parser).comments.AddComments($$, $8.Comments()) + } ; class_modifiers: - class_modifier { $$ = []node.Node{$1} } - | class_modifiers class_modifier { $$ = append($1, $2) } + class_modifier + { $$ = []node.Node{$1} } + | class_modifiers class_modifier + { $$ = append($1, $2) } ; class_modifier: - T_ABSTRACT - { - $$ = node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + T_ABSTRACT + { + $$ = node.NewIdentifier($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_FINAL - { - $$ = node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = node.NewIdentifier($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } ; trait_declaration_statement: - T_TRAIT T_STRING backup_doc_comment '{' class_statement_list '}' - { - name := node.NewIdentifier($2.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$ = stmt.NewTrait(name, $5, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) + T_TRAIT T_STRING backup_doc_comment '{' class_statement_list '}' + { + name := node.NewIdentifier($2.Value) + $$ = stmt.NewTrait(name, $5, $3) - yylex.(*Parser).comments.AddComments(name, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments(name, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddComments($$, $6.Comments()) + } ; interface_declaration_statement: - T_INTERFACE T_STRING interface_extends_list backup_doc_comment '{' class_statement_list '}' - { - name := node.NewIdentifier($2.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$ = stmt.NewInterface(name, $3, $6, $4) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) - - yylex.(*Parser).comments.AddComments(name, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + T_INTERFACE T_STRING interface_extends_list backup_doc_comment '{' class_statement_list '}' + { + name := node.NewIdentifier($2.Value) + $$ = stmt.NewInterface(name, $3, $6, $4) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments(name, $2.Comments()) + if $3 != nil { + yylex.(*Parser).setCommentsFromChildNode($$, firstNode($3)) + } + yylex.(*Parser).comments.AddComments($$, $5.Comments()) + yylex.(*Parser).comments.AddComments($$, $7.Comments()) + } ; extends_from: - /* empty */ { $$ = nil } - | T_EXTENDS name { $$ = $2; } + /* empty */ + { $$ = nil } + | T_EXTENDS name + { + $$ = $2; + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } ; interface_extends_list: - /* empty */ { $$ = nil } - | T_EXTENDS name_list { $$ = $2 } + /* empty */ + { $$ = nil } + | T_EXTENDS name_list + { + $$ = $2; + + // save comments + yylex.(*Parser).comments.AddComments(firstNode($$), $1.Comments()) + } ; implements_list: - /* empty */ { $$ = nil } - | T_IMPLEMENTS name_list { $$ = $2 } + /* empty */ + { $$ = nil } + | T_IMPLEMENTS name_list + { + $$ = $2; + + // save comments + yylex.(*Parser).comments.AddComments(firstNode($$), $1.Comments()) + } ; foreach_variable: - variable { $$ = foreachVariable{$1, false} } - | '&' variable { $$ = foreachVariable{$2, true} } + variable + { $$ = foreachVariable{$1, false} } + | '&' variable + { + $$ = foreachVariable{$2, true} + + // save position + yylex.(*Parser).positions.AddPosition($2, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($2, $1.Comments()) + } | T_LIST '(' array_pair_list ')' - { - list := expr.NewList($3) - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - $$ = foreachVariable{list, false} - yylex.(*Parser).comments.AddComments(list, $1.Comments()) - } + { + list := expr.NewList($3) + $$ = foreachVariable{list, false} + + // save position + yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments(list, $1.Comments()) + yylex.(*Parser).comments.AddComments(list, $2.Comments()) + yylex.(*Parser).comments.AddComments(list, $4.Comments()) + } | '[' array_pair_list ']' - { - list := expr.NewShortList($2) - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - $$ = foreachVariable{list, false} - yylex.(*Parser).comments.AddComments(list, $1.Comments()) - } + { + list := expr.NewShortList($2) + $$ = foreachVariable{list, false} + + // save position + yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments(list, $1.Comments()) + yylex.(*Parser).comments.AddComments(list, $3.Comments()) + } ; for_statement: @@ -878,7 +1349,14 @@ for_statement: | ':' inner_statement_list T_ENDFOR ';' { $$ = altSyntaxNode{stmt.NewStmtList($2), true} + + // save position yylex.(*Parser).positions.AddPosition($$.node, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$.node, $1.Comments()) + yylex.(*Parser).comments.AddComments($$.node, $3.Comments()) + yylex.(*Parser).comments.AddComments($$.node, $4.Comments()) } ; @@ -888,18 +1366,32 @@ foreach_statement: | ':' inner_statement_list T_ENDFOREACH ';' { $$ = altSyntaxNode{stmt.NewStmtList($2), true} + + // save position yylex.(*Parser).positions.AddPosition($$.node, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$.node, $1.Comments()) + yylex.(*Parser).comments.AddComments($$.node, $3.Comments()) + yylex.(*Parser).comments.AddComments($$.node, $4.Comments()) } ; declare_statement: - statement { $$ = $1; } + statement + { $$ = $1; } | ':' inner_statement_list T_ENDDECLARE ';' - { - $$ = stmt.NewStmtList($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = stmt.NewStmtList($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } ; switch_case_list: @@ -910,26 +1402,39 @@ switch_case_list: ; case_list: - /* empty */ { $$ = []node.Node{} } + /* empty */ + { $$ = []node.Node{} } | case_list T_CASE expr case_separator inner_statement_list { _case := stmt.NewCase($3, $5) - yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) $$ = append($1, _case) + + // save position + yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) + + // save comments yylex.(*Parser).comments.AddComments(_case, $2.Comments()) + yylex.(*Parser).comments.AddComments(_case, $4.Comments()) } | case_list T_DEFAULT case_separator inner_statement_list { _default := stmt.NewDefault($4) - yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) $$ = append($1, _default) + + // save position + yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) + + // save comments yylex.(*Parser).comments.AddComments(_default, $2.Comments()) + yylex.(*Parser).comments.AddComments(_default, $3.Comments()) } ; case_separator: ':' + { $$ = $1 } | ';' + { $$ = $1 } ; while_statement: @@ -938,388 +1443,583 @@ while_statement: | ':' inner_statement_list T_ENDWHILE ';' { $$ = altSyntaxNode{stmt.NewStmtList($2), true} + + // save position yylex.(*Parser).positions.AddPosition($$.node, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$.node, $1.Comments()) + yylex.(*Parser).comments.AddComments($$.node, $3.Comments()) + yylex.(*Parser).comments.AddComments($$.node, $4.Comments()) } ; if_stmt_without_else: - T_IF '(' expr ')' statement - { - $$ = stmt.NewIf($3, $5, nil, nil) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | if_stmt_without_else T_ELSEIF '(' expr ')' statement - { - _elseIf := stmt.NewElseIf($4, $6) - yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6)) - $$ = $1.(*stmt.If).AddElseIf(_elseIf) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) + T_IF '(' expr ')' statement + { + $$ = stmt.NewIf($3, $5, nil, nil) - yylex.(*Parser).comments.AddComments(_elseIf, $2.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } + | if_stmt_without_else T_ELSEIF '(' expr ')' statement + { + _elseIf := stmt.NewElseIf($4, $6) + $$ = $1.(*stmt.If).AddElseIf(_elseIf) + + // save position + yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) + + // save comments + yylex.(*Parser).comments.AddComments(_elseIf, $2.Comments()) + yylex.(*Parser).comments.AddComments(_elseIf, $3.Comments()) + yylex.(*Parser).comments.AddComments(_elseIf, $5.Comments()) + } ; if_stmt: - if_stmt_without_else %prec T_NOELSE { $$ = $1; } + if_stmt_without_else %prec T_NOELSE + { $$ = $1; } | if_stmt_without_else T_ELSE statement - { - _else := stmt.NewElse($3) - yylex.(*Parser).positions.AddPosition(_else, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $3)) - $$ = $1.(*stmt.If).SetElse(_else) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + { + _else := stmt.NewElse($3) + $$ = $1.(*stmt.If).SetElse(_else) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(_else, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $3)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } ; alt_if_stmt_without_else: - T_IF '(' expr ')' ':' inner_statement_list - { - stmts := stmt.NewStmtList($6) - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($6)) - $$ = stmt.NewAltIf($3, stmts, nil, nil) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $6)) + T_IF '(' expr ')' ':' inner_statement_list + { + stmts := stmt.NewStmtList($6) + $$ = stmt.NewAltIf($3, stmts, nil, nil) - yylex.(*Parser).comments.AddComments(stmts, $5.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($6)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $6)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddComments($$, $5.Comments()) + } | alt_if_stmt_without_else T_ELSEIF '(' expr ')' ':' inner_statement_list - { - stmts := stmt.NewStmtList($7) - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($7)) - _elseIf := stmt.NewAltElseIf($4, stmts) - yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $7)) - $$ = $1.(*stmt.AltIf).AddElseIf(_elseIf) + { + stmts := stmt.NewStmtList($7) + _elseIf := stmt.NewAltElseIf($4, stmts) + $$ = $1.(*stmt.AltIf).AddElseIf(_elseIf) - yylex.(*Parser).comments.AddComments(stmts, $6.Comments()) - yylex.(*Parser).comments.AddComments(_elseIf, $2.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($7)) + yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $7)) + + // save comments + yylex.(*Parser).comments.AddComments(_elseIf, $2.Comments()) + yylex.(*Parser).comments.AddComments(_elseIf, $3.Comments()) + yylex.(*Parser).comments.AddComments(_elseIf, $5.Comments()) + yylex.(*Parser).comments.AddComments(_elseIf, $6.Comments()) + } ; alt_if_stmt: - alt_if_stmt_without_else T_ENDIF ';' - { - $$ = $1 - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - } - | alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';' - { - stmts := stmt.NewStmtList($4) - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($4)) - _else := stmt.NewAltElse(stmts) - yylex.(*Parser).positions.AddPosition(_else, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) - $$ = $1.(*stmt.AltIf).SetElse(_else) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) + alt_if_stmt_without_else T_ENDIF ';' + { + $$ = $1 - yylex.(*Parser).comments.AddComments(stmts, $3.Comments()) - yylex.(*Parser).comments.AddComments(_else, $2.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } + | alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';' + { + stmts := stmt.NewStmtList($4) + _else := stmt.NewAltElse(stmts) + $$ = $1.(*stmt.AltIf).SetElse(_else) + + // save position + yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($4)) + yylex.(*Parser).positions.AddPosition(_else, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) + + // save comments + yylex.(*Parser).comments.AddComments(_else, $2.Comments()) + yylex.(*Parser).comments.AddComments(_else, $3.Comments()) + yylex.(*Parser).comments.AddComments($$, $5.Comments()) + yylex.(*Parser).comments.AddComments($$, $6.Comments()) + } ; parameter_list: - non_empty_parameter_list { $$ = $1; } - | /* empty */ { $$ = nil } + non_empty_parameter_list + { $$ = $1; } + | /* empty */ + { $$ = nil } ; non_empty_parameter_list: - parameter { $$ = []node.Node{$1} } - | non_empty_parameter_list ',' parameter { $$ = append($1, $3) } + parameter + { $$ = []node.Node{$1} } + | non_empty_parameter_list ',' parameter + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } ; parameter: - optional_type is_reference is_variadic T_VARIABLE - { - identifier := node.NewIdentifier(strings.TrimLeft($4.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + optional_type is_reference is_variadic T_VARIABLE + { + identifier := node.NewIdentifier(strings.TrimLeft($4.Value, "$")) + variable := expr.NewVariable(identifier) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) - - if $1 != nil { - $$ = node.NewParameter($1, variable, nil, $2.value, $3.value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } else if $2.value == true { - $$ = node.NewParameter($1, variable, nil, $2.value, $3.value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($2.token, $4)) - yylex.(*Parser).comments.AddComments($$, $2.token.Comments()) - } else if $3.value == true { - $$ = node.NewParameter($1, variable, nil, $2.value, $3.value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($3.token, $4)) - yylex.(*Parser).comments.AddComments($$, $3.token.Comments()) - } else { - $$ = node.NewParameter($1, variable, nil, $2.value, $3.value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + if $1 != nil { + $$ = node.NewParameter($1, variable, nil, $2.value, $3.value) + } else if $2.value { + $$ = node.NewParameter($1, variable, nil, $2.value, $3.value) + } else if $3.value { + $$ = node.NewParameter($1, variable, nil, $2.value, $3.value) + } else { + $$ = node.NewParameter($1, variable, nil, $2.value, $3.value) + } + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + if $1 != nil { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + } else if $2.value { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($2.token, $4)) + } else if $3.value { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($3.token, $4)) + } else { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + } + + // save comments + if $2.value { + yylex.(*Parser).comments.AddComments($$, $2.token.Comments()) + } + if $3.value { + yylex.(*Parser).comments.AddComments($$, $3.token.Comments()) + } + yylex.(*Parser).comments.AddComments(variable, $4.Comments()) } - } | optional_type is_reference is_variadic T_VARIABLE '=' expr - { - identifier := node.NewIdentifier(strings.TrimLeft($4.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + { + identifier := node.NewIdentifier(strings.TrimLeft($4.Value, "$")) + variable := expr.NewVariable(identifier) + if $1 != nil { + $$ = node.NewParameter($1, variable, $6, $2.value, $3.value) + } else if $2.value == true { + $$ = node.NewParameter($1, variable, $6, $2.value, $3.value) + } else if $3.value == true { + $$ = node.NewParameter($1, variable, $6, $2.value, $3.value) + } else { + $$ = node.NewParameter($1, variable, $6, $2.value, $3.value) + } - yylex.(*Parser).comments.AddComments($$, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + if $1 != nil { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) + } else if $2.value == true { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2.token, $6)) + } else if $3.value == true { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3.token, $6)) + } else { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) + } - if $1 != nil { - $$ = node.NewParameter($1, variable, $6, $2.value, $3.value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } else if $2.value == true { - $$ = node.NewParameter($1, variable, $6, $2.value, $3.value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2.token, $6)) - yylex.(*Parser).comments.AddComments($$, $2.token.Comments()) - } else if $3.value == true { - $$ = node.NewParameter($1, variable, $6, $2.value, $3.value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3.token, $6)) - yylex.(*Parser).comments.AddComments($$, $3.token.Comments()) - } else { - $$ = node.NewParameter($1, variable, $6, $2.value, $3.value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + // save comments + if $2.value { + yylex.(*Parser).comments.AddComments($$, $2.token.Comments()) + } + if $3.value { + yylex.(*Parser).comments.AddComments($$, $3.token.Comments()) + } + yylex.(*Parser).comments.AddComments(variable, $4.Comments()) + yylex.(*Parser).comments.AddComments($$, $5.Comments()) } - } ; optional_type: - /* empty */ { $$ = nil } - | type_expr { $$ = $1; } + /* empty */ + { $$ = nil } + | type_expr + { $$ = $1; } ; type_expr: - type { $$ = $1; } + type + { $$ = $1; } | '?' type - { - $$ = node.NewNullable($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = node.NewNullable($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } ; type: - T_ARRAY - { - $$ = node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + T_ARRAY + { + $$ = node.NewIdentifier($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_CALLABLE - { - $$ = node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | name { $$ = $1; } + { + $$ = node.NewIdentifier($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | name + { $$ = $1; } ; return_type: - /* empty */ { $$ = nil } - | ':' type_expr { $$ = $2; } + /* empty */ + { $$ = nil } + | ':' type_expr + { + $$ = $2; + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } ; argument_list: - '(' ')' { $$ = &nodesWithEndToken{[]node.Node{}, $2} } - | '(' non_empty_argument_list possible_comma ')' { $$ = &nodesWithEndToken{$2, $4} } + '(' ')' + { $$ = &nodesWithEndToken{[]node.Node{}, $2} } + | '(' non_empty_argument_list possible_comma ')' + { $$ = &nodesWithEndToken{$2, $4} } ; non_empty_argument_list: - argument { $$ = []node.Node{$1} } - | non_empty_argument_list ',' argument { $$ = append($1, $3) } + argument + { $$ = []node.Node{$1} } + | non_empty_argument_list ',' argument + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } ; argument: - expr - { - $$ = node.NewArgument($1, false, false) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + expr + { + $$ = node.NewArgument($1, false, false) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + } | T_ELLIPSIS expr - { - $$ = node.NewArgument($2, true, false) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = node.NewArgument($2, true, false) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } ; global_var_list: - global_var_list ',' global_var { $$ = append($1, $3); } - | global_var { $$ = []node.Node{$1} } + global_var_list ',' global_var + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } + | global_var + { $$ = []node.Node{$1} } ; global_var: - simple_variable { $$ = $1 } + simple_variable + { $$ = $1 } ; static_var_list: - static_var_list ',' static_var { $$ = append($1, $3) } - | static_var { $$ = []node.Node{$1} } + static_var_list ',' static_var + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } + | static_var + { $$ = []node.Node{$1} } ; static_var: T_VARIABLE { identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) $$ = stmt.NewStaticVar(variable, nil) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(identifier, $1.Comments()) + // save comments yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) } | T_VARIABLE '=' expr - { - identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$ = stmt.NewStaticVar(variable, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + { + identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) + variable := expr.NewVariable(identifier) + $$ = stmt.NewStaticVar(variable, $3) - yylex.(*Parser).comments.AddComments(identifier, $1.Comments()) - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments(variable, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } ; class_statement_list: - class_statement_list class_statement { $$ = append($1, $2) } - | /* empty */ { $$ = []node.Node{} } + class_statement_list class_statement + { $$ = append($1, $2) } + | /* empty */ + { $$ = []node.Node{} } ; class_statement: - variable_modifiers property_list ';' - { - $$ = stmt.NewPropertyList($1, $2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) - } + variable_modifiers property_list ';' + { + $$ = stmt.NewPropertyList($1, $2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } | method_modifiers T_CONST class_const_list ';' - { - $$ = stmt.NewClassConstList($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) - } + { + $$ = stmt.NewClassConstList($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } | T_USE name_list trait_adaptations - { - $$ = stmt.NewTraitUse($2, $3.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3.endToken)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = stmt.NewTraitUse($2, $3.nodes) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3.endToken)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | method_modifiers T_FUNCTION returns_ref identifier backup_doc_comment '(' parameter_list ')' return_type method_body { name := node.NewIdentifier($4.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) $$ = stmt.NewClassMethod(name, $1, $3.value, $7, $9, $10.nodes, $5) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $10.endToken)) + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + if $3.value { + yylex.(*Parser).comments.AddComments($$, $3.token.Comments()) + } yylex.(*Parser).comments.AddComments(name, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) + yylex.(*Parser).comments.AddComments($$, $6.Comments()) + yylex.(*Parser).comments.AddComments($$, $8.Comments()) } ; name_list: - name { $$ = []node.Node{$1} } - | name_list ',' name { $$ = append($1, $3) } + name + { $$ = []node.Node{$1} } + | name_list ',' name + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } ; trait_adaptations: - ';' { $$ = &nodesWithEndToken{nil, $1} } - | '{' '}' { $$ = &nodesWithEndToken{nil, $2} } - | '{' trait_adaptation_list '}' { $$ = &nodesWithEndToken{$2, $3} } + ';' + { $$ = &nodesWithEndToken{nil, $1} } + | '{' '}' + { $$ = &nodesWithEndToken{nil, $2} } + | '{' trait_adaptation_list '}' + { $$ = &nodesWithEndToken{$2, $3} } ; trait_adaptation_list: - trait_adaptation { $$ = []node.Node{$1} } - | trait_adaptation_list trait_adaptation { $$ = append($1, $2) } + trait_adaptation + { $$ = []node.Node{$1} } + | trait_adaptation_list trait_adaptation + { $$ = append($1, $2) } ; trait_adaptation: - trait_precedence ';' { $$ = $1; } - | trait_alias ';' { $$ = $1; } + trait_precedence ';' + { + $$ = $1; + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | trait_alias ';' + { + $$ = $1; + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } ; trait_precedence: - absolute_trait_method_reference T_INSTEADOF name_list - { - $$ = stmt.NewTraitUsePrecedence($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + absolute_trait_method_reference T_INSTEADOF name_list + { + $$ = stmt.NewTraitUsePrecedence($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } ; trait_alias: - trait_method_reference T_AS T_STRING - { - alias := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$ = stmt.NewTraitUseAlias($1, nil, alias) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - - yylex.(*Parser).comments.AddComments(alias, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + trait_method_reference T_AS T_STRING + { + alias := node.NewIdentifier($3.Value) + $$ = stmt.NewTraitUseAlias($1, nil, alias) + + // save position + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments(alias, $3.Comments()) + } | trait_method_reference T_AS reserved_non_modifiers - { - alias := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$ = stmt.NewTraitUseAlias($1, nil, alias) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - - yylex.(*Parser).comments.AddComments(alias, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + { + alias := node.NewIdentifier($3.Value) + $$ = stmt.NewTraitUseAlias($1, nil, alias) + + // save position + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments(alias, $3.Comments()) + } | trait_method_reference T_AS member_modifier identifier - { - alias := node.NewIdentifier($4.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - $$ = stmt.NewTraitUseAlias($1, $3, alias) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - - yylex.(*Parser).comments.AddComments(alias, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + { + alias := node.NewIdentifier($4.Value) + $$ = stmt.NewTraitUseAlias($1, $3, alias) + + // save position + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments(alias, $4.Comments()) + } | trait_method_reference T_AS member_modifier - { - $$ = stmt.NewTraitUseAlias($1, $3, nil) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + { + $$ = stmt.NewTraitUseAlias($1, $3, nil) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } ; trait_method_reference: - identifier - { - name := node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$ = stmt.NewTraitMethodRef(nil, name) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - yylex.(*Parser).comments.AddComments(name, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | absolute_trait_method_reference { $$ = $1; } + identifier + { + name := node.NewIdentifier($1.Value) + $$ = stmt.NewTraitMethodRef(nil, name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments(name, $1.Comments()) + } + | absolute_trait_method_reference + { $$ = $1; } ; absolute_trait_method_reference: - name T_PAAMAYIM_NEKUDOTAYIM identifier - { - target := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$ = stmt.NewTraitMethodRef($1, target) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - - yylex.(*Parser).comments.AddComments(target, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + name T_PAAMAYIM_NEKUDOTAYIM identifier + { + target := node.NewIdentifier($3.Value) + $$ = stmt.NewTraitMethodRef($1, target) + + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments(target, $3.Comments()) + } ; method_body: @@ -1328,1041 +2028,1684 @@ method_body: ; variable_modifiers: - non_empty_member_modifiers { $$ = $1; } + non_empty_member_modifiers + { $$ = $1; } | T_VAR - { - modifier := node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$ = []node.Node{modifier} - yylex.(*Parser).comments.AddComments(modifier, $1.Comments()) - } + { + modifier := node.NewIdentifier($1.Value) + $$ = []node.Node{modifier} + + // save position + yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments(modifier, $1.Comments()) + } ; method_modifiers: - /* empty */ { $$ = nil } - | non_empty_member_modifiers { $$ = $1 } + /* empty */ + { $$ = nil } + | non_empty_member_modifiers + { $$ = $1 } ; non_empty_member_modifiers: - member_modifier { $$ = []node.Node{$1} } - | non_empty_member_modifiers member_modifier { $$ = append($1, $2) } + member_modifier + { $$ = []node.Node{$1} } + | non_empty_member_modifiers member_modifier + { $$ = append($1, $2) } ; member_modifier: - T_PUBLIC - { - $$ = node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + T_PUBLIC + { + $$ = node.NewIdentifier($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_PROTECTED - { - $$ = node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = node.NewIdentifier($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_PRIVATE - { - $$ = node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = node.NewIdentifier($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_STATIC - { - $$ = node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = node.NewIdentifier($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_ABSTRACT - { - $$ = node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = node.NewIdentifier($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_FINAL - { - $$ = node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = node.NewIdentifier($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } ; property_list: - property_list ',' property { $$ = append($1, $3) } - | property { $$ = []node.Node{$1} } + property_list ',' property + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } + | property + { $$ = []node.Node{$1} } ; property: - T_VARIABLE backup_doc_comment - { - identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$ = stmt.NewProperty(variable, nil, $2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + T_VARIABLE backup_doc_comment + { + identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) + variable := expr.NewVariable(identifier) + $$ = stmt.NewProperty(variable, nil, $2) - yylex.(*Parser).comments.AddComments(identifier, $1.Comments()) - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments(variable, $1.Comments()) + } | T_VARIABLE '=' expr backup_doc_comment - { - identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$ = stmt.NewProperty(variable, $3, $4) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + { + identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) + variable := expr.NewVariable(identifier) + $$ = stmt.NewProperty(variable, $3, $4) - yylex.(*Parser).comments.AddComments(identifier, $1.Comments()) - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments(variable, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } ; class_const_list: - class_const_list ',' class_const_decl { $$ = append($1, $3) } - | class_const_decl { $$ = []node.Node{$1} } + class_const_list ',' class_const_decl + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } + | class_const_decl + { $$ = []node.Node{$1} } ; class_const_decl: - identifier '=' expr backup_doc_comment - { - name := node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$ = stmt.NewConstant(name, $3, $4) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + identifier '=' expr backup_doc_comment + { + name := node.NewIdentifier($1.Value) + $$ = stmt.NewConstant(name, $3, $4) - yylex.(*Parser).comments.AddComments(name, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments(name, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } ; const_decl: - T_STRING '=' expr backup_doc_comment - { - name := node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$ = stmt.NewConstant(name, $3, $4) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + T_STRING '=' expr backup_doc_comment + { + name := node.NewIdentifier($1.Value) + $$ = stmt.NewConstant(name, $3, $4) - yylex.(*Parser).comments.AddComments(name, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments(name, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } ; echo_expr_list: - echo_expr_list ',' echo_expr { $$ = append($1, $3) } - | echo_expr { $$ = []node.Node{$1} } + echo_expr_list ',' echo_expr + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } + | echo_expr + { $$ = []node.Node{$1} } ; echo_expr: - expr { $$ = $1 } + expr + { $$ = $1 } ; for_exprs: - /* empty */ { $$ = nil; } - | non_empty_for_exprs { $$ = $1; } + /* empty */ + { $$ = nil; } + | non_empty_for_exprs + { $$ = $1; } ; + non_empty_for_exprs: - non_empty_for_exprs ',' expr { $$ = append($1, $3) } - | expr { $$ = []node.Node{$1} } + non_empty_for_exprs ',' expr + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } + | expr + { $$ = []node.Node{$1} } ; anonymous_class: - T_CLASS ctor_arguments extends_from implements_list backup_doc_comment '{' class_statement_list '}' - { - if $2 != nil { - $$ = stmt.NewClass(nil, nil, $2.nodes, $3, $4, $7, $5) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) - } else { - $$ = stmt.NewClass(nil, nil, nil, $3, $4, $7, $5) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) - } + T_CLASS ctor_arguments extends_from implements_list backup_doc_comment '{' class_statement_list '}' + { + if $2 != nil { + $$ = stmt.NewClass(nil, nil, $2.nodes, $3, $4, $7, $5) + } else { + $$ = stmt.NewClass(nil, nil, nil, $3, $4, $7, $5) + } - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + if $3 != nil { + yylex.(*Parser).setCommentsFromChildNode($$, $3) + } + if $4 != nil { + yylex.(*Parser).setCommentsFromChildNode($$, firstNode($4)) + } + yylex.(*Parser).comments.AddComments($$, $6.Comments()) + yylex.(*Parser).comments.AddComments($$, $8.Comments()) + } ; new_expr: - T_NEW class_name_reference ctor_arguments - { - if $3 != nil { - $$ = expr.NewNew($2, $3.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3.endToken)) - } else { - $$ = expr.NewNew($2, nil) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - } + T_NEW class_name_reference ctor_arguments + { + if $3 != nil { + $$ = expr.NewNew($2, $3.nodes) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3.endToken)) + } else { + $$ = expr.NewNew($2, nil) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + } - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_NEW anonymous_class { $$ = expr.NewNew($2, nil) } + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_NEW anonymous_class + { + $$ = expr.NewNew($2, nil) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } ; expr_without_variable: - T_LIST '(' array_pair_list ')' '=' expr - { - list := expr.NewList($3) - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - $$ = assign.NewAssign(list, $6) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) + T_LIST '(' array_pair_list ')' '=' expr + { + list := expr.NewList($3) + $$ = assign.NewAssign(list, $6) - yylex.(*Parser).comments.AddComments(list, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | '[' array_pair_list ']' '=' expr - { - shortList := expr.NewShortList($2) - yylex.(*Parser).positions.AddPosition(shortList, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - $$ = assign.NewAssign(shortList, $5) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) + // save position + yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) - yylex.(*Parser).comments.AddComments(shortList, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | variable '=' expr - { - $$ = assign.NewAssign($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | variable '=' '&' expr - { - $$ = assign.NewReference($1, $4) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | T_CLONE expr - { - $$ = expr.NewClone($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | variable T_PLUS_EQUAL expr - { - $$ = assign.NewPlus($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | variable T_MINUS_EQUAL expr - { - $$ = assign.NewMinus($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | variable T_MUL_EQUAL expr - { - $$ = assign.NewMul($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | variable T_POW_EQUAL expr - { - $$ = assign.NewPow($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | variable T_DIV_EQUAL expr - { - $$ = assign.NewDiv($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | variable T_CONCAT_EQUAL expr - { - $$ = assign.NewConcat($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | variable T_MOD_EQUAL expr - { - $$ = assign.NewMod($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | variable T_AND_EQUAL expr - { - $$ = assign.NewBitwiseAnd($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | variable T_OR_EQUAL expr - { - $$ = assign.NewBitwiseOr($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | variable T_XOR_EQUAL expr - { - $$ = assign.NewBitwiseXor($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | variable T_SL_EQUAL expr - { - $$ = assign.NewShiftLeft($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | variable T_SR_EQUAL expr - { - $$ = assign.NewShiftRight($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | variable T_INC - { - $$ = expr.NewPostInc($1) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | T_INC variable - { - $$ = expr.NewPreInc($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | variable T_DEC - { - $$ = expr.NewPostDec($1) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | T_DEC variable - { - $$ = expr.NewPreDec($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | expr T_BOOLEAN_OR expr - { - $$ = binary.NewBooleanOr($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr T_BOOLEAN_AND expr - { - $$ = binary.NewBooleanAnd($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr T_LOGICAL_OR expr - { - $$ = binary.NewLogicalOr($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr T_LOGICAL_AND expr - { - $$ = binary.NewLogicalAnd($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr T_LOGICAL_XOR expr - { - $$ = binary.NewLogicalXor($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr '|' expr - { - $$ = binary.NewBitwiseOr($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr '&' expr - { - $$ = binary.NewBitwiseAnd($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr '^' expr - { - $$ = binary.NewBitwiseXor($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr '.' expr - { - $$ = binary.NewConcat($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr '+' expr - { - $$ = binary.NewPlus($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr '-' expr - { - $$ = binary.NewMinus($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr '*' expr - { - $$ = binary.NewMul($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr T_POW expr - { - $$ = binary.NewPow($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr '/' expr - { - $$ = binary.NewDiv($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr '%' expr - { - $$ = binary.NewMod($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr T_SL expr - { - $$ = binary.NewShiftLeft($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr T_SR expr - { - $$ = binary.NewShiftRight($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | '+' expr %prec T_INC - { - $$ = expr.NewUnaryPlus($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | '-' expr %prec T_INC - { - $$ = expr.NewUnaryMinus($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | '!' expr - { - $$ = expr.NewBooleanNot($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | '~' expr - { - $$ = expr.NewBitwiseNot($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | expr T_IS_IDENTICAL expr - { - $$ = binary.NewIdentical($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr T_IS_NOT_IDENTICAL expr - { - $$ = binary.NewNotIdentical($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr T_IS_EQUAL expr - { - $$ = binary.NewEqual($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr T_IS_NOT_EQUAL expr - { - $$ = binary.NewNotEqual($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr '<' expr - { - $$ = binary.NewSmaller($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr T_IS_SMALLER_OR_EQUAL expr - { - $$ = binary.NewSmallerOrEqual($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr '>' expr - { - $$ = binary.NewGreater($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr T_IS_GREATER_OR_EQUAL expr - { - $$ = binary.NewGreaterOrEqual($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr T_SPACESHIP expr - { - $$ = binary.NewSpaceship($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr T_INSTANCEOF class_name_reference - { - $$ = expr.NewInstanceOf($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | '(' expr ')' { $$ = $2; } - | new_expr { $$ = $1; } - | expr '?' expr ':' expr - { - $$ = expr.NewTernary($1, $3, $5) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr '?' ':' expr - { - $$ = expr.NewTernary($1, nil, $4) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | expr T_COALESCE expr - { - $$ = binary.NewCoalesce($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | internal_functions_in_yacc { $$ = $1} - | T_INT_CAST expr - { - $$ = cast.NewInt($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_DOUBLE_CAST expr - { - $$ = cast.NewDouble($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_STRING_CAST expr - { - $$ = cast.NewString($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_ARRAY_CAST expr - { - $$ = cast.NewArray($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_OBJECT_CAST expr - { - $$ = cast.NewObject($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_BOOL_CAST expr - { - $$ = cast.NewBool($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_UNSET_CAST expr - { - $$ = cast.NewUnset($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_EXIT exit_expr - { - if (strings.EqualFold($1.Value, "die")) { - $$ = expr.NewDie($2) - } else { - $$ = expr.NewExit($2) + // save comments + yylex.(*Parser).comments.AddComments(list, $1.Comments()) + yylex.(*Parser).comments.AddComments(list, $2.Comments()) + yylex.(*Parser).comments.AddComments(list, $4.Comments()) + yylex.(*Parser).comments.AddComments($$, $5.Comments()) + } + | '[' array_pair_list ']' '=' expr + { + shortList := expr.NewShortList($2) + $$ = assign.NewAssign(shortList, $5) + + // save position + yylex.(*Parser).positions.AddPosition(shortList, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) + + // save comments + yylex.(*Parser).comments.AddComments(shortList, $1.Comments()) + yylex.(*Parser).comments.AddComments(shortList, $3.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } + | variable '=' expr + { + $$ = assign.NewAssign($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | variable '=' '&' expr + { + $$ = assign.NewReference($1, $4) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } + | T_CLONE expr + { + $$ = expr.NewClone($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | variable T_PLUS_EQUAL expr + { + $$ = assign.NewPlus($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | variable T_MINUS_EQUAL expr + { + $$ = assign.NewMinus($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | variable T_MUL_EQUAL expr + { + $$ = assign.NewMul($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | variable T_POW_EQUAL expr + { + $$ = assign.NewPow($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | variable T_DIV_EQUAL expr + { + $$ = assign.NewDiv($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | variable T_CONCAT_EQUAL expr + { + $$ = assign.NewConcat($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | variable T_MOD_EQUAL expr + { + $$ = assign.NewMod($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | variable T_AND_EQUAL expr + { + $$ = assign.NewBitwiseAnd($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | variable T_OR_EQUAL expr + { + $$ = assign.NewBitwiseOr($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | variable T_XOR_EQUAL expr + { + $$ = assign.NewBitwiseXor($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | variable T_SL_EQUAL expr + { + $$ = assign.NewShiftLeft($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | variable T_SR_EQUAL expr + { + $$ = assign.NewShiftRight($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | variable T_INC + { + $$ = expr.NewPostInc($1) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | T_INC variable + { + $$ = expr.NewPreInc($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | variable T_DEC + { + $$ = expr.NewPostDec($1) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | T_DEC variable + { + $$ = expr.NewPreDec($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | expr T_BOOLEAN_OR expr + { + $$ = binary.NewBooleanOr($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr T_BOOLEAN_AND expr + { + $$ = binary.NewBooleanAnd($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr T_LOGICAL_OR expr + { + $$ = binary.NewLogicalOr($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr T_LOGICAL_AND expr + { + $$ = binary.NewLogicalAnd($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr T_LOGICAL_XOR expr + { + $$ = binary.NewLogicalXor($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr '|' expr + { + $$ = binary.NewBitwiseOr($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr '&' expr + { + $$ = binary.NewBitwiseAnd($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr '^' expr + { + $$ = binary.NewBitwiseXor($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr '.' expr + { + $$ = binary.NewConcat($1, $3) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + } + | expr '+' expr + { + $$ = binary.NewPlus($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr '-' expr + { + $$ = binary.NewMinus($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr '*' expr + { + $$ = binary.NewMul($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr T_POW expr + { + $$ = binary.NewPow($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr '/' expr + { + $$ = binary.NewDiv($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr '%' expr + { + $$ = binary.NewMod($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr T_SL expr + { + $$ = binary.NewShiftLeft($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr T_SR expr + { + $$ = binary.NewShiftRight($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | '+' expr %prec T_INC + { + $$ = expr.NewUnaryPlus($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | '-' expr %prec T_INC + { + $$ = expr.NewUnaryMinus($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | '!' expr + { + $$ = expr.NewBooleanNot($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | '~' expr + { + $$ = expr.NewBitwiseNot($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | expr T_IS_IDENTICAL expr + { + $$ = binary.NewIdentical($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr T_IS_NOT_IDENTICAL expr + { + $$ = binary.NewNotIdentical($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr T_IS_EQUAL expr + { + $$ = binary.NewEqual($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr T_IS_NOT_EQUAL expr + { + $$ = binary.NewNotEqual($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr '<' expr + { + $$ = binary.NewSmaller($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr T_IS_SMALLER_OR_EQUAL expr + { + $$ = binary.NewSmallerOrEqual($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr '>' expr + { + $$ = binary.NewGreater($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr T_IS_GREATER_OR_EQUAL expr + { + $$ = binary.NewGreaterOrEqual($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr T_SPACESHIP expr + { + $$ = binary.NewSpaceship($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | expr T_INSTANCEOF class_name_reference + { + $$ = expr.NewInstanceOf($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | '(' expr ')' + { + $$ = $2; + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } + | new_expr + { $$ = $1; } + | expr '?' expr ':' expr + { + $$ = expr.NewTernary($1, $3, $5) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } + | expr '?' ':' expr + { + $$ = expr.NewTernary($1, nil, $4) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } + | expr T_COALESCE expr + { + $$ = binary.NewCoalesce($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | internal_functions_in_yacc + { $$ = $1} + | T_INT_CAST expr + { + $$ = cast.NewInt($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_DOUBLE_CAST expr + { + $$ = cast.NewDouble($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_STRING_CAST expr + { + $$ = cast.NewString($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_ARRAY_CAST expr + { + $$ = cast.NewArray($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_OBJECT_CAST expr + { + $$ = cast.NewObject($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_BOOL_CAST expr + { + $$ = cast.NewBool($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_UNSET_CAST expr + { + $$ = cast.NewUnset($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_EXIT exit_expr + { + if (strings.EqualFold($1.Value, "die")) { + $$ = expr.NewDie($2) + } else { + $$ = expr.NewExit($2) + } + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) } - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } | '@' expr - { - $$ = expr.NewErrorSuppress($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | scalar { $$ = $1; } + { + $$ = expr.NewErrorSuppress($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | scalar + { $$ = $1; } | '`' backticks_expr '`' - { - $$ = expr.NewShellExec($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewShellExec($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } | T_PRINT expr - { - $$ = expr.NewPrint($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewPrint($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_YIELD - { - $$ = expr.NewYield(nil, nil) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewYield(nil, nil) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_YIELD expr - { - $$ = expr.NewYield(nil, $2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewYield(nil, $2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_YIELD expr T_DOUBLE_ARROW expr - { - $$ = expr.NewYield($2, $4) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewYield($2, $4) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } | T_YIELD_FROM expr - { - $$ = expr.NewYieldFrom($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewYieldFrom($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_FUNCTION returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars return_type '{' inner_statement_list '}' { $$ = expr.NewClosure($5, $7, $8, $10, false, $2.value, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) + // save comments yylex.(*Parser).comments.AddComments($$, $1.Comments()) + if $2.value { + yylex.(*Parser).comments.AddComments($$, $2.token.Comments()) + } + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddComments($$, $6.Comments()) + yylex.(*Parser).comments.AddComments($$, $9.Comments()) + yylex.(*Parser).comments.AddComments($$, $11.Comments()) } | T_STATIC T_FUNCTION returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars return_type '{' inner_statement_list '}' { $$ = expr.NewClosure($6, $8, $9, $11, true, $3.value, $4) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $12)) + // save comments yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + if $3.value { + yylex.(*Parser).comments.AddComments($$, $3.token.Comments()) + } + yylex.(*Parser).comments.AddComments($$, $5.Comments()) + yylex.(*Parser).comments.AddComments($$, $7.Comments()) + yylex.(*Parser).comments.AddComments($$, $10.Comments()) + yylex.(*Parser).comments.AddComments($$, $12.Comments()) } ; backup_doc_comment: - /* empty */ { $$ = yylex.(*Parser).PhpDocComment; yylex.(*Parser).PhpDocComment = "" } + /* empty */ + { + $$ = yylex.(*Parser).PhpDocComment + yylex.(*Parser).PhpDocComment = "" + } ; returns_ref: - /* empty */ { $$ = boolWithToken{false, nil} } - | '&' { $$ = boolWithToken{true, $1} } + /* empty */ + { $$ = boolWithToken{false, nil} } + | '&' + { $$ = boolWithToken{true, $1} } ; lexical_vars: - /* empty */ { $$ = []node.Node{} } - | T_USE '(' lexical_var_list ')' { $$ = $3; } + /* empty */ + { $$ = []node.Node{} } + | T_USE '(' lexical_var_list ')' + { $$ = $3; } ; lexical_var_list: - lexical_var_list ',' lexical_var { $$ = append($1, $3) } - | lexical_var { $$ = []node.Node{$1} } + lexical_var_list ',' lexical_var + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } + | lexical_var + { $$ = []node.Node{$1} } ; lexical_var: T_VARIABLE - { - identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$ = expr.NewClosureUse(variable, false) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + { + identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) + variable := expr.NewVariable(identifier) + $$ = expr.NewClosureUse(variable, false) - yylex.(*Parser).comments.AddComments(identifier, $1.Comments()) - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments(variable, $1.Comments()) + } | '&' T_VARIABLE - { - identifier := node.NewIdentifier(strings.TrimLeft($2.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$ = expr.NewClosureUse(variable, true) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + { + identifier := node.NewIdentifier(strings.TrimLeft($2.Value, "$")) + variable := expr.NewVariable(identifier) + $$ = expr.NewClosureUse(variable, true) - yylex.(*Parser).comments.AddComments(identifier, $2.Comments()) - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments(variable, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } ; function_call: - name argument_list - { - $$ = expr.NewFunctionCall($1, $2.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2.endToken)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + name argument_list + { + $$ = expr.NewFunctionCall($1, $2.nodes) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2.endToken)) + } | class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list - { - $$ = expr.NewStaticCall($1, $3, $4.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + { + $$ = expr.NewStaticCall($1, $3, $4.nodes) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list - { - $$ = expr.NewStaticCall($1, $3, $4.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + { + $$ = expr.NewStaticCall($1, $3, $4.nodes) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } | callable_expr argument_list - { - $$ = expr.NewFunctionCall($1, $2.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2.endToken)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + { + $$ = expr.NewFunctionCall($1, $2.nodes) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2.endToken)) + } ; class_name: - T_STATIC - { - $$ = node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | name { $$ = $1; } + T_STATIC + { + $$ = node.NewIdentifier($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | name + { $$ = $1; } ; class_name_reference: - class_name { $$ = $1; } - | new_variable { $$ = $1; } + class_name + { $$ = $1; } + | new_variable + { $$ = $1; } ; exit_expr: - /* empty */ { $$ = nil } - | '(' optional_expr ')' { $$ = $2; } + /* empty */ + { $$ = nil } + | '(' optional_expr ')' + { $$ = $2; } ; backticks_expr: - /* empty */ { $$ = []node.Node{} } - | T_ENCAPSED_AND_WHITESPACE { $$ = []node.Node{scalar.NewEncapsedStringPart($1.Value)} } - | encaps_list { $$ = $1; } + /* empty */ + { $$ = []node.Node{} } + | T_ENCAPSED_AND_WHITESPACE + { $$ = []node.Node{scalar.NewEncapsedStringPart($1.Value)} } + | encaps_list + { $$ = $1; } ; ctor_arguments: - /* empty */ { $$ = nil } - | argument_list { $$ = $1 } + /* empty */ + { $$ = nil } + | argument_list + { $$ = $1 } ; dereferencable_scalar: T_ARRAY '(' array_pair_list ')' - { - $$ = expr.NewArray($3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewArray($3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } | '[' array_pair_list ']' - { - $$ = expr.NewShortArray($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewShortArray($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } | T_CONSTANT_ENCAPSED_STRING - { - $$ = scalar.NewString($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = scalar.NewString($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } ; scalar: - T_LNUMBER - { - $$ = scalar.NewLnumber($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_DNUMBER - { - $$ = scalar.NewDnumber($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_LINE - { - $$ = scalar.NewMagicConstant($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_FILE - { - $$ = scalar.NewMagicConstant($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_DIR - { - $$ = scalar.NewMagicConstant($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_TRAIT_C - { - $$ = scalar.NewMagicConstant($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_METHOD_C - { - $$ = scalar.NewMagicConstant($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_FUNC_C - { - $$ = scalar.NewMagicConstant($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_NS_C - { - $$ = scalar.NewMagicConstant($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_CLASS_C - { - $$ = scalar.NewMagicConstant($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC - { - encapsed := scalar.NewEncapsedStringPart($2.Value) - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).comments.AddComments(encapsed, $2.Comments()) + T_LNUMBER + { + $$ = scalar.NewLnumber($1.Value) - $$ = scalar.NewHeredoc($1.Value, []node.Node{encapsed}) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_DNUMBER + { + $$ = scalar.NewDnumber($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_LINE + { + $$ = scalar.NewMagicConstant($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_FILE + { + $$ = scalar.NewMagicConstant($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_DIR + { + $$ = scalar.NewMagicConstant($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_TRAIT_C + { + $$ = scalar.NewMagicConstant($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_METHOD_C + { + $$ = scalar.NewMagicConstant($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_FUNC_C + { + $$ = scalar.NewMagicConstant($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_NS_C + { + $$ = scalar.NewMagicConstant($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_CLASS_C + { + $$ = scalar.NewMagicConstant($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC + { + encapsed := scalar.NewEncapsedStringPart($2.Value) + $$ = scalar.NewHeredoc($1.Value, []node.Node{encapsed}) + + // save position + yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_START_HEREDOC T_END_HEREDOC - { - $$ = scalar.NewHeredoc($1.Value, nil) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = scalar.NewHeredoc($1.Value, nil) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | '"' encaps_list '"' - { - $$ = scalar.NewEncapsed($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = scalar.NewEncapsed($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_START_HEREDOC encaps_list T_END_HEREDOC - { - $$ = scalar.NewHeredoc($1.Value, $2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | dereferencable_scalar { $$ = $1; } - | constant { $$ = $1; } + { + $$ = scalar.NewHeredoc($1.Value, $2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | dereferencable_scalar + { $$ = $1; } + | constant + { $$ = $1; } ; constant: - name - { - $$ = expr.NewConstFetch($1) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + name + { + $$ = expr.NewConstFetch($1) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + } | class_name T_PAAMAYIM_NEKUDOTAYIM identifier - { - target := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$ = expr.NewClassConstFetch($1, target) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + { + target := node.NewIdentifier($3.Value) + $$ = expr.NewClassConstFetch($1, target) - yylex.(*Parser).comments.AddComments(target, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments(target, $3.Comments()) + } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM identifier - { - target := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$ = expr.NewClassConstFetch($1, target) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + { + target := node.NewIdentifier($3.Value) + $$ = expr.NewClassConstFetch($1, target) - yylex.(*Parser).comments.AddComments(target, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments(target, $3.Comments()) + } ; expr: - variable { $$ = $1; } - | expr_without_variable { $$ = $1; } + variable + { $$ = $1; } + | expr_without_variable + { $$ = $1; } ; optional_expr: - /* empty */ { $$ = nil } - | expr { $$ = $1; } + /* empty */ + { $$ = nil } + | expr + { $$ = $1; } ; variable_class_name: - dereferencable { $$ = $1; } + dereferencable + { $$ = $1; } ; dereferencable: - variable { $$ = $1; } - | '(' expr ')' { $$ = $2; } - | dereferencable_scalar { $$ = $1; } + variable + { $$ = $1; } + | '(' expr ')' + { + $$ = $2; + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } + | dereferencable_scalar + { $$ = $1; } ; callable_expr: - callable_variable { $$ = $1; } - | '(' expr ')' { $$ = $2; } - | dereferencable_scalar { $$ = $1; } + callable_variable + { $$ = $1; } + | '(' expr ')' + { + $$ = $2; + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } + | dereferencable_scalar + { $$ = $1; } ; callable_variable: - simple_variable { $$ = $1; } + simple_variable + { $$ = $1; } | dereferencable '[' optional_expr ']' - { - $$ = expr.NewArrayDimFetch($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + { + $$ = expr.NewArrayDimFetch($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } | constant '[' optional_expr ']' - { - $$ = expr.NewArrayDimFetch($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + { + $$ = expr.NewArrayDimFetch($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } | dereferencable '{' expr '}' - { - $$ = expr.NewArrayDimFetch($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + { + $$ = expr.NewArrayDimFetch($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } | dereferencable T_OBJECT_OPERATOR property_name argument_list - { - $$ = expr.NewMethodCall($1, $3, $4.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } - | function_call { $$ = $1; } + { + $$ = expr.NewMethodCall($1, $3, $4.nodes) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + | function_call + { $$ = $1; } ; variable: - callable_variable { $$ = $1; } - | static_member { $$ = $1; } + callable_variable + { $$ = $1; } + | static_member + { $$ = $1; } | dereferencable T_OBJECT_OPERATOR property_name - { - $$ = expr.NewPropertyFetch($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + { + $$ = expr.NewPropertyFetch($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } ; simple_variable: - T_VARIABLE - { - name := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$ = expr.NewVariable(name) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - yylex.(*Parser).comments.AddComments(name, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + T_VARIABLE + { + name := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) + $$ = expr.NewVariable(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | '$' '{' expr '}' - { - $$ = expr.NewVariable($3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewVariable($3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } | '$' simple_variable - { - $$ = expr.NewVariable($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewVariable($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } ; static_member: - class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable - { - $$ = expr.NewStaticPropertyFetch($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable + { + $$ = expr.NewStaticPropertyFetch($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable - { - $$ = expr.NewStaticPropertyFetch($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + { + $$ = expr.NewStaticPropertyFetch($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } ; new_variable: - simple_variable { $$ = $1 } + simple_variable + { $$ = $1 } | new_variable '[' optional_expr ']' - { - $$ = expr.NewArrayDimFetch($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + { + $$ = expr.NewArrayDimFetch($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } | new_variable '{' expr '}' - { - $$ = expr.NewArrayDimFetch($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + { + $$ = expr.NewArrayDimFetch($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } | new_variable T_OBJECT_OPERATOR property_name - { - $$ = expr.NewPropertyFetch($1, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + { + $$ = expr.NewPropertyFetch($1, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } | class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable { $$ = expr.NewStaticPropertyFetch($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) } | new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable { $$ = expr.NewStaticPropertyFetch($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) } ; member_name: - identifier - { - $$ = node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | '{' expr '}' { $$ = $2; } - | simple_variable { $$ = $1 } + identifier + { + $$ = node.NewIdentifier($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | '{' expr '}' + { + $$ = $2; + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } + | simple_variable + { $$ = $1 } ; property_name: - T_STRING - { - $$ = node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | '{' expr '}' { $$ = $2; } - | simple_variable { $$ = $1 } + T_STRING + { + $$ = node.NewIdentifier($1.Value) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | '{' expr '}' + { + $$ = $2; + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } + | simple_variable + { $$ = $1 } ; array_pair_list: @@ -2377,257 +3720,386 @@ array_pair_list: ; possible_array_pair: - /* empty */ { $$ = nil } - | array_pair { $$ = $1; } + /* empty */ + { $$ = nil } + | array_pair + { $$ = $1; } ; non_empty_array_pair_list: non_empty_array_pair_list ',' possible_array_pair - { $$ = append($1, $3) } - | possible_array_pair { $$ = []node.Node{$1} } + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } + | possible_array_pair + { $$ = []node.Node{$1} } ; array_pair: - expr T_DOUBLE_ARROW expr - { - $$ = expr.NewArrayItem($1, $3, false) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + expr T_DOUBLE_ARROW expr + { + $$ = expr.NewArrayItem($1, $3, false) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } | expr - { - $$ = expr.NewArrayItem(nil, $1, false) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + { + $$ = expr.NewArrayItem(nil, $1, false) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + } | expr T_DOUBLE_ARROW '&' variable - { - $$ = expr.NewArrayItem($1, $4, true) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } + { + $$ = expr.NewArrayItem($1, $4, true) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } | '&' variable - { - $$ = expr.NewArrayItem(nil, $2, true) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewArrayItem(nil, $2, true) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | expr T_DOUBLE_ARROW T_LIST '(' array_pair_list ')' { // TODO: Cannot use list() as standalone expression list := expr.NewList($5) - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($3, $6)) $$ = expr.NewArrayItem($1, list, false) + + // save position + yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($3, $6)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) + // save comments + yylex.(*Parser).comments.AddComments($$, $2.Comments()) yylex.(*Parser).comments.AddComments(list, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + yylex.(*Parser).comments.AddComments(list, $4.Comments()) + yylex.(*Parser).comments.AddComments(list, $6.Comments()) } | T_LIST '(' array_pair_list ')' { // TODO: Cannot use list() as standalone expression list := expr.NewList($3) - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) $$ = expr.NewArrayItem(nil, list, false) + + // save position + yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + // save comments yylex.(*Parser).comments.AddComments(list, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments(list, $2.Comments()) + yylex.(*Parser).comments.AddComments(list, $4.Comments()) } ; encaps_list: - encaps_list encaps_var { $$ = append($1, $2) } + encaps_list encaps_var + { $$ = append($1, $2) } | encaps_list T_ENCAPSED_AND_WHITESPACE - { - encapsed := scalar.NewEncapsedStringPart($2.Value) - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$ = append($1, encapsed) - yylex.(*Parser).comments.AddComments(encapsed, $2.Comments()) - } - | encaps_var { $$ = []node.Node{$1} } + { + encapsed := scalar.NewEncapsedStringPart($2.Value) + $$ = append($1, encapsed) + + // save position + yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + + // save comments + yylex.(*Parser).comments.AddComments(encapsed, $2.Comments()) + } + | encaps_var + { $$ = []node.Node{$1} } | T_ENCAPSED_AND_WHITESPACE encaps_var - { - encapsed := scalar.NewEncapsedStringPart($1.Value) - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$ = []node.Node{encapsed, $2} - yylex.(*Parser).comments.AddComments(encapsed, $1.Comments()) - } + { + encapsed := scalar.NewEncapsedStringPart($1.Value) + $$ = []node.Node{encapsed, $2} + + // save position + yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments(encapsed, $1.Comments()) + } ; encaps_var: - T_VARIABLE - { - name := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$ = expr.NewVariable(name) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + T_VARIABLE + { + name := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) + $$ = expr.NewVariable(name) - yylex.(*Parser).comments.AddComments(name, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_VARIABLE '[' encaps_var_offset ']' - { - identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$ = expr.NewArrayDimFetch(variable, $3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + { + identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) + variable := expr.NewVariable(identifier) + $$ = expr.NewArrayDimFetch(variable, $3) - yylex.(*Parser).comments.AddComments(identifier, $1.Comments()) - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments(variable, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } | T_VARIABLE T_OBJECT_OPERATOR T_STRING - { - identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - fetch := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$ = expr.NewPropertyFetch(variable, fetch) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - yylex.(*Parser).comments.AddComments(identifier, $1.Comments()) - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments(fetch, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) + variable := expr.NewVariable(identifier) + fetch := node.NewIdentifier($3.Value) + $$ = expr.NewPropertyFetch(variable, fetch) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments(variable, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments(fetch, $3.Comments()) + } | T_DOLLAR_OPEN_CURLY_BRACES expr '}' - { - $$ = expr.NewVariable($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewVariable($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' - { - name := node.NewIdentifier($2.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$ = expr.NewVariable(name) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + { + name := node.NewIdentifier($2.Value) + $$ = expr.NewVariable(name) - yylex.(*Parser).comments.AddComments(name, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments(name, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' - { - identifier := node.NewIdentifier($2.Value) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$ = expr.NewArrayDimFetch(variable, $4) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) + { + identifier := node.NewIdentifier($2.Value) + variable := expr.NewVariable(identifier) + $$ = expr.NewArrayDimFetch(variable, $4) + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) - yylex.(*Parser).comments.AddComments(identifier, $2.Comments()) - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_CURLY_OPEN variable '}' { $$ = $2; } + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments(variable, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddComments($$, $5.Comments()) + yylex.(*Parser).comments.AddComments($$, $6.Comments()) + } + | T_CURLY_OPEN variable '}' + { + $$ = $2; + } ; encaps_var_offset: - T_STRING - { - $$ = scalar.NewString($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_NUM_STRING - { - // TODO: add option to handle 64 bit integer - if _, err := strconv.Atoi($1.Value); err == nil { - $$ = scalar.NewLnumber($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - } else { + T_STRING + { $$ = scalar.NewString($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - } - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | '-' T_NUM_STRING - { - // TODO: add option to handle 64 bit integer - if _, err := strconv.Atoi($2.Value); err == nil { - lnumber := scalar.NewLnumber($2.Value) - yylex.(*Parser).positions.AddPosition(lnumber, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - $$ = expr.NewUnaryMinus(lnumber) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - yylex.(*Parser).comments.AddComments(lnumber, $1.Comments()) - } else { - $2.Value = "-"+$2.Value - $$ = scalar.NewString($2.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) } + | T_NUM_STRING + { + // TODO: add option to handle 64 bit integer + if _, err := strconv.Atoi($1.Value); err == nil { + $$ = scalar.NewLnumber($1.Value) + } else { + $$ = scalar.NewString($1.Value) + } - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } + | '-' T_NUM_STRING + { + var lnumber *scalar.Lnumber + // TODO: add option to handle 64 bit integer + _, err := strconv.Atoi($2.Value); + isInt := err == nil + + if isInt { + lnumber = scalar.NewLnumber($2.Value) + $$ = expr.NewUnaryMinus(lnumber) + } else { + $2.Value = "-"+$2.Value + $$ = scalar.NewString($2.Value) + } + + // save position + if isInt { + yylex.(*Parser).positions.AddPosition(lnumber, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + } + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + if isInt { + yylex.(*Parser).comments.AddComments(lnumber, $2.Comments()) + } else { + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } + } | T_VARIABLE - { - identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$ = expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + { + identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) + $$ = expr.NewVariable(identifier) - yylex.(*Parser).comments.AddComments(identifier, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } ; internal_functions_in_yacc: - T_ISSET '(' isset_variables possible_comma ')' - { - $$ = expr.NewIsset($3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + T_ISSET '(' isset_variables possible_comma ')' + { + $$ = expr.NewIsset($3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + if $4 != nil { + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } + yylex.(*Parser).comments.AddComments($$, $5.Comments()) + } | T_EMPTY '(' expr ')' - { - $$ = expr.NewEmpty($3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewEmpty($3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } | T_INCLUDE expr - { - $$ = expr.NewInclude($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewInclude($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_INCLUDE_ONCE expr - { - $$ = expr.NewIncludeOnce($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewIncludeOnce($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_EVAL '(' expr ')' - { - $$ = expr.NewEval($3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewEval($3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddComments($$, $4.Comments()) + } | T_REQUIRE expr - { - $$ = expr.NewRequire($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewRequire($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } | T_REQUIRE_ONCE expr - { - $$ = expr.NewRequireOnce($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewRequireOnce($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddComments($$, $1.Comments()) + } ; isset_variables: - isset_variable { $$ = []node.Node{$1} } - | isset_variables ',' isset_variable { $$ = append($1, $3) } + isset_variable + { $$ = []node.Node{$1} } + | isset_variables ',' isset_variable + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + } ; isset_variable: - expr { $$ = $1 } + expr + { $$ = $1 } ; ///////////////////////////////////////////////////////////////////////// diff --git a/scanner/lexer.go b/scanner/lexer.go index 6eba61b..85f2bb2 100644 --- a/scanner/lexer.go +++ b/scanner/lexer.go @@ -370,32 +370,32 @@ const T_MINUS_EQUAL = 57460 // T_MUL_EQUAL token const T_MUL_EQUAL = 57461 +// T_POW_EQUAL token +const T_POW_EQUAL = 57462 + // T_DIV_EQUAL token -const T_DIV_EQUAL = 57462 +const T_DIV_EQUAL = 57463 // T_CONCAT_EQUAL token -const T_CONCAT_EQUAL = 57463 +const T_CONCAT_EQUAL = 57464 // T_MOD_EQUAL token -const T_MOD_EQUAL = 57464 +const T_MOD_EQUAL = 57465 // T_AND_EQUAL token -const T_AND_EQUAL = 57465 +const T_AND_EQUAL = 57466 // T_OR_EQUAL token -const T_OR_EQUAL = 57466 +const T_OR_EQUAL = 57467 // T_XOR_EQUAL token -const T_XOR_EQUAL = 57467 +const T_XOR_EQUAL = 57468 // T_SL_EQUAL token -const T_SL_EQUAL = 57468 +const T_SL_EQUAL = 57469 // T_SR_EQUAL token -const T_SR_EQUAL = 57469 - -// T_POW_EQUAL token -const T_POW_EQUAL = 57470 +const T_SR_EQUAL = 57470 // T_BOOLEAN_OR token const T_BOOLEAN_OR = 57471 @@ -403,32 +403,32 @@ const T_BOOLEAN_OR = 57471 // T_BOOLEAN_AND token const T_BOOLEAN_AND = 57472 -// T_IS_EQUAL token -const T_IS_EQUAL = 57473 - -// T_IS_NOT_EQUAL token -const T_IS_NOT_EQUAL = 57474 - -// T_IS_IDENTICAL token -const T_IS_IDENTICAL = 57475 - -// T_IS_NOT_IDENTICAL token -const T_IS_NOT_IDENTICAL = 57476 - -// T_IS_SMALLER_OR_EQUAL token -const T_IS_SMALLER_OR_EQUAL = 57477 - -// T_IS_GREATER_OR_EQUAL token -const T_IS_GREATER_OR_EQUAL = 57478 +// T_POW token +const T_POW = 57473 // T_SL token -const T_SL = 57479 +const T_SL = 57474 // T_SR token -const T_SR = 57480 +const T_SR = 57475 -// T_POW token -const T_POW = 57481 +// T_IS_IDENTICAL token +const T_IS_IDENTICAL = 57476 + +// T_IS_NOT_IDENTICAL token +const T_IS_NOT_IDENTICAL = 57477 + +// T_IS_EQUAL token +const T_IS_EQUAL = 57478 + +// T_IS_NOT_EQUAL token +const T_IS_NOT_EQUAL = 57479 + +// T_IS_SMALLER_OR_EQUAL token +const T_IS_SMALLER_OR_EQUAL = 57480 + +// T_IS_GREATER_OR_EQUAL token +const T_IS_GREATER_OR_EQUAL = 57481 // Lval parsers yySymType must implement this interface type Lval interface { diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index 11d07f6..f6bad0f 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -107,8 +107,6 @@ func ExampleDumper() { //| "Stmts": //| [*stmt.Expression] //| "Position": Pos{Line: 8-8 Pos: 124-128}; - //| "Comments": - //| "// some comment\n" //| "Expr": //| [*expr.Variable] //| "Position": Pos{Line: 8-8 Pos: 124-127}; @@ -118,6 +116,4 @@ func ExampleDumper() { //| [*node.Identifier] //| "Position": Pos{Line: 8-8 Pos: 124-127}; //| "Value": var; - //| "Comments": - //| "// some comment\n" } From b383fe98fe608200eaaa911ec14715142a325a1a Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 27 May 2018 22:15:27 +0300 Subject: [PATCH 10/25] create token name constants in `comment` package --- comment/comment.go | 16 +- comment/tokenNames.go | 176 ++++ parser/comments.go | 16 + php5/php5.go | 1032 ++++++++++----------- php5/php5.y | 1 + php7/parser.go | 1 - php7/php7.go | 2004 +++++++++++++++++++++-------------------- php7/php7.y | 971 ++++++++++---------- 8 files changed, 2217 insertions(+), 2000 deletions(-) create mode 100644 comment/tokenNames.go diff --git a/comment/comment.go b/comment/comment.go index 3aa4958..943bd60 100644 --- a/comment/comment.go +++ b/comment/comment.go @@ -6,8 +6,9 @@ import ( // Comment aggrigates information about comment /** type Comment struct { - value string - position *position.Position + value string + position *position.Position + tokenName TokenName } // NewComment - Comment constructor @@ -15,9 +16,20 @@ func NewComment(value string, pos *position.Position) *Comment { return &Comment{ value, pos, + UnknownToken, } } +// SetTokenName sets token name +func (c *Comment) SetTokenName(tokenName TokenName) { + c.tokenName = tokenName +} + +// TokenName returns token name +func (c *Comment) TokenName() TokenName { + return c.tokenName +} + func (c *Comment) String() string { return c.value } diff --git a/comment/tokenNames.go b/comment/tokenNames.go new file mode 100644 index 0000000..75add38 --- /dev/null +++ b/comment/tokenNames.go @@ -0,0 +1,176 @@ +package comment + +// TokenName is used to specify a comment position +type TokenName int + +const ( + UnknownToken TokenName = iota + IncludeToken + IncludeOnceToken + ExitToken + IfToken + LnumberToken + DnumberToken + StringToken + StringVarnameToken + VariableToken + NumStringToken + InlineHTMLToken + CharacterToken + BadCharacterToken + EncapsedAndWhitespaceToken + ConstantEncapsedStringToken + EchoToken + DoToken + WhileToken + EndwhileToken + ForToken + EndforToken + ForeachToken + EndforeachToken + DeclareToken + EnddeclareToken + AsToken + SwitchToken + EndswitchToken + CaseToken + DefaultToken + BreakToken + ContinueToken + GotoToken + FunctionToken + ConstToken + ReturnToken + TryToken + CatchToken + FinallyToken + ThrowToken + UseToken + InsteadofToken + GlobalToken + VarToken + UnsetToken + IssetToken + EmptyToken + HalcompilerToken + ClassToken + TraitToken + InterfaceToken + ExtendsToken + ImplementsToken + ObjecoperatorToken + DoubleArrowToken + ListToken + ArrayToken + CallableToken + ClassCToken + TraitCToken + MethodCToken + FuncCToken + LineToken + FileToken + CommentToken + DocCommentToken + OpenTagToken + OpenTagWithEchoToken + CloseTagToken + WhitespaceToken + StartHeredocToken + EndHeredocToken + DollarOpenCurlyBracesToken + CurlyOpenToken + PaamayimNekudotayimToken + NamespaceToken + NsCToken + DirToken + NsSeparatorToken + EllipsisToken + EvalToken + RequireToken + RequireOnceToken + LogicalOrToken + LogicalXorToken + LogicalAndToken + InstanceofToken + NewToken + CloneToken + ElseifToken + ElseToken + EndifToken + PrintToken + YieldToken + StaticToken + AbstractToken + FinalToken + PrivateToken + ProtectedToken + PublicToken + IncToken + DecToken + YieldFromToken + ObjectOperatorToken + IntCastToken + DoubleCastToken + StringCastToken + ArrayCastToken + ObjectCastToken + BoolCastToken + UnsetCastToken + CoalesceToken + SpaceshipToken + NoelseToken + PlusEqualToken + MinusEqualToken + MulEqualToken + PowEqualToken + DivEqualToken + ConcatEqualToken + ModEqualToken + AndEqualToken + OrEqualToken + XorEqualToken + SlEqualToken + SrEqualToken + BooleanOrToken + BooleanAndToken + PowToken + SlToken + SrToken + IsIdenticalToken + IsNotIdenticalToken + IsEqualToken + IsNotEqualToken + IsSmallerOrEqualToken + IsGreaterOrEqualToken + HaltCompilerToken + IdentifierToken + CaseSeparatorToken // ';' or ':' + DoubleQuoteToken // '"' + BackquoteToken // '`' + OpenCurlyBracesToken // '{' + CloseCurlyBracesToken // '}' + SemiColonToken // ';' + ColonToken // ':' + OpenParenthesisToken // '(' + CloseParenthesisToken // ')' + OpenSquareBracket // '[' + CloseSquareBracket // ']' + QuestionMarkToken // '?' + AmpersandToken // '&' + MinusToken // '-' + PlusToken // '+' + ExclamationMarkToken // '!' + TildeToken // '~' + AtToken // '@' + DollarToken // '$' + CommaToken // ',' + VerticalBarToken // '|' + EqualToken // '=' + CaretToken // '^' + AsteriskToken // '*' + SlashToken // '/' + PercentToken // '%' + LessToken // '<' + GreaterToken // '>' + DotToken // '.' +) diff --git a/parser/comments.go b/parser/comments.go index c5aac8b..070d04a 100644 --- a/parser/comments.go +++ b/parser/comments.go @@ -3,6 +3,7 @@ package parser import ( "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/scanner" ) // Comments a collection of comment groups assigned to nodes @@ -12,3 +13,18 @@ type Comments map[node.Node][]*comment.Comment func (c Comments) AddComments(node node.Node, comments []*comment.Comment) { c[node] = append(c[node], comments...) } + +func (c Comments) AddFromToken(node node.Node, token *scanner.Token, tokenName comment.TokenName) { + comments := token.Comments() + + for _, cmt := range comments { + cmt.SetTokenName(tokenName) + } + + c.AddComments(node, comments) +} + +func (c Comments) AddFromChildNode(n node.Node, ch node.Node) { + c.AddComments(n, c[ch]) + delete(c, ch) +} diff --git a/php5/php5.go b/php5/php5.go index 07307a3..51560c5 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -344,7 +344,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:3857 +//line php5/php5.y:3858 type foreachVariable struct { node node.Node @@ -2345,14 +2345,14 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:268 + //line php5/php5.y:269 { yylex.(*Parser).rootNode = stmt.NewStmtList(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) } case 2: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:276 + //line php5/php5.y:277 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2360,13 +2360,13 @@ yydefault: } case 3: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:281 + //line php5/php5.y:282 { yyVAL.list = []node.Node{} } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:286 + //line php5/php5.y:287 { namePart := name.NewNamePart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2375,7 +2375,7 @@ yydefault: } case 5: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:293 + //line php5/php5.y:294 { namePart := name.NewNamePart(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2384,32 +2384,32 @@ yydefault: } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:303 + //line php5/php5.y:304 { // error yyVAL.node = nil } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:308 + //line php5/php5.y:309 { yyVAL.node = yyDollar[1].node } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:310 + //line php5/php5.y:311 { yyVAL.node = yyDollar[1].node } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:312 + //line php5/php5.y:313 { yyVAL.node = yyDollar[1].node } case 10: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:314 + //line php5/php5.y:315 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2417,7 +2417,7 @@ yydefault: } case 11: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:320 + //line php5/php5.y:321 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2429,7 +2429,7 @@ yydefault: } case 12: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:330 + //line php5/php5.y:331 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2441,7 +2441,7 @@ yydefault: } case 13: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:340 + //line php5/php5.y:341 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2449,7 +2449,7 @@ yydefault: } case 14: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:346 + //line php5/php5.y:347 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2457,7 +2457,7 @@ yydefault: } case 15: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:352 + //line php5/php5.y:353 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2469,7 +2469,7 @@ yydefault: } case 16: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:362 + //line php5/php5.y:363 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2481,25 +2481,25 @@ yydefault: } case 17: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:372 + //line php5/php5.y:373 { yyVAL.node = yyDollar[1].node } case 18: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:377 + //line php5/php5.y:378 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:379 + //line php5/php5.y:380 { yyVAL.list = []node.Node{yyDollar[1].node} } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:384 + //line php5/php5.y:385 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2511,7 +2511,7 @@ yydefault: } case 21: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:394 + //line php5/php5.y:395 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2526,7 +2526,7 @@ yydefault: } case 22: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:407 + //line php5/php5.y:408 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2538,7 +2538,7 @@ yydefault: } case 23: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:417 + //line php5/php5.y:418 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2553,19 +2553,19 @@ yydefault: } case 24: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:433 + //line php5/php5.y:434 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:435 + //line php5/php5.y:436 { yyVAL.list = []node.Node{yyDollar[1].node} } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:440 + //line php5/php5.y:441 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2577,7 +2577,7 @@ yydefault: } case 27: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:450 + //line php5/php5.y:451 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2592,7 +2592,7 @@ yydefault: } case 28: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:463 + //line php5/php5.y:464 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2604,7 +2604,7 @@ yydefault: } case 29: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:473 + //line php5/php5.y:474 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2619,19 +2619,19 @@ yydefault: } case 30: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:489 + //line php5/php5.y:490 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:491 + //line php5/php5.y:492 { yyVAL.list = []node.Node{yyDollar[1].node} } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:496 + //line php5/php5.y:497 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2643,7 +2643,7 @@ yydefault: } case 33: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:506 + //line php5/php5.y:507 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2658,7 +2658,7 @@ yydefault: } case 34: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:519 + //line php5/php5.y:520 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2670,7 +2670,7 @@ yydefault: } case 35: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:529 + //line php5/php5.y:530 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2685,7 +2685,7 @@ yydefault: } case 36: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:545 + //line php5/php5.y:546 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2703,7 +2703,7 @@ yydefault: } case 37: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:561 + //line php5/php5.y:562 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2721,7 +2721,7 @@ yydefault: } case 38: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:580 + //line php5/php5.y:581 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2729,38 +2729,38 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:586 + //line php5/php5.y:587 { yyVAL.list = []node.Node{} } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:592 + //line php5/php5.y:593 { // error yyVAL.node = nil } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:597 + //line php5/php5.y:598 { yyVAL.node = yyDollar[1].node } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:599 + //line php5/php5.y:600 { yyVAL.node = yyDollar[1].node } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:601 + //line php5/php5.y:602 { yyVAL.node = yyDollar[1].node } case 44: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:603 + //line php5/php5.y:604 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2768,13 +2768,13 @@ yydefault: } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:613 + //line php5/php5.y:614 { yyVAL.node = yyDollar[1].node } case 46: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:615 + //line php5/php5.y:616 { label := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2786,7 +2786,7 @@ yydefault: } case 47: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:628 + //line php5/php5.y:629 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2794,7 +2794,7 @@ yydefault: } case 48: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:634 + //line php5/php5.y:635 { yyVAL.node = stmt.NewIf(yyDollar[2].node, yyDollar[3].node, yyDollar[4].list, yyDollar[5].node) @@ -2810,7 +2810,7 @@ yydefault: } case 49: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:648 + //line php5/php5.y:649 { stmts := stmt.NewStmtList(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) @@ -2821,7 +2821,7 @@ yydefault: } case 50: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:657 + //line php5/php5.y:658 { if yyDollar[3].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltWhile(yyDollar[2].node, yyDollar[3].altSyntaxNode.node) @@ -2833,7 +2833,7 @@ yydefault: } case 51: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:667 + //line php5/php5.y:668 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2841,7 +2841,7 @@ yydefault: } case 52: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:673 + //line php5/php5.y:674 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltFor(yyDollar[3].list, yyDollar[5].list, yyDollar[7].list, yyDollar[9].altSyntaxNode.node) @@ -2853,7 +2853,7 @@ yydefault: } case 53: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:683 + //line php5/php5.y:684 { if yyDollar[3].nodesWithEndToken.endToken.Value == ";" { yyVAL.node = stmt.NewAltSwitch(yyDollar[2].node, yyDollar[3].nodesWithEndToken.nodes) @@ -2865,7 +2865,7 @@ yydefault: } case 54: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:693 + //line php5/php5.y:694 { yyVAL.node = stmt.NewBreak(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2873,7 +2873,7 @@ yydefault: } case 55: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:699 + //line php5/php5.y:700 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2881,7 +2881,7 @@ yydefault: } case 56: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:705 + //line php5/php5.y:706 { yyVAL.node = stmt.NewContinue(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2889,7 +2889,7 @@ yydefault: } case 57: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:711 + //line php5/php5.y:712 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2897,7 +2897,7 @@ yydefault: } case 58: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:717 + //line php5/php5.y:718 { yyVAL.node = stmt.NewReturn(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2905,7 +2905,7 @@ yydefault: } case 59: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:723 + //line php5/php5.y:724 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2913,7 +2913,7 @@ yydefault: } case 60: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:729 + //line php5/php5.y:730 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2921,7 +2921,7 @@ yydefault: } case 61: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:735 + //line php5/php5.y:736 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2929,7 +2929,7 @@ yydefault: } case 62: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:741 + //line php5/php5.y:742 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2937,7 +2937,7 @@ yydefault: } case 63: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:747 + //line php5/php5.y:748 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2945,7 +2945,7 @@ yydefault: } case 64: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:753 + //line php5/php5.y:754 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2953,7 +2953,7 @@ yydefault: } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:759 + //line php5/php5.y:760 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2961,7 +2961,7 @@ yydefault: } case 66: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:765 + //line php5/php5.y:766 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2969,7 +2969,7 @@ yydefault: } case 67: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:771 + //line php5/php5.y:772 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2977,7 +2977,7 @@ yydefault: } case 68: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:777 + //line php5/php5.y:778 { if yyDollar[6].foreachVariable.node == nil { if yyDollar[8].altSyntaxNode.isAlt { @@ -2997,7 +2997,7 @@ yydefault: } case 69: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:795 + //line php5/php5.y:796 { if yyDollar[6].foreachVariable.node == nil { if yyDollar[8].altSyntaxNode.isAlt { @@ -3017,7 +3017,7 @@ yydefault: } case 70: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:813 + //line php5/php5.y:814 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) @@ -3025,7 +3025,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:819 + //line php5/php5.y:820 { yyVAL.node = stmt.NewNop() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3033,7 +3033,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:825 + //line php5/php5.y:826 { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3047,7 +3047,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:837 + //line php5/php5.y:838 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -3055,7 +3055,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:843 + //line php5/php5.y:844 { label := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3067,13 +3067,13 @@ yydefault: } case 75: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:856 + //line php5/php5.y:857 { yyVAL.list = []node.Node{} } case 76: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:858 + //line php5/php5.y:859 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3091,13 +3091,13 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:876 + //line php5/php5.y:877 { yyVAL.node = nil } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:878 + //line php5/php5.y:879 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3105,31 +3105,31 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:887 + //line php5/php5.y:888 { yyVAL.list = yyDollar[1].list } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:889 + //line php5/php5.y:890 { yyVAL.list = []node.Node{} } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:894 + //line php5/php5.y:895 { yyVAL.list = []node.Node{yyDollar[1].node} } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:896 + //line php5/php5.y:897 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:901 + //line php5/php5.y:902 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3145,61 +3145,61 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:918 + //line php5/php5.y:919 { yyVAL.list = []node.Node{yyDollar[1].node} } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:920 + //line php5/php5.y:921 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:925 + //line php5/php5.y:926 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:930 + //line php5/php5.y:931 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:935 + //line php5/php5.y:936 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:940 + //line php5/php5.y:941 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:942 + //line php5/php5.y:943 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:947 + //line php5/php5.y:948 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:949 + //line php5/php5.y:950 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:954 + //line php5/php5.y:955 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3211,7 +3211,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:967 + //line php5/php5.y:968 { switch n := yyDollar[1].node.(type) { case *stmt.Class: @@ -3234,7 +3234,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:988 + //line php5/php5.y:989 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3246,7 +3246,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1002 + //line php5/php5.y:1003 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3254,7 +3254,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1008 + //line php5/php5.y:1009 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3266,7 +3266,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1018 + //line php5/php5.y:1019 { yyVAL.node = stmt.NewTrait(nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3274,7 +3274,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1024 + //line php5/php5.y:1025 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3286,85 +3286,85 @@ yydefault: } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1037 + //line php5/php5.y:1038 { yyVAL.node = nil } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1039 + //line php5/php5.y:1040 { yyVAL.node = yyDollar[2].node } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1044 + //line php5/php5.y:1045 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1049 + //line php5/php5.y:1050 { yyVAL.list = nil } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1051 + //line php5/php5.y:1052 { yyVAL.list = yyDollar[2].list } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1056 + //line php5/php5.y:1057 { yyVAL.list = nil } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1058 + //line php5/php5.y:1059 { yyVAL.list = yyDollar[2].list } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1063 + //line php5/php5.y:1064 { yyVAL.list = []node.Node{yyDollar[1].node} } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1065 + //line php5/php5.y:1066 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1070 + //line php5/php5.y:1071 { yyVAL.foreachVariable = foreachVariable{nil, false} } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1072 + //line php5/php5.y:1073 { yyVAL.foreachVariable = yyDollar[2].foreachVariable } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1077 + //line php5/php5.y:1078 { yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1079 + //line php5/php5.y:1080 { yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1081 + //line php5/php5.y:1082 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3373,39 +3373,39 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1091 + //line php5/php5.y:1092 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1093 + //line php5/php5.y:1094 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1102 + //line php5/php5.y:1103 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1104 + //line php5/php5.y:1105 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1113 + //line php5/php5.y:1114 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1115 + //line php5/php5.y:1116 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3413,7 +3413,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1125 + //line php5/php5.y:1126 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3427,7 +3427,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1137 + //line php5/php5.y:1138 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3441,37 +3441,37 @@ yydefault: } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1153 + //line php5/php5.y:1154 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1155 + //line php5/php5.y:1156 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[4].token} } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1157 + //line php5/php5.y:1158 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[4].token} } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1159 + //line php5/php5.y:1160 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[5].token} } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1165 + //line php5/php5.y:1166 { yyVAL.list = []node.Node{} } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1167 + //line php5/php5.y:1168 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) @@ -3480,7 +3480,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1174 + //line php5/php5.y:1175 { _default := stmt.NewDefault(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) @@ -3489,26 +3489,26 @@ yydefault: } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1191 + //line php5/php5.y:1192 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1193 + //line php5/php5.y:1194 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1203 + //line php5/php5.y:1204 { yyVAL.list = nil } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1205 + //line php5/php5.y:1206 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) @@ -3518,13 +3518,13 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1217 + //line php5/php5.y:1218 { yyVAL.list = nil } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1219 + //line php5/php5.y:1220 { stmts := stmt.NewStmtList(yyDollar[5].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[5].list)) @@ -3537,13 +3537,13 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1234 + //line php5/php5.y:1235 { yyVAL.node = nil } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1236 + //line php5/php5.y:1237 { yyVAL.node = stmt.NewElse(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3551,13 +3551,13 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1246 + //line php5/php5.y:1247 { yyVAL.node = nil } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1248 + //line php5/php5.y:1249 { stmts := stmt.NewStmtList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) @@ -3568,31 +3568,31 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1261 + //line php5/php5.y:1262 { yyVAL.list = yyDollar[1].list } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1263 + //line php5/php5.y:1264 { yyVAL.list = nil } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1268 + //line php5/php5.y:1269 { yyVAL.list = []node.Node{yyDollar[1].node} } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1270 + //line php5/php5.y:1271 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1275 + //line php5/php5.y:1276 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3620,7 +3620,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1301 + //line php5/php5.y:1302 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3648,13 +3648,13 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1331 + //line php5/php5.y:1332 { yyVAL.node = nil } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1333 + //line php5/php5.y:1334 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3662,7 +3662,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1339 + //line php5/php5.y:1340 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3670,25 +3670,25 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1345 + //line php5/php5.y:1346 { yyVAL.node = yyDollar[1].node } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1351 + //line php5/php5.y:1352 { yyVAL.nodesWithEndToken = &nodesWithEndToken{[]node.Node{}, yyDollar[2].token} } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1353 + //line php5/php5.y:1354 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1355 + //line php5/php5.y:1356 { arg := node.NewArgument(yyDollar[2].node, false, false) yylex.(*Parser).positions.AddPosition(arg, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -3698,19 +3698,19 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1367 + //line php5/php5.y:1368 { yyVAL.list = []node.Node{yyDollar[1].node} } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1369 + //line php5/php5.y:1370 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1374 + //line php5/php5.y:1375 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3718,7 +3718,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1380 + //line php5/php5.y:1381 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3726,7 +3726,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1386 + //line php5/php5.y:1387 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -3734,7 +3734,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1392 + //line php5/php5.y:1393 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3742,19 +3742,19 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1401 + //line php5/php5.y:1402 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1403 + //line php5/php5.y:1404 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1409 + //line php5/php5.y:1410 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3766,7 +3766,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1419 + //line php5/php5.y:1420 { yyVAL.node = expr.NewVariable(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3774,7 +3774,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1425 + //line php5/php5.y:1426 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3782,7 +3782,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1435 + //line php5/php5.y:1436 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3801,7 +3801,7 @@ yydefault: } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1452 + //line php5/php5.y:1453 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3820,7 +3820,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1469 + //line php5/php5.y:1470 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3839,7 +3839,7 @@ yydefault: } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1486 + //line php5/php5.y:1487 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3858,19 +3858,19 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1508 + //line php5/php5.y:1509 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1510 + //line php5/php5.y:1511 { yyVAL.list = []node.Node{} } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1516 + //line php5/php5.y:1517 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) @@ -3878,19 +3878,19 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1522 + //line php5/php5.y:1523 { yyVAL.node = yyDollar[1].node } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1524 + //line php5/php5.y:1525 { yyVAL.node = yyDollar[1].node } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1526 + //line php5/php5.y:1527 { name := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3902,7 +3902,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1539 + //line php5/php5.y:1540 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].nodesWithEndToken.nodes) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].nodesWithEndToken.endToken)) @@ -3910,67 +3910,67 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1548 + //line php5/php5.y:1549 { yyVAL.list = []node.Node{yyDollar[1].node} } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1550 + //line php5/php5.y:1551 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1555 + //line php5/php5.y:1556 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1557 + //line php5/php5.y:1558 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1562 + //line php5/php5.y:1563 { yyVAL.list = nil } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1564 + //line php5/php5.y:1565 { yyVAL.list = yyDollar[1].list } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1569 + //line php5/php5.y:1570 { yyVAL.list = []node.Node{yyDollar[1].node} } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1571 + //line php5/php5.y:1572 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1576 + //line php5/php5.y:1577 { yyVAL.node = yyDollar[1].node } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1578 + //line php5/php5.y:1579 { yyVAL.node = yyDollar[1].node } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1583 + //line php5/php5.y:1584 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) @@ -3978,19 +3978,19 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1592 + //line php5/php5.y:1593 { yyVAL.list = []node.Node{yyDollar[1].node} } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1594 + //line php5/php5.y:1595 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1599 + //line php5/php5.y:1600 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4002,13 +4002,13 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1609 + //line php5/php5.y:1610 { yyVAL.node = yyDollar[1].node } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1614 + //line php5/php5.y:1615 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4020,7 +4020,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1627 + //line php5/php5.y:1628 { alias := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -4032,7 +4032,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1637 + //line php5/php5.y:1638 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4040,37 +4040,37 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1646 + //line php5/php5.y:1647 { yyVAL.node = nil } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1648 + //line php5/php5.y:1649 { yyVAL.node = yyDollar[1].node } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1653 + //line php5/php5.y:1654 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1655 + //line php5/php5.y:1656 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1660 + //line php5/php5.y:1661 { yyVAL.list = yyDollar[1].list } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1662 + //line php5/php5.y:1663 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4080,31 +4080,31 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1673 + //line php5/php5.y:1674 { yyVAL.list = nil } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1675 + //line php5/php5.y:1676 { yyVAL.list = yyDollar[1].list } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1680 + //line php5/php5.y:1681 { yyVAL.list = []node.Node{yyDollar[1].node} } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1682 + //line php5/php5.y:1683 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 204: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1687 + //line php5/php5.y:1688 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4112,7 +4112,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1693 + //line php5/php5.y:1694 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4120,7 +4120,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1699 + //line php5/php5.y:1700 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4128,7 +4128,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1705 + //line php5/php5.y:1706 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4136,7 +4136,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1711 + //line php5/php5.y:1712 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4144,7 +4144,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1717 + //line php5/php5.y:1718 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4152,7 +4152,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1726 + //line php5/php5.y:1727 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4170,7 +4170,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1742 + //line php5/php5.y:1743 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4188,7 +4188,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1758 + //line php5/php5.y:1759 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4206,7 +4206,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1774 + //line php5/php5.y:1775 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4224,7 +4224,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1793 + //line php5/php5.y:1794 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4241,7 +4241,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1808 + //line php5/php5.y:1809 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -4257,55 +4257,55 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1825 + //line php5/php5.y:1826 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1827 + //line php5/php5.y:1828 { yyVAL.list = []node.Node{yyDollar[1].node} } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1833 + //line php5/php5.y:1834 { yyVAL.list = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1835 + //line php5/php5.y:1836 { yyVAL.list = yyDollar[1].list } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1840 + //line php5/php5.y:1841 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1842 + //line php5/php5.y:1843 { yyVAL.list = []node.Node{yyDollar[1].node} } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1847 + //line php5/php5.y:1848 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1849 + //line php5/php5.y:1850 { yyVAL.list = yyDollar[1].list } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1854 + //line php5/php5.y:1855 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -4314,7 +4314,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1861 + //line php5/php5.y:1862 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -4323,37 +4323,37 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1871 + //line php5/php5.y:1872 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1873 + //line php5/php5.y:1874 { yyVAL.list = yyDollar[1].list } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1875 + //line php5/php5.y:1876 { yyVAL.list = yyDollar[1].list } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1880 + //line php5/php5.y:1881 { yyVAL.list = nil } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1882 + //line php5/php5.y:1883 { yyVAL.list = yyDollar[1].list } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1887 + //line php5/php5.y:1888 { if yyDollar[3].nodesWithEndToken != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].nodesWithEndToken.nodes) @@ -4367,7 +4367,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1902 + //line php5/php5.y:1903 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -4379,7 +4379,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1912 + //line php5/php5.y:1913 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4387,7 +4387,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1918 + //line php5/php5.y:1919 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4395,7 +4395,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1924 + //line php5/php5.y:1925 { _new := expr.NewNew(yyDollar[5].node, nil) yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[5].node)) @@ -4412,7 +4412,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1939 + //line php5/php5.y:1940 { yyVAL.node = expr.NewClone(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4420,7 +4420,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1945 + //line php5/php5.y:1946 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4428,7 +4428,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1951 + //line php5/php5.y:1952 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4436,7 +4436,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1957 + //line php5/php5.y:1958 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4444,7 +4444,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1963 + //line php5/php5.y:1964 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4452,7 +4452,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1969 + //line php5/php5.y:1970 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4460,7 +4460,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1975 + //line php5/php5.y:1976 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4468,7 +4468,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1981 + //line php5/php5.y:1982 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4476,7 +4476,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1987 + //line php5/php5.y:1988 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4484,7 +4484,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1993 + //line php5/php5.y:1994 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4492,7 +4492,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1999 + //line php5/php5.y:2000 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4500,7 +4500,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2005 + //line php5/php5.y:2006 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4508,7 +4508,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2011 + //line php5/php5.y:2012 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4516,7 +4516,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2017 + //line php5/php5.y:2018 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4524,7 +4524,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2023 + //line php5/php5.y:2024 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4532,7 +4532,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2029 + //line php5/php5.y:2030 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4540,7 +4540,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2035 + //line php5/php5.y:2036 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4548,7 +4548,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2041 + //line php5/php5.y:2042 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4556,7 +4556,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2047 + //line php5/php5.y:2048 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4564,7 +4564,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2053 + //line php5/php5.y:2054 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4572,7 +4572,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2059 + //line php5/php5.y:2060 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4580,7 +4580,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2065 + //line php5/php5.y:2066 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4588,7 +4588,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2071 + //line php5/php5.y:2072 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4596,7 +4596,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2077 + //line php5/php5.y:2078 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4604,7 +4604,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2083 + //line php5/php5.y:2084 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4612,7 +4612,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2089 + //line php5/php5.y:2090 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4620,7 +4620,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2095 + //line php5/php5.y:2096 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4628,7 +4628,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2101 + //line php5/php5.y:2102 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4636,7 +4636,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2107 + //line php5/php5.y:2108 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4644,7 +4644,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2113 + //line php5/php5.y:2114 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4652,7 +4652,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2119 + //line php5/php5.y:2120 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4660,7 +4660,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2125 + //line php5/php5.y:2126 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4668,7 +4668,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2131 + //line php5/php5.y:2132 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4676,7 +4676,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2137 + //line php5/php5.y:2138 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4684,7 +4684,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2143 + //line php5/php5.y:2144 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4692,7 +4692,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2149 + //line php5/php5.y:2150 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4700,7 +4700,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2155 + //line php5/php5.y:2156 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4708,7 +4708,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2161 + //line php5/php5.y:2162 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4716,7 +4716,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2167 + //line php5/php5.y:2168 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4724,7 +4724,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2173 + //line php5/php5.y:2174 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4732,7 +4732,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2179 + //line php5/php5.y:2180 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4740,7 +4740,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2185 + //line php5/php5.y:2186 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4748,7 +4748,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2191 + //line php5/php5.y:2192 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4756,7 +4756,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2197 + //line php5/php5.y:2198 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4764,7 +4764,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2203 + //line php5/php5.y:2204 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4772,7 +4772,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2209 + //line php5/php5.y:2210 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4780,7 +4780,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2215 + //line php5/php5.y:2216 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4788,19 +4788,19 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2221 + //line php5/php5.y:2222 { yyVAL.node = yyDollar[1].node } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2223 + //line php5/php5.y:2224 { yyVAL.node = yyDollar[1].node } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2225 + //line php5/php5.y:2226 { yyVAL.node = yyDollar[2].node @@ -4828,7 +4828,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2251 + //line php5/php5.y:2252 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -4836,7 +4836,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2257 + //line php5/php5.y:2258 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4844,13 +4844,13 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2263 + //line php5/php5.y:2264 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2265 + //line php5/php5.y:2266 { yyVAL.node = cast.NewInt(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4858,7 +4858,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2271 + //line php5/php5.y:2272 { yyVAL.node = cast.NewDouble(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4866,7 +4866,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2277 + //line php5/php5.y:2278 { yyVAL.node = cast.NewString(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4874,7 +4874,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2283 + //line php5/php5.y:2284 { yyVAL.node = cast.NewArray(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4882,7 +4882,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2289 + //line php5/php5.y:2290 { yyVAL.node = cast.NewObject(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4890,7 +4890,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2295 + //line php5/php5.y:2296 { yyVAL.node = cast.NewBool(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4898,7 +4898,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2301 + //line php5/php5.y:2302 { yyVAL.node = cast.NewUnset(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4906,7 +4906,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2307 + //line php5/php5.y:2308 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -4918,7 +4918,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2317 + //line php5/php5.y:2318 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4926,25 +4926,25 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2323 + //line php5/php5.y:2324 { yyVAL.node = yyDollar[1].node } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2325 + //line php5/php5.y:2326 { yyVAL.node = yyDollar[1].node } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2327 + //line php5/php5.y:2328 { yyVAL.node = yyDollar[1].node } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2329 + //line php5/php5.y:2330 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -4952,7 +4952,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2335 + //line php5/php5.y:2336 { yyVAL.node = expr.NewPrint(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4960,7 +4960,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2341 + //line php5/php5.y:2342 { yyVAL.node = expr.NewYield(nil, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4968,7 +4968,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:2347 + //line php5/php5.y:2348 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].list, nil, yyDollar[8].list, false, yyDollar[2].boolWithToken.value, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) @@ -4977,7 +4977,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:2354 + //line php5/php5.y:2355 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, nil, yyDollar[9].list, true, yyDollar[3].boolWithToken.value, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) @@ -4986,7 +4986,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2364 + //line php5/php5.y:2365 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4994,7 +4994,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2370 + //line php5/php5.y:2371 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5002,7 +5002,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2376 + //line php5/php5.y:2377 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5010,7 +5010,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2382 + //line php5/php5.y:2383 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5018,7 +5018,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2391 + //line php5/php5.y:2392 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5026,7 +5026,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2397 + //line php5/php5.y:2398 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5034,7 +5034,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2403 + //line php5/php5.y:2404 { str := scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(str, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5046,7 +5046,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2413 + //line php5/php5.y:2414 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5054,7 +5054,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2422 + //line php5/php5.y:2423 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5062,7 +5062,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2428 + //line php5/php5.y:2429 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5070,25 +5070,25 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2437 + //line php5/php5.y:2438 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2442 + //line php5/php5.y:2443 { yyVAL.list = []node.Node{} } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2444 + //line php5/php5.y:2445 { yyVAL.list = yyDollar[3].list } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2449 + //line php5/php5.y:2450 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5106,7 +5106,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2465 + //line php5/php5.y:2466 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -5124,7 +5124,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2481 + //line php5/php5.y:2482 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5142,7 +5142,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2497 + //line php5/php5.y:2498 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5160,7 +5160,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2516 + //line php5/php5.y:2517 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5172,7 +5172,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2526 + //line php5/php5.y:2527 { funcName := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5184,7 +5184,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2536 + //line php5/php5.y:2537 { funcName := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5196,7 +5196,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2546 + //line php5/php5.y:2547 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) @@ -5204,7 +5204,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2552 + //line php5/php5.y:2553 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) @@ -5212,7 +5212,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2558 + //line php5/php5.y:2559 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) @@ -5220,7 +5220,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2564 + //line php5/php5.y:2565 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) @@ -5228,7 +5228,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2570 + //line php5/php5.y:2571 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].nodesWithEndToken.nodes) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].nodesWithEndToken.endToken)) @@ -5236,7 +5236,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2579 + //line php5/php5.y:2580 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5244,7 +5244,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2585 + //line php5/php5.y:2586 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5252,7 +5252,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2591 + //line php5/php5.y:2592 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5260,7 +5260,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2597 + //line php5/php5.y:2598 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5268,7 +5268,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2606 + //line php5/php5.y:2607 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5276,7 +5276,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2612 + //line php5/php5.y:2613 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5284,7 +5284,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2618 + //line php5/php5.y:2619 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5292,19 +5292,19 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2627 + //line php5/php5.y:2628 { yyVAL.node = yyDollar[1].node } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2629 + //line php5/php5.y:2630 { yyVAL.node = yyDollar[1].node } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2634 + //line php5/php5.y:2635 { yyVAL.node = yyDollar[1].node @@ -5342,79 +5342,79 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2670 + //line php5/php5.y:2671 { yyVAL.node = yyDollar[1].node } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2676 + //line php5/php5.y:2677 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2678 + //line php5/php5.y:2679 { yyVAL.list = []node.Node{} } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2684 + //line php5/php5.y:2685 { yyVAL.list = yyDollar[2].list } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2689 + //line php5/php5.y:2690 { yyVAL.node = nil } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2691 + //line php5/php5.y:2692 { yyVAL.node = nil } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2693 + //line php5/php5.y:2694 { yyVAL.node = yyDollar[1].node } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2698 + //line php5/php5.y:2699 { yyVAL.list = []node.Node{} } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2700 + //line php5/php5.y:2701 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2702 + //line php5/php5.y:2703 { yyVAL.list = yyDollar[1].list } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2707 + //line php5/php5.y:2708 { yyVAL.nodesWithEndToken = nil } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2709 + //line php5/php5.y:2710 { yyVAL.nodesWithEndToken = yyDollar[1].nodesWithEndToken } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2714 + //line php5/php5.y:2715 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5422,7 +5422,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2720 + //line php5/php5.y:2721 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5430,7 +5430,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2726 + //line php5/php5.y:2727 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5438,7 +5438,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2732 + //line php5/php5.y:2733 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5446,7 +5446,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2738 + //line php5/php5.y:2739 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5454,7 +5454,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2744 + //line php5/php5.y:2745 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5462,7 +5462,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2750 + //line php5/php5.y:2751 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5470,7 +5470,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2756 + //line php5/php5.y:2757 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5478,7 +5478,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2762 + //line php5/php5.y:2763 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5486,7 +5486,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2768 + //line php5/php5.y:2769 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5494,7 +5494,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2774 + //line php5/php5.y:2775 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5506,7 +5506,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2784 + //line php5/php5.y:2785 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -5514,7 +5514,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2793 + //line php5/php5.y:2794 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5526,25 +5526,25 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2806 + //line php5/php5.y:2807 { yyVAL.node = yyDollar[1].node } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2811 + //line php5/php5.y:2812 { yyVAL.node = yyDollar[1].node } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2813 + //line php5/php5.y:2814 { yyVAL.node = yyDollar[1].node } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2815 + //line php5/php5.y:2816 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5556,7 +5556,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2825 + //line php5/php5.y:2826 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5568,7 +5568,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2835 + //line php5/php5.y:2836 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5580,7 +5580,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2845 + //line php5/php5.y:2846 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5588,7 +5588,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2851 + //line php5/php5.y:2852 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5596,13 +5596,13 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2857 + //line php5/php5.y:2858 { yyVAL.node = yyDollar[1].node } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2859 + //line php5/php5.y:2860 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5610,13 +5610,13 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2865 + //line php5/php5.y:2866 { yyVAL.node = yyDollar[1].node } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2870 + //line php5/php5.y:2871 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5624,7 +5624,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2876 + //line php5/php5.y:2877 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5632,7 +5632,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2882 + //line php5/php5.y:2883 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5640,7 +5640,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2888 + //line php5/php5.y:2889 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5648,7 +5648,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2894 + //line php5/php5.y:2895 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5656,7 +5656,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2900 + //line php5/php5.y:2901 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5664,7 +5664,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2906 + //line php5/php5.y:2907 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5672,7 +5672,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2912 + //line php5/php5.y:2913 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5680,7 +5680,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2918 + //line php5/php5.y:2919 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5688,7 +5688,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2924 + //line php5/php5.y:2925 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5696,7 +5696,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2930 + //line php5/php5.y:2931 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5704,7 +5704,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2936 + //line php5/php5.y:2937 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5712,7 +5712,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2942 + //line php5/php5.y:2943 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5720,7 +5720,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2948 + //line php5/php5.y:2949 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5728,7 +5728,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2954 + //line php5/php5.y:2955 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5736,7 +5736,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2960 + //line php5/php5.y:2961 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5744,7 +5744,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2966 + //line php5/php5.y:2967 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5752,7 +5752,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2972 + //line php5/php5.y:2973 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5760,7 +5760,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2978 + //line php5/php5.y:2979 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5768,7 +5768,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2984 + //line php5/php5.y:2985 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5776,7 +5776,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2990 + //line php5/php5.y:2991 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5784,7 +5784,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2996 + //line php5/php5.y:2997 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5792,7 +5792,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3002 + //line php5/php5.y:3003 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5800,7 +5800,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3008 + //line php5/php5.y:3009 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5808,7 +5808,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3014 + //line php5/php5.y:3015 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5816,7 +5816,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3020 + //line php5/php5.y:3021 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5824,7 +5824,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3026 + //line php5/php5.y:3027 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5832,7 +5832,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3032 + //line php5/php5.y:3033 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5840,7 +5840,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3038 + //line php5/php5.y:3039 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5848,7 +5848,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3044 + //line php5/php5.y:3045 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -5856,7 +5856,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3050 + //line php5/php5.y:3051 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5864,7 +5864,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3056 + //line php5/php5.y:3057 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5872,19 +5872,19 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3062 + //line php5/php5.y:3063 { yyVAL.node = yyDollar[2].node } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3067 + //line php5/php5.y:3068 { yyVAL.node = yyDollar[1].node } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3069 + //line php5/php5.y:3070 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5896,7 +5896,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3079 + //line php5/php5.y:3080 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5908,7 +5908,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3089 + //line php5/php5.y:3090 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5920,7 +5920,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3102 + //line php5/php5.y:3103 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5932,25 +5932,25 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3112 + //line php5/php5.y:3113 { yyVAL.node = yyDollar[1].node } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3114 + //line php5/php5.y:3115 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3116 + //line php5/php5.y:3117 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3118 + //line php5/php5.y:3119 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5958,7 +5958,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3124 + //line php5/php5.y:3125 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5966,7 +5966,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3130 + //line php5/php5.y:3131 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5974,19 +5974,19 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3139 + //line php5/php5.y:3140 { yyVAL.list = nil } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3141 + //line php5/php5.y:3142 { yyVAL.list = yyDollar[1].list } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3151 + //line php5/php5.y:3152 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -5996,7 +5996,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3159 + //line php5/php5.y:3160 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6006,7 +6006,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3167 + //line php5/php5.y:3168 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6016,7 +6016,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3175 + //line php5/php5.y:3176 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6026,49 +6026,49 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3186 + //line php5/php5.y:3187 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3188 + //line php5/php5.y:3189 { yyVAL.node = yyDollar[1].node } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3193 + //line php5/php5.y:3194 { yyVAL.node = yyDollar[2].node } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3195 + //line php5/php5.y:3196 { yyVAL.node = yyDollar[2].node } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3201 + //line php5/php5.y:3202 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3207 + //line php5/php5.y:3208 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3212 + //line php5/php5.y:3213 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3217 + //line php5/php5.y:3218 { yyVAL.node = yyDollar[1].node @@ -6123,25 +6123,25 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3270 + //line php5/php5.y:3271 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3275 + //line php5/php5.y:3276 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3277 + //line php5/php5.y:3278 { yyVAL.list = []node.Node{} } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3283 + //line php5/php5.y:3284 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -6152,7 +6152,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3295 + //line php5/php5.y:3296 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6161,7 +6161,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3302 + //line php5/php5.y:3303 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6170,38 +6170,38 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3312 + //line php5/php5.y:3313 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].nodesWithEndToken.nodes) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].nodesWithEndToken.nodes, yyDollar[1].nodesWithEndToken.endToken)) } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3320 + //line php5/php5.y:3321 { yyVAL.list = []node.Node{yyDollar[1].node} } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3322 + //line php5/php5.y:3323 { yyVAL.list = yyDollar[1].list } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3324 + //line php5/php5.y:3325 { yyVAL.list = nil } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3329 + //line php5/php5.y:3330 { yyVAL.node = yyDollar[1].node } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3331 + //line php5/php5.y:3332 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6213,7 +6213,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3344 + //line php5/php5.y:3345 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6221,7 +6221,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3350 + //line php5/php5.y:3351 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6229,13 +6229,13 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3360 + //line php5/php5.y:3361 { yyVAL.node = yyDollar[1].node } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3365 + //line php5/php5.y:3366 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6243,7 +6243,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3371 + //line php5/php5.y:3372 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6251,31 +6251,31 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3379 + //line php5/php5.y:3380 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3380 + //line php5/php5.y:3381 { yyVAL.node = yyDollar[1].node } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3381 + //line php5/php5.y:3382 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3387 + //line php5/php5.y:3388 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3389 + //line php5/php5.y:3390 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6287,13 +6287,13 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3399 + //line php5/php5.y:3400 { yyVAL.node = yyDollar[1].node } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3404 + //line php5/php5.y:3405 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6301,7 +6301,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3410 + //line php5/php5.y:3411 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6309,13 +6309,13 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3416 + //line php5/php5.y:3417 { yyVAL.node = yyDollar[1].node } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3422 + //line php5/php5.y:3423 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6327,7 +6327,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3432 + //line php5/php5.y:3433 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6335,25 +6335,25 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3441 + //line php5/php5.y:3442 { yyVAL.node = nil } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3443 + //line php5/php5.y:3444 { yyVAL.node = yyDollar[1].node } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3449 + //line php5/php5.y:3450 { yyVAL.list = yyDollar[1].list } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3451 + //line php5/php5.y:3452 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6362,7 +6362,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3461 + //line php5/php5.y:3462 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6371,7 +6371,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3468 + //line php5/php5.y:3469 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6380,7 +6380,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3475 + //line php5/php5.y:3476 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6389,7 +6389,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3485 + //line php5/php5.y:3486 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6397,13 +6397,13 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3491 + //line php5/php5.y:3492 { yyVAL.node = yyDollar[2].node } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3496 + //line php5/php5.y:3497 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6413,7 +6413,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3504 + //line php5/php5.y:3505 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6427,13 +6427,13 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3519 + //line php5/php5.y:3520 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3521 + //line php5/php5.y:3522 { if yyDollar[1].node == nil { yyVAL.list = []node.Node{} @@ -6443,7 +6443,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3533 + //line php5/php5.y:3534 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6451,7 +6451,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3539 + //line php5/php5.y:3540 { item := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6463,25 +6463,25 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3549 + //line php5/php5.y:3550 { yyVAL.node = nil } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3555 + //line php5/php5.y:3556 { yyVAL.list = []node.Node{} } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3557 + //line php5/php5.y:3558 { yyVAL.list = yyDollar[1].list } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3562 + //line php5/php5.y:3563 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -6491,7 +6491,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3570 + //line php5/php5.y:3571 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6501,7 +6501,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3578 + //line php5/php5.y:3579 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6511,7 +6511,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3586 + //line php5/php5.y:3587 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6521,7 +6521,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3594 + //line php5/php5.y:3595 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[6].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) @@ -6531,7 +6531,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3602 + //line php5/php5.y:3603 { arrayItem := expr.NewArrayItem(nil, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) @@ -6541,7 +6541,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3610 + //line php5/php5.y:3611 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -6551,7 +6551,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3618 + //line php5/php5.y:3619 { arrayItem := expr.NewArrayItem(nil, yyDollar[2].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6561,13 +6561,13 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3629 + //line php5/php5.y:3630 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3631 + //line php5/php5.y:3632 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6576,13 +6576,13 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3638 + //line php5/php5.y:3639 { yyVAL.list = []node.Node{yyDollar[1].node} } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3640 + //line php5/php5.y:3641 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6591,7 +6591,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3650 + //line php5/php5.y:3651 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6603,7 +6603,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3660 + //line php5/php5.y:3661 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6618,7 +6618,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3673 + //line php5/php5.y:3674 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6636,7 +6636,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3689 + //line php5/php5.y:3690 { yyVAL.node = yyDollar[2].node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6644,7 +6644,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3695 + //line php5/php5.y:3696 { identifier := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6659,13 +6659,13 @@ yydefault: } case 500: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3709 + //line php5/php5.y:3710 { yyVAL.node = yyDollar[2].node } case 501: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3714 + //line php5/php5.y:3715 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6673,7 +6673,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3720 + //line php5/php5.y:3721 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -6687,7 +6687,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3732 + //line php5/php5.y:3733 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6699,7 +6699,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3745 + //line php5/php5.y:3746 { yyVAL.node = expr.NewIsset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6707,7 +6707,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3751 + //line php5/php5.y:3752 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6715,7 +6715,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3757 + //line php5/php5.y:3758 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6723,7 +6723,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3763 + //line php5/php5.y:3764 { yyVAL.node = expr.NewInclude(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6731,7 +6731,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3769 + //line php5/php5.y:3770 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6739,7 +6739,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3775 + //line php5/php5.y:3776 { yyVAL.node = expr.NewEval(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6747,7 +6747,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3781 + //line php5/php5.y:3782 { yyVAL.node = expr.NewRequire(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6755,7 +6755,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3787 + //line php5/php5.y:3788 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6763,31 +6763,31 @@ yydefault: } case 512: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3796 + //line php5/php5.y:3797 { yyVAL.list = []node.Node{yyDollar[1].node} } case 513: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3798 + //line php5/php5.y:3799 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 514: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3803 + //line php5/php5.y:3804 { yyVAL.node = yyDollar[1].node } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3805 + //line php5/php5.y:3806 { yyVAL.node = yyDollar[1].node } case 516: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3810 + //line php5/php5.y:3811 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6799,7 +6799,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3820 + //line php5/php5.y:3821 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6811,7 +6811,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3833 + //line php5/php5.y:3834 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6823,7 +6823,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3846 + //line php5/php5.y:3847 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) diff --git a/php5/php5.y b/php5/php5.y index 52df78e..8d620e6 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -193,6 +193,7 @@ import ( %token '%' %token '<' %token '>' +%token '.' %left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE %left ',' diff --git a/php7/parser.go b/php7/parser.go index 4ca16d4..7dad2bc 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -96,7 +96,6 @@ func (l *Parser) GetPositions() parser.Positions { return l.positions } -// GetPositions returns positions list func (l *Parser) setCommentsFromChildNode(n node.Node, c node.Node) { l.comments.AddComments(n, l.comments[c]) delete(l.comments, c) diff --git a/php7/php7.go b/php7/php7.go index 3f7b6a8..b4eac43 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -8,6 +8,7 @@ import ( "strconv" "strings" + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/expr" "github.com/z7zmey/php-parser/node/expr/assign" @@ -19,7 +20,7 @@ import ( "github.com/z7zmey/php-parser/scanner" ) -//line php7/php7.y:21 +//line php7/php7.y:22 type yySymType struct { yys int node node.Node @@ -344,7 +345,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:4107 +//line php7/php7.y:4114 type foreachVariable struct { node node.Node @@ -2132,7 +2133,7 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:291 + //line php7/php7.y:293 { yylex.(*Parser).rootNode = stmt.NewStmtList(yyDollar[1].list) @@ -2141,463 +2142,463 @@ yydefault: } case 2: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:300 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 3: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:300 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:300 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 5: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:300 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:300 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:300 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:300 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:300 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 10: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 11: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 12: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 13: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 14: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 15: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 16: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 17: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 18: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 21: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 22: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 23: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 24: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 27: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 28: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 29: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 30: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 33: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 34: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 35: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 36: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 37: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 38: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 39: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 44: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 46: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 47: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 48: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 49: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 50: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 51: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 52: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 53: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 54: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 55: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 56: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 57: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 58: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 59: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 60: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 61: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 62: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 63: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 64: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 66: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 67: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 68: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 69: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 70: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 72: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 73: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 74: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 75: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 76: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 77: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 78: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:324 + //line php7/php7.y:326 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2605,13 +2606,13 @@ yydefault: } case 79: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:330 + //line php7/php7.y:332 { yyVAL.list = []node.Node{} } case 80: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:335 + //line php7/php7.y:337 { namePart := name.NewNamePart(yyDollar[1].token.Value) yyVAL.list = []node.Node{namePart} @@ -2620,11 +2621,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(namePart, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(namePart, yyDollar[1].token, comment.StringToken) } case 81: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:346 + //line php7/php7.y:348 { namePart := name.NewNamePart(yyDollar[3].token.Value) yyVAL.list = append(yyDollar[1].list, namePart) @@ -2633,12 +2634,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(namePart, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken(namePart, yyDollar[3].token, comment.StringToken) } case 82: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:361 + //line php7/php7.y:363 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -2647,7 +2648,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:368 + //line php7/php7.y:370 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -2655,12 +2656,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NsSeparatorToken) } case 84: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:379 + //line php7/php7.y:381 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -2668,48 +2669,48 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) } case 85: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:392 + //line php7/php7.y:394 { // error yyVAL.node = nil } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:397 + //line php7/php7.y:399 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:399 + //line php7/php7.y:401 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:401 + //line php7/php7.y:403 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:403 + //line php7/php7.y:405 { yyVAL.node = yyDollar[1].node } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:405 + //line php7/php7.y:407 { yyVAL.node = yyDollar[1].node } case 91: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:407 + //line php7/php7.y:409 { yyVAL.node = stmt.NewHaltCompiler() @@ -2717,14 +2718,14 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.HaltCompilerToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 92: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:420 + //line php7/php7.y:422 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2734,12 +2735,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 93: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:433 + //line php7/php7.y:435 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2749,13 +2750,13 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CloseCurlyBracesToken) } case 94: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:447 + //line php7/php7.y:449 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2763,13 +2764,13 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) } case 95: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:459 + //line php7/php7.y:461 { yyVAL.node = yyDollar[2].node @@ -2777,12 +2778,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 96: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:470 + //line php7/php7.y:472 { yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) @@ -2790,12 +2791,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 97: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:481 + //line php7/php7.y:483 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2803,12 +2804,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 98: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:492 + //line php7/php7.y:494 { yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) @@ -2816,12 +2817,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 99: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:503 + //line php7/php7.y:505 { yyVAL.node = stmt.NewConstList(yyDollar[2].list) @@ -2829,12 +2830,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ConstToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:517 + //line php7/php7.y:519 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2842,11 +2843,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FunctionToken) } case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:527 + //line php7/php7.y:529 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2854,11 +2855,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ConstToken) } case 102: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:540 + //line php7/php7.y:542 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2868,16 +2869,16 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.OpenCurlyBracesToken) if yyDollar[5].token != nil { - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CommaToken) } - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseCurlyBracesToken) } case 103: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:557 + //line php7/php7.y:559 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2887,17 +2888,17 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.OpenCurlyBracesToken) if yyDollar[6].token != nil { - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CommaToken) } - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[7].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseCurlyBracesToken) } case 104: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:578 + //line php7/php7.y:580 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2907,16 +2908,16 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.OpenCurlyBracesToken) if yyDollar[5].token != nil { - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CommaToken) } - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseCurlyBracesToken) } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:595 + //line php7/php7.y:597 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2926,86 +2927,86 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.OpenCurlyBracesToken) if yyDollar[6].token != nil { - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CommaToken) } - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[7].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseCurlyBracesToken) } case 106: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:616 + //line php7/php7.y:618 { yyVAL.token = nil } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:618 + //line php7/php7.y:620 { yyVAL.token = yyDollar[1].token } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:623 + //line php7/php7.y:625 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:630 + //line php7/php7.y:632 { yyVAL.list = []node.Node{yyDollar[1].node} } case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:635 + //line php7/php7.y:637 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:642 + //line php7/php7.y:644 { yyVAL.list = []node.Node{yyDollar[1].node} } case 112: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:647 + //line php7/php7.y:649 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:654 + //line php7/php7.y:656 { yyVAL.list = []node.Node{yyDollar[1].node} } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:659 + //line php7/php7.y:661 { yyVAL.node = yyDollar[1].node } case 115: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:661 + //line php7/php7.y:663 { yyVAL.node = yyDollar[2].node.(*stmt.Use).SetUseType(yyDollar[1].node) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:666 + //line php7/php7.y:668 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -3016,7 +3017,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:675 + //line php7/php7.y:677 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -3028,42 +3029,42 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(alias, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(alias, yyDollar[3].token, comment.StringToken) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:693 + //line php7/php7.y:695 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:695 + //line php7/php7.y:697 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:705 + //line php7/php7.y:707 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:712 + //line php7/php7.y:714 { yyVAL.list = []node.Node{yyDollar[1].node} } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:717 + //line php7/php7.y:719 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3071,50 +3072,50 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:723 + //line php7/php7.y:725 { yyVAL.list = []node.Node{} } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:728 + //line php7/php7.y:730 { // error yyVAL.node = nil } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:733 + //line php7/php7.y:735 { yyVAL.node = yyDollar[1].node } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:735 + //line php7/php7.y:737 { yyVAL.node = yyDollar[1].node } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:737 + //line php7/php7.y:739 { yyVAL.node = yyDollar[1].node } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:739 + //line php7/php7.y:741 { yyVAL.node = yyDollar[1].node } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:741 + //line php7/php7.y:743 { yyVAL.node = yyDollar[1].node } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:743 + //line php7/php7.y:745 { yyVAL.node = stmt.NewHaltCompiler() @@ -3122,14 +3123,14 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.HaltCompilerToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:758 + //line php7/php7.y:760 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3137,24 +3138,24 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) } case 132: - yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:769 - { - yyVAL.node = yyDollar[1].node - } - case 133: yyDollar = yyS[yypt-1 : yypt+1] //line php7/php7.y:771 { yyVAL.node = yyDollar[1].node } + case 133: + yyDollar = yyS[yypt-1 : yypt+1] + //line php7/php7.y:773 + { + yyVAL.node = yyDollar[1].node + } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:773 + //line php7/php7.y:775 { if yyDollar[5].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltWhile(yyDollar[3].node, yyDollar[5].altSyntaxNode.node) @@ -3166,13 +3167,13 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].altSyntaxNode.node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.WhileToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:789 + //line php7/php7.y:791 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) @@ -3180,15 +3181,15 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[7].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.WhileToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.SemiColonToken) } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:803 + //line php7/php7.y:805 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltFor(yyDollar[3].list, yyDollar[5].list, yyDollar[7].list, yyDollar[9].altSyntaxNode.node) @@ -3200,15 +3201,15 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].altSyntaxNode.node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[8].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseParenthesisToken) } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:821 + //line php7/php7.y:823 { if yyDollar[5].nodesWithEndToken.endToken.Value == ";" { yyVAL.node = stmt.NewAltSwitch(yyDollar[3].node, yyDollar[5].nodesWithEndToken.nodes) @@ -3220,13 +3221,13 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].nodesWithEndToken.endToken)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SwitchToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:837 + //line php7/php7.y:839 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3234,12 +3235,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BreakToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:848 + //line php7/php7.y:850 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3247,12 +3248,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ContinueToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:859 + //line php7/php7.y:861 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3260,12 +3261,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ReturnToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:870 + //line php7/php7.y:872 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3273,12 +3274,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.GlobalToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:881 + //line php7/php7.y:883 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3286,12 +3287,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:892 + //line php7/php7.y:894 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3299,12 +3300,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EchoToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:903 + //line php7/php7.y:905 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3312,11 +3313,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.InlineHTMLToken) } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:913 + //line php7/php7.y:915 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3324,11 +3325,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:923 + //line php7/php7.y:925 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3336,17 +3337,17 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UnsetToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) if yyDollar[4].token != nil { - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CommaToken) } - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.SemiColonToken) } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:939 + //line php7/php7.y:941 { if yyDollar[7].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, nil, yyDollar[5].foreachVariable.node, yyDollar[7].altSyntaxNode.node, yyDollar[5].foreachVariable.byRef) @@ -3358,14 +3359,14 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[7].altSyntaxNode.node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForeachToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseParenthesisToken) } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:956 + //line php7/php7.y:958 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, yyDollar[5].node, yyDollar[7].foreachVariable.node, yyDollar[9].altSyntaxNode.node, yyDollar[7].foreachVariable.byRef) @@ -3377,15 +3378,15 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].altSyntaxNode.node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[8].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForeachToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.DoubleArrowToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseParenthesisToken) } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:974 + //line php7/php7.y:976 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) @@ -3393,13 +3394,13 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DeclareToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:986 + //line php7/php7.y:988 { yyVAL.node = stmt.NewNop() @@ -3407,11 +3408,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:996 + //line php7/php7.y:998 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3422,13 +3423,13 @@ yydefault: } // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TryToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1011 + //line php7/php7.y:1013 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3436,12 +3437,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ThrowToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1022 + //line php7/php7.y:1024 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3451,13 +3452,13 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(label, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.GotoToken) + yylex.(*Parser).comments.AddFromToken(label, yyDollar[2].token, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1036 + //line php7/php7.y:1038 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -3467,18 +3468,18 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddComments(label, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(label, yyDollar[1].token, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ColonToken) } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1051 + //line php7/php7.y:1053 { yyVAL.list = []node.Node{} } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1053 + //line php7/php7.y:1055 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[5].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -3491,37 +3492,37 @@ yydefault: yylex.(*Parser).positions.AddPosition(catch, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].token, yyDollar[9].token)) // save comments - yylex.(*Parser).comments.AddComments(catch, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(catch, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(variable, yyDollar[5].token.Comments()) - yylex.(*Parser).comments.AddComments(catch, yyDollar[6].token.Comments()) - yylex.(*Parser).comments.AddComments(catch, yyDollar[7].token.Comments()) - yylex.(*Parser).comments.AddComments(catch, yyDollar[9].token.Comments()) + yylex.(*Parser).comments.AddFromToken(catch, yyDollar[2].token, comment.CatchToken) + yylex.(*Parser).comments.AddFromToken(catch, yyDollar[3].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[5].token, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(catch, yyDollar[6].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(catch, yyDollar[7].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(catch, yyDollar[9].token, comment.CloseCurlyBracesToken) } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1075 + //line php7/php7.y:1077 { yyVAL.list = []node.Node{yyDollar[1].node} } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1077 + //line php7/php7.y:1079 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.VerticalBarToken) } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1087 + //line php7/php7.y:1089 { yyVAL.node = nil } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1089 + //line php7/php7.y:1091 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3529,34 +3530,34 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FinallyToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1104 + //line php7/php7.y:1106 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1106 + //line php7/php7.y:1108 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1116 + //line php7/php7.y:1118 { yyVAL.node = yyDollar[1].node } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1121 + //line php7/php7.y:1123 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].boolWithToken.value, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) @@ -3566,43 +3567,43 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FunctionToken) if yyDollar[2].boolWithToken.token != nil { - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].boolWithToken.token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].boolWithToken.token, comment.AmpersandToken) } - yylex.(*Parser).comments.AddComments(name, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(name, yyDollar[5].token.Comments()) - yylex.(*Parser).comments.AddComments(name, yyDollar[7].token.Comments()) - yylex.(*Parser).comments.AddComments(name, yyDollar[9].token.Comments()) - yylex.(*Parser).comments.AddComments(name, yyDollar[11].token.Comments()) + yylex.(*Parser).comments.AddFromToken(name, yyDollar[3].token, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[9].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[11].token, comment.CloseCurlyBracesToken) } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1144 + //line php7/php7.y:1146 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1146 + //line php7/php7.y:1148 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1151 + //line php7/php7.y:1153 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1153 + //line php7/php7.y:1155 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1158 + //line php7/php7.y:1160 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].node, yyDollar[5].list, yyDollar[8].list, yyDollar[6].str) @@ -3612,20 +3613,20 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[9].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(name, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ClassToken) + yylex.(*Parser).comments.AddFromToken(name, yyDollar[3].token, comment.StringToken) if yyDollar[4].node != nil { - yylex.(*Parser).setCommentsFromChildNode(yyVAL.node, yyDollar[4].node) + yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, yyDollar[4].node) } if yyDollar[5].list != nil { - yylex.(*Parser).setCommentsFromChildNode(yyVAL.node, firstNode(yyDollar[5].list)) + yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, firstNode(yyDollar[5].list)) } - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[7].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[9].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[9].token, comment.CloseCurlyBracesToken) } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1179 + //line php7/php7.y:1181 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) @@ -3635,32 +3636,32 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(name, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassToken) + yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringToken) if yyDollar[3].node != nil { - yylex.(*Parser).setCommentsFromChildNode(yyVAL.node, yyDollar[3].node) + yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, yyDollar[3].node) } if yyDollar[4].list != nil { - yylex.(*Parser).setCommentsFromChildNode(yyVAL.node, firstNode(yyDollar[4].list)) + yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, firstNode(yyDollar[4].list)) } - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[8].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseCurlyBracesToken) } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1203 + //line php7/php7.y:1205 { yyVAL.list = []node.Node{yyDollar[1].node} } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1205 + //line php7/php7.y:1207 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1210 + //line php7/php7.y:1212 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3668,11 +3669,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AbstractToken) } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1220 + //line php7/php7.y:1222 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3680,11 +3681,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FinalToken) } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1233 + //line php7/php7.y:1235 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3694,14 +3695,14 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(name, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TraitToken) + yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseCurlyBracesToken) } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1251 + //line php7/php7.y:1253 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].list, yyDollar[6].list, yyDollar[4].str) @@ -3711,68 +3712,68 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(name, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.InterfaceToken) + yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringToken) if yyDollar[3].list != nil { - yylex.(*Parser).setCommentsFromChildNode(yyVAL.node, firstNode(yyDollar[3].list)) + yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, firstNode(yyDollar[3].list)) } - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[7].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseCurlyBracesToken) } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1272 + //line php7/php7.y:1274 { yyVAL.node = nil } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1274 + //line php7/php7.y:1276 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ExtendsToken) } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1284 + //line php7/php7.y:1286 { yyVAL.list = nil } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1286 + //line php7/php7.y:1288 { yyVAL.list = yyDollar[2].list // save comments - yylex.(*Parser).comments.AddComments(firstNode(yyVAL.list), yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(firstNode(yyVAL.list), yyDollar[1].token, comment.ExtendsToken) } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1296 + //line php7/php7.y:1298 { yyVAL.list = nil } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1298 + //line php7/php7.y:1300 { yyVAL.list = yyDollar[2].list // save comments - yylex.(*Parser).comments.AddComments(firstNode(yyVAL.list), yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(firstNode(yyVAL.list), yyDollar[1].token, comment.ImplementsToken) } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1308 + //line php7/php7.y:1310 { yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1310 + //line php7/php7.y:1312 { yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} @@ -3780,11 +3781,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyDollar[2].node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyDollar[2].node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyDollar[2].node, yyDollar[1].token, comment.AmpersandToken) } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1320 + //line php7/php7.y:1322 { list := expr.NewList(yyDollar[3].list) yyVAL.foreachVariable = foreachVariable{list, false} @@ -3793,13 +3794,13 @@ yydefault: yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(list, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(list, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(list, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(list, yyDollar[1].token, comment.ListToken) + yylex.(*Parser).comments.AddFromToken(list, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(list, yyDollar[4].token, comment.CloseParenthesisToken) } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1333 + //line php7/php7.y:1335 { list := expr.NewShortList(yyDollar[2].list) yyVAL.foreachVariable = foreachVariable{list, false} @@ -3808,18 +3809,18 @@ yydefault: yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(list, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(list, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(list, yyDollar[1].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(list, yyDollar[3].token, comment.CloseSquareBracket) } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1348 + //line php7/php7.y:1350 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1350 + //line php7/php7.y:1352 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} @@ -3827,19 +3828,19 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[1].token, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[3].token, comment.EndforToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[4].token, comment.SemiColonToken) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1365 + //line php7/php7.y:1367 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1367 + //line php7/php7.y:1369 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} @@ -3847,19 +3848,19 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[1].token, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[3].token, comment.EndforeachToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[4].token, comment.SemiColonToken) } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1382 + //line php7/php7.y:1384 { yyVAL.node = yyDollar[1].node } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1384 + //line php7/php7.y:1386 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3867,43 +3868,43 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EnddeclareToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1398 + //line php7/php7.y:1400 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1399 + //line php7/php7.y:1401 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[4].token} } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1400 + //line php7/php7.y:1402 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[4].token} } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1401 + //line php7/php7.y:1403 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[5].token} } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1406 + //line php7/php7.y:1408 { yyVAL.list = []node.Node{} } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1408 + //line php7/php7.y:1410 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -3912,12 +3913,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) // save comments - yylex.(*Parser).comments.AddComments(_case, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(_case, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(_case, yyDollar[2].token, comment.CaseToken) + yylex.(*Parser).comments.AddFromToken(_case, yyDollar[4].token, comment.CaseSeparatorToken) } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1420 + //line php7/php7.y:1422 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -3926,30 +3927,30 @@ yydefault: yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) // save comments - yylex.(*Parser).comments.AddComments(_default, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(_default, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(_default, yyDollar[2].token, comment.DefaultToken) + yylex.(*Parser).comments.AddFromToken(_default, yyDollar[3].token, comment.CaseSeparatorToken) } case 200: - yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1435 - { - yyVAL.token = yyDollar[1].token - } - case 201: yyDollar = yyS[yypt-1 : yypt+1] //line php7/php7.y:1437 { yyVAL.token = yyDollar[1].token } + case 201: + yyDollar = yyS[yypt-1 : yypt+1] + //line php7/php7.y:1439 + { + yyVAL.token = yyDollar[1].token + } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1442 + //line php7/php7.y:1444 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1444 + //line php7/php7.y:1446 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} @@ -3957,13 +3958,13 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.altSyntaxNode.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[1].token, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[3].token, comment.EndwhileToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[4].token, comment.SemiColonToken) } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1459 + //line php7/php7.y:1461 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -3971,13 +3972,13 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IfToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1471 + //line php7/php7.y:1473 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -3987,19 +3988,19 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) // save comments - yylex.(*Parser).comments.AddComments(_elseIf, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(_elseIf, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(_elseIf, yyDollar[5].token.Comments()) + yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[2].token, comment.ElseifToken) + yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[3].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[5].token, comment.CloseParenthesisToken) } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1488 + //line php7/php7.y:1490 { yyVAL.node = yyDollar[1].node } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1490 + //line php7/php7.y:1492 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4009,11 +4010,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ElseToken) } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1505 + //line php7/php7.y:1507 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4023,14 +4024,14 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[6].list)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IfToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.ColonToken) } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1520 + //line php7/php7.y:1522 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4041,14 +4042,14 @@ yydefault: yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[7].list)) // save comments - yylex.(*Parser).comments.AddComments(_elseIf, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(_elseIf, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(_elseIf, yyDollar[5].token.Comments()) - yylex.(*Parser).comments.AddComments(_elseIf, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[2].token, comment.ElseifToken) + yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[3].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[5].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[6].token, comment.ColonToken) } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1539 + //line php7/php7.y:1541 { yyVAL.node = yyDollar[1].node @@ -4056,12 +4057,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EndifToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1550 + //line php7/php7.y:1552 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4073,41 +4074,41 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[6].token)) // save comments - yylex.(*Parser).comments.AddComments(_else, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(_else, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddFromToken(_else, yyDollar[2].token, comment.ElseToken) + yylex.(*Parser).comments.AddFromToken(_else, yyDollar[3].token, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.EndifToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.SemiColonToken) } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1570 + //line php7/php7.y:1572 { yyVAL.list = yyDollar[1].list } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1572 + //line php7/php7.y:1574 { yyVAL.list = nil } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1577 + //line php7/php7.y:1579 { yyVAL.list = []node.Node{yyDollar[1].node} } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1579 + //line php7/php7.y:1581 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1589 + //line php7/php7.y:1591 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4137,16 +4138,16 @@ yydefault: // save comments if yyDollar[2].boolWithToken.value { - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].boolWithToken.token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].boolWithToken.token, comment.AmpersandToken) } if yyDollar[3].boolWithToken.value { - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].boolWithToken.token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].boolWithToken.token, comment.EllipsisToken) } - yylex.(*Parser).comments.AddComments(variable, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[4].token, comment.VariableToken) } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1626 + //line php7/php7.y:1628 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4175,35 +4176,35 @@ yydefault: // save comments if yyDollar[2].boolWithToken.value { - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].boolWithToken.token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].boolWithToken.token, comment.AmpersandToken) } if yyDollar[3].boolWithToken.value { - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].boolWithToken.token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].boolWithToken.token, comment.EllipsisToken) } - yylex.(*Parser).comments.AddComments(variable, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[4].token, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.EqualToken) } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1666 + //line php7/php7.y:1668 { yyVAL.node = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1668 + //line php7/php7.y:1670 { yyVAL.node = yyDollar[1].node } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1673 + //line php7/php7.y:1675 { yyVAL.node = yyDollar[1].node } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1675 + //line php7/php7.y:1677 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4211,11 +4212,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.QuestionMarkToken) } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1688 + //line php7/php7.y:1690 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4223,11 +4224,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayToken) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1698 + //line php7/php7.y:1700 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4235,59 +4236,59 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.CallableToken) } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1708 + //line php7/php7.y:1710 { yyVAL.node = yyDollar[1].node } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1713 + //line php7/php7.y:1715 { yyVAL.node = nil } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1715 + //line php7/php7.y:1717 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1725 + //line php7/php7.y:1727 { yyVAL.nodesWithEndToken = &nodesWithEndToken{[]node.Node{}, yyDollar[2].token} } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1727 + //line php7/php7.y:1729 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[4].token} } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1732 + //line php7/php7.y:1734 { yyVAL.list = []node.Node{yyDollar[1].node} } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1734 + //line php7/php7.y:1736 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1744 + //line php7/php7.y:1746 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4296,7 +4297,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1751 + //line php7/php7.y:1753 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4304,47 +4305,47 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EllipsisToken) } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1764 + //line php7/php7.y:1766 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1771 + //line php7/php7.y:1773 { yyVAL.list = []node.Node{yyDollar[1].node} } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1776 + //line php7/php7.y:1778 { yyVAL.node = yyDollar[1].node } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1781 + //line php7/php7.y:1783 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1788 + //line php7/php7.y:1790 { yyVAL.list = []node.Node{yyDollar[1].node} } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1793 + //line php7/php7.y:1795 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4356,11 +4357,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1807 + //line php7/php7.y:1809 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4372,24 +4373,24 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1825 + //line php7/php7.y:1827 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1827 + //line php7/php7.y:1829 { yyVAL.list = []node.Node{} } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1832 + //line php7/php7.y:1834 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4397,11 +4398,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1842 + //line php7/php7.y:1844 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4409,12 +4410,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ConstToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1853 + //line php7/php7.y:1855 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].nodesWithEndToken.nodes) @@ -4422,11 +4423,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].nodesWithEndToken.endToken)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:1863 + //line php7/php7.y:1865 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].boolWithToken.value, yyDollar[7].list, yyDollar[9].node, yyDollar[10].nodesWithEndToken.nodes, yyDollar[5].str) @@ -4436,80 +4437,80 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[10].nodesWithEndToken.endToken)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.FunctionToken) if yyDollar[3].boolWithToken.value { - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].boolWithToken.token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].boolWithToken.token, comment.AmpersandToken) } - yylex.(*Parser).comments.AddComments(name, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[8].token.Comments()) + yylex.(*Parser).comments.AddFromToken(name, yyDollar[4].token, comment.IdentifierToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseParenthesisToken) } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1884 + //line php7/php7.y:1886 { yyVAL.list = []node.Node{yyDollar[1].node} } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1886 + //line php7/php7.y:1888 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1896 + //line php7/php7.y:1898 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1898 + //line php7/php7.y:1900 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[2].token} } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1900 + //line php7/php7.y:1902 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1905 + //line php7/php7.y:1907 { yyVAL.list = []node.Node{yyDollar[1].node} } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1907 + //line php7/php7.y:1909 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1912 + //line php7/php7.y:1914 { yyVAL.node = yyDollar[1].node // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1919 + //line php7/php7.y:1921 { yyVAL.node = yyDollar[1].node // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1929 + //line php7/php7.y:1931 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4517,11 +4518,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.InsteadofToken) } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1942 + //line php7/php7.y:1944 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4531,12 +4532,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(alias, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(alias, yyDollar[3].token, comment.StringToken) } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1955 + //line php7/php7.y:1957 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4546,12 +4547,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(alias, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(alias, yyDollar[3].token, comment.StringToken) } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1968 + //line php7/php7.y:1970 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -4561,12 +4562,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(alias, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(alias, yyDollar[4].token, comment.IdentifierToken) } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1981 + //line php7/php7.y:1983 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -4574,11 +4575,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1994 + //line php7/php7.y:1996 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -4588,17 +4589,17 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.IdentifierToken) } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2006 + //line php7/php7.y:2008 { yyVAL.node = yyDollar[1].node } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2011 + //line php7/php7.y:2013 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -4608,30 +4609,30 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(target, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yylex.(*Parser).comments.AddFromToken(target, yyDollar[3].token, comment.IdentifierToken) } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2026 + //line php7/php7.y:2028 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2027 + //line php7/php7.y:2029 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2032 + //line php7/php7.y:2034 { yyVAL.list = yyDollar[1].list } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2034 + //line php7/php7.y:2036 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -4640,35 +4641,35 @@ yydefault: yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(modifier, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(modifier, yyDollar[1].token, comment.VarToken) } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2048 + //line php7/php7.y:2050 { yyVAL.list = nil } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2050 + //line php7/php7.y:2052 { yyVAL.list = yyDollar[1].list } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2055 + //line php7/php7.y:2057 { yyVAL.list = []node.Node{yyDollar[1].node} } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2057 + //line php7/php7.y:2059 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2062 + //line php7/php7.y:2064 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4676,11 +4677,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PublicToken) } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2072 + //line php7/php7.y:2074 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4688,11 +4689,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ProtectedToken) } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2082 + //line php7/php7.y:2084 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4700,11 +4701,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PrivateToken) } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2092 + //line php7/php7.y:2094 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4712,11 +4713,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2102 + //line php7/php7.y:2104 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4724,11 +4725,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AbstractToken) } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2112 + //line php7/php7.y:2114 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4736,26 +4737,26 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FinalToken) } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2125 + //line php7/php7.y:2127 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2132 + //line php7/php7.y:2134 { yyVAL.list = []node.Node{yyDollar[1].node} } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2137 + //line php7/php7.y:2139 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4767,11 +4768,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2151 + //line php7/php7.y:2153 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4783,27 +4784,27 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2169 + //line php7/php7.y:2171 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2176 + //line php7/php7.y:2178 { yyVAL.list = []node.Node{yyDollar[1].node} } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2181 + //line php7/php7.y:2183 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4813,12 +4814,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.IdentifierToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2197 + //line php7/php7.y:2199 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4828,60 +4829,60 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2213 + //line php7/php7.y:2215 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2220 + //line php7/php7.y:2222 { yyVAL.list = []node.Node{yyDollar[1].node} } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2225 + //line php7/php7.y:2227 { yyVAL.node = yyDollar[1].node } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2230 + //line php7/php7.y:2232 { yyVAL.list = nil } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2232 + //line php7/php7.y:2234 { yyVAL.list = yyDollar[1].list } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2237 + //line php7/php7.y:2239 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2244 + //line php7/php7.y:2246 { yyVAL.list = []node.Node{yyDollar[1].node} } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:2249 + //line php7/php7.y:2251 { if yyDollar[2].nodesWithEndToken != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].nodesWithEndToken.nodes, yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) @@ -4893,19 +4894,19 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassToken) if yyDollar[3].node != nil { - yylex.(*Parser).setCommentsFromChildNode(yyVAL.node, yyDollar[3].node) + yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, yyDollar[3].node) } if yyDollar[4].list != nil { - yylex.(*Parser).setCommentsFromChildNode(yyVAL.node, firstNode(yyDollar[4].list)) + yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, firstNode(yyDollar[4].list)) } - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[8].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseCurlyBracesToken) } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2274 + //line php7/php7.y:2276 { if yyDollar[3].nodesWithEndToken != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].nodesWithEndToken.nodes) @@ -4916,11 +4917,11 @@ yydefault: } // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NewToken) } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2287 + //line php7/php7.y:2289 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -4928,11 +4929,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NewToken) } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2300 + //line php7/php7.y:2302 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -4942,14 +4943,14 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) // save comments - yylex.(*Parser).comments.AddComments(list, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(list, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(list, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) + yylex.(*Parser).comments.AddFromToken(list, yyDollar[1].token, comment.ListToken) + yylex.(*Parser).comments.AddFromToken(list, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(list, yyDollar[4].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.EqualToken) } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:2315 + //line php7/php7.y:2317 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -4959,13 +4960,13 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddComments(shortList, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(shortList, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(shortList, yyDollar[1].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(shortList, yyDollar[3].token, comment.CloseSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.EqualToken) } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2329 + //line php7/php7.y:2331 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -4973,11 +4974,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2339 + //line php7/php7.y:2341 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -4985,12 +4986,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AmpersandToken) } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2350 + //line php7/php7.y:2352 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -4998,11 +4999,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.CloneToken) } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2360 + //line php7/php7.y:2362 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5010,11 +5011,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PlusEqualToken) } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2370 + //line php7/php7.y:2372 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5022,11 +5023,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MinusEqualToken) } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2380 + //line php7/php7.y:2382 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5034,11 +5035,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MulEqualToken) } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2390 + //line php7/php7.y:2392 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5046,11 +5047,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PowEqualToken) } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2400 + //line php7/php7.y:2402 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5058,11 +5059,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DivEqualToken) } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2410 + //line php7/php7.y:2412 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5070,11 +5071,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ConcatEqualToken) } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2420 + //line php7/php7.y:2422 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5082,11 +5083,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ModEqualToken) } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2430 + //line php7/php7.y:2432 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5094,11 +5095,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AndEqualToken) } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2440 + //line php7/php7.y:2442 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5106,11 +5107,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OrEqualToken) } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2450 + //line php7/php7.y:2452 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5118,11 +5119,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.XorEqualToken) } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2460 + //line php7/php7.y:2462 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5130,11 +5131,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlEqualToken) } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2470 + //line php7/php7.y:2472 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5142,11 +5143,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SrEqualToken) } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2480 + //line php7/php7.y:2482 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5154,11 +5155,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IncToken) } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2490 + //line php7/php7.y:2492 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5166,11 +5167,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncToken) } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2500 + //line php7/php7.y:2502 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5178,11 +5179,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DecToken) } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2510 + //line php7/php7.y:2512 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5190,11 +5191,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DecToken) } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2520 + //line php7/php7.y:2522 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5202,11 +5203,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanOrToken) } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2530 + //line php7/php7.y:2532 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5214,11 +5215,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanAndToken) } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2540 + //line php7/php7.y:2542 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5226,11 +5227,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalOrToken) } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2550 + //line php7/php7.y:2552 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5238,11 +5239,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalAndToken) } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2560 + //line php7/php7.y:2562 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5250,11 +5251,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalXorToken) } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2570 + //line php7/php7.y:2572 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5262,11 +5263,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.VerticalBarToken) } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2580 + //line php7/php7.y:2582 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5274,11 +5275,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2590 + //line php7/php7.y:2592 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5286,18 +5287,23 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CaretToken) } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2600 + //line php7/php7.y:2602 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DotToken) } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2605 + //line php7/php7.y:2612 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5305,11 +5311,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PlusToken) } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2615 + //line php7/php7.y:2622 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5317,11 +5323,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MinusToken) } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2625 + //line php7/php7.y:2632 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5329,11 +5335,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsteriskToken) } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2635 + //line php7/php7.y:2642 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5341,11 +5347,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PowToken) } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2645 + //line php7/php7.y:2652 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5353,11 +5359,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlashToken) } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2655 + //line php7/php7.y:2662 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5365,11 +5371,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PercentToken) } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2665 + //line php7/php7.y:2672 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5377,11 +5383,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlToken) } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2675 + //line php7/php7.y:2682 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5389,11 +5395,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SrToken) } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2685 + //line php7/php7.y:2692 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -5401,11 +5407,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PlusToken) } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2695 + //line php7/php7.y:2702 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -5413,11 +5419,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MinusToken) } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2705 + //line php7/php7.y:2712 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -5425,11 +5431,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ExclamationMarkToken) } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2715 + //line php7/php7.y:2722 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -5437,11 +5443,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TildeToken) } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2725 + //line php7/php7.y:2732 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5449,11 +5455,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsIdenticalToken) } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2735 + //line php7/php7.y:2742 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5461,11 +5467,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotIdenticalToken) } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2745 + //line php7/php7.y:2752 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -5473,11 +5479,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsEqualToken) } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2755 + //line php7/php7.y:2762 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -5485,11 +5491,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotEqualToken) } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2765 + //line php7/php7.y:2772 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -5497,11 +5503,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LessToken) } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2775 + //line php7/php7.y:2782 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5509,11 +5515,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsSmallerOrEqualToken) } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2785 + //line php7/php7.y:2792 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -5521,11 +5527,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.GreaterToken) } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2795 + //line php7/php7.y:2802 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5533,11 +5539,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsGreaterOrEqualToken) } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2805 + //line php7/php7.y:2812 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -5545,11 +5551,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SpaceshipToken) } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2815 + //line php7/php7.y:2822 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -5557,27 +5563,27 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.InstanceofToken) } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2825 + //line php7/php7.y:2832 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2833 + //line php7/php7.y:2840 { yyVAL.node = yyDollar[1].node } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:2835 + //line php7/php7.y:2842 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -5585,12 +5591,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.ColonToken) } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2846 + //line php7/php7.y:2853 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -5598,12 +5604,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.ColonToken) } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2857 + //line php7/php7.y:2864 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -5611,17 +5617,17 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CoalesceToken) } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2867 + //line php7/php7.y:2874 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2869 + //line php7/php7.y:2876 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -5629,11 +5635,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IntCastToken) } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2879 + //line php7/php7.y:2886 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -5641,11 +5647,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoubleCastToken) } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2889 + //line php7/php7.y:2896 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -5653,11 +5659,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringCastToken) } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2899 + //line php7/php7.y:2906 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -5665,11 +5671,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayCastToken) } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2909 + //line php7/php7.y:2916 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -5677,11 +5683,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ObjectCastToken) } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2919 + //line php7/php7.y:2926 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -5689,11 +5695,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BoolCastToken) } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2929 + //line php7/php7.y:2936 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -5701,11 +5707,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UnsetCastToken) } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2939 + //line php7/php7.y:2946 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -5717,11 +5723,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ExitToken) } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2953 + //line php7/php7.y:2960 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -5729,17 +5735,17 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AtToken) } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2963 + //line php7/php7.y:2970 { yyVAL.node = yyDollar[1].node } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2965 + //line php7/php7.y:2972 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -5747,12 +5753,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BackquoteToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.BackquoteToken) } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2976 + //line php7/php7.y:2983 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -5760,11 +5766,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PrintToken) } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2986 + //line php7/php7.y:2993 { yyVAL.node = expr.NewYield(nil, nil) @@ -5772,11 +5778,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2996 + //line php7/php7.y:3003 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -5784,11 +5790,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3006 + //line php7/php7.y:3013 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -5796,12 +5802,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.DoubleArrowToken) } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3017 + //line php7/php7.y:3024 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -5809,11 +5815,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldFromToken) } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3027 + //line php7/php7.y:3034 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].boolWithToken.value, yyDollar[3].str) @@ -5821,18 +5827,18 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FunctionToken) if yyDollar[2].boolWithToken.value { - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].boolWithToken.token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].boolWithToken.token, comment.AmpersandToken) } - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[9].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[11].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[9].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[11].token, comment.CloseCurlyBracesToken) } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:3044 + //line php7/php7.y:3051 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].list, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].boolWithToken.value, yyDollar[4].str) @@ -5840,65 +5846,65 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[12].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.FunctionToken) if yyDollar[3].boolWithToken.value { - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].boolWithToken.token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].boolWithToken.token, comment.AmpersandToken) } - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[7].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[10].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[12].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[10].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[12].token, comment.CloseCurlyBracesToken) } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3065 + //line php7/php7.y:3072 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3073 + //line php7/php7.y:3080 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3075 + //line php7/php7.y:3082 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3080 + //line php7/php7.y:3087 { yyVAL.list = []node.Node{} } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3082 + //line php7/php7.y:3089 { yyVAL.list = yyDollar[3].list } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3087 + //line php7/php7.y:3094 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3094 + //line php7/php7.y:3101 { yyVAL.list = []node.Node{yyDollar[1].node} } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3099 + //line php7/php7.y:3106 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -5910,11 +5916,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3113 + //line php7/php7.y:3120 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -5926,12 +5932,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddComments(variable, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AmpersandToken) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[2].token, comment.VariableToken) } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3131 + //line php7/php7.y:3138 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].nodesWithEndToken.nodes) @@ -5940,7 +5946,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3138 + //line php7/php7.y:3145 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) @@ -5948,11 +5954,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3148 + //line php7/php7.y:3155 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) @@ -5960,11 +5966,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3158 + //line php7/php7.y:3165 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].nodesWithEndToken.nodes) @@ -5973,7 +5979,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3168 + //line php7/php7.y:3175 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5981,71 +5987,71 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) } case 385: - yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3178 - { - yyVAL.node = yyDollar[1].node - } - case 386: - yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3183 - { - yyVAL.node = yyDollar[1].node - } - case 387: yyDollar = yyS[yypt-1 : yypt+1] //line php7/php7.y:3185 { yyVAL.node = yyDollar[1].node } + case 386: + yyDollar = yyS[yypt-1 : yypt+1] + //line php7/php7.y:3190 + { + yyVAL.node = yyDollar[1].node + } + case 387: + yyDollar = yyS[yypt-1 : yypt+1] + //line php7/php7.y:3192 + { + yyVAL.node = yyDollar[1].node + } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3190 + //line php7/php7.y:3197 { yyVAL.node = nil } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3192 + //line php7/php7.y:3199 { yyVAL.node = yyDollar[2].node } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3197 + //line php7/php7.y:3204 { yyVAL.list = []node.Node{} } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3199 + //line php7/php7.y:3206 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3201 + //line php7/php7.y:3208 { yyVAL.list = yyDollar[1].list } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3206 + //line php7/php7.y:3213 { yyVAL.nodesWithEndToken = nil } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3208 + //line php7/php7.y:3215 { yyVAL.nodesWithEndToken = yyDollar[1].nodesWithEndToken } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3213 + //line php7/php7.y:3220 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6053,13 +6059,13 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3225 + //line php7/php7.y:3232 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6067,12 +6073,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseSquareBracket) } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3236 + //line php7/php7.y:3243 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6080,11 +6086,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ConstantEncapsedStringToken) } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3249 + //line php7/php7.y:3256 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6092,11 +6098,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.LnumberToken) } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3259 + //line php7/php7.y:3266 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6104,11 +6110,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DnumberToken) } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3269 + //line php7/php7.y:3276 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6116,11 +6122,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.LineToken) } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3279 + //line php7/php7.y:3286 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6128,11 +6134,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FileToken) } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3289 + //line php7/php7.y:3296 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6140,11 +6146,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DirToken) } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3299 + //line php7/php7.y:3306 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6152,11 +6158,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TraitCToken) } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3309 + //line php7/php7.y:3316 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6164,11 +6170,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MethodCToken) } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3319 + //line php7/php7.y:3326 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6176,11 +6182,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FuncCToken) } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3329 + //line php7/php7.y:3336 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6188,11 +6194,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsCToken) } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3339 + //line php7/php7.y:3346 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6200,11 +6206,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassCToken) } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3349 + //line php7/php7.y:3356 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -6214,11 +6220,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3361 + //line php7/php7.y:3368 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -6226,11 +6232,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3371 + //line php7/php7.y:3378 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -6238,11 +6244,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoubleQuoteToken) } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3381 + //line php7/php7.y:3388 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -6250,23 +6256,23 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3391 + //line php7/php7.y:3398 { yyVAL.node = yyDollar[1].node } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3393 + //line php7/php7.y:3400 { yyVAL.node = yyDollar[1].node } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3398 + //line php7/php7.y:3405 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -6275,7 +6281,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3405 + //line php7/php7.y:3412 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6285,12 +6291,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(target, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yylex.(*Parser).comments.AddFromToken(target, yyDollar[3].token, comment.IdentifierToken) } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3418 + //line php7/php7.y:3425 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6300,92 +6306,92 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(target, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yylex.(*Parser).comments.AddFromToken(target, yyDollar[3].token, comment.IdentifierToken) } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3434 + //line php7/php7.y:3441 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3436 + //line php7/php7.y:3443 { yyVAL.node = yyDollar[1].node } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3441 + //line php7/php7.y:3448 { yyVAL.node = nil } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3443 + //line php7/php7.y:3450 { yyVAL.node = yyDollar[1].node } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3448 + //line php7/php7.y:3455 { yyVAL.node = yyDollar[1].node } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3453 + //line php7/php7.y:3460 { yyVAL.node = yyDollar[1].node } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3455 + //line php7/php7.y:3462 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3463 + //line php7/php7.y:3470 { yyVAL.node = yyDollar[1].node } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3468 + //line php7/php7.y:3475 { yyVAL.node = yyDollar[1].node } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3470 + //line php7/php7.y:3477 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3478 + //line php7/php7.y:3485 { yyVAL.node = yyDollar[1].node } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3483 + //line php7/php7.y:3490 { yyVAL.node = yyDollar[1].node } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3485 + //line php7/php7.y:3492 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6393,12 +6399,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3496 + //line php7/php7.y:3503 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6406,12 +6412,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3507 + //line php7/php7.y:3514 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6419,12 +6425,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3518 + //line php7/php7.y:3525 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) @@ -6432,29 +6438,29 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ObjectOperatorToken) } case 433: - yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3528 - { - yyVAL.node = yyDollar[1].node - } - case 434: - yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3533 - { - yyVAL.node = yyDollar[1].node - } - case 435: yyDollar = yyS[yypt-1 : yypt+1] //line php7/php7.y:3535 { yyVAL.node = yyDollar[1].node } + case 434: + yyDollar = yyS[yypt-1 : yypt+1] + //line php7/php7.y:3540 + { + yyVAL.node = yyDollar[1].node + } + case 435: + yyDollar = yyS[yypt-1 : yypt+1] + //line php7/php7.y:3542 + { + yyVAL.node = yyDollar[1].node + } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3537 + //line php7/php7.y:3544 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6462,11 +6468,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ObjectOperatorToken) } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3550 + //line php7/php7.y:3557 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6476,11 +6482,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3562 + //line php7/php7.y:3569 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -6488,13 +6494,13 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3574 + //line php7/php7.y:3581 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6502,11 +6508,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarToken) } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3587 + //line php7/php7.y:3594 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6514,11 +6520,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3597 + //line php7/php7.y:3604 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6526,17 +6532,17 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3610 + //line php7/php7.y:3617 { yyVAL.node = yyDollar[1].node } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3612 + //line php7/php7.y:3619 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6544,12 +6550,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3623 + //line php7/php7.y:3630 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6557,12 +6563,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3634 + //line php7/php7.y:3641 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6570,11 +6576,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ObjectOperatorToken) } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3644 + //line php7/php7.y:3651 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6582,11 +6588,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3654 + //line php7/php7.y:3661 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6594,11 +6600,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3667 + //line php7/php7.y:3674 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6606,27 +6612,27 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IdentifierToken) } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3677 + //line php7/php7.y:3684 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3685 + //line php7/php7.y:3692 { yyVAL.node = yyDollar[1].node } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3690 + //line php7/php7.y:3697 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6634,27 +6640,27 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringToken) } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3700 + //line php7/php7.y:3707 { yyVAL.node = yyDollar[2].node // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3708 + //line php7/php7.y:3715 { yyVAL.node = yyDollar[1].node } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3713 + //line php7/php7.y:3720 { if yyDollar[1].list[len(yyDollar[1].list)-1] == nil { yyVAL.list = yyDollar[1].list[:len(yyDollar[1].list)-1] @@ -6664,34 +6670,34 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3724 + //line php7/php7.y:3731 { yyVAL.node = nil } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3726 + //line php7/php7.y:3733 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3731 + //line php7/php7.y:3738 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3738 + //line php7/php7.y:3745 { yyVAL.list = []node.Node{yyDollar[1].node} } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3743 + //line php7/php7.y:3750 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) @@ -6699,11 +6705,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DoubleArrowToken) } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3753 + //line php7/php7.y:3760 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) @@ -6712,7 +6718,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3760 + //line php7/php7.y:3767 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) @@ -6720,12 +6726,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DoubleArrowToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AmpersandToken) } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3771 + //line php7/php7.y:3778 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[2].node, true) @@ -6733,11 +6739,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AmpersandToken) } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3781 + //line php7/php7.y:3788 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -6748,14 +6754,14 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[6].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(list, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(list, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(list, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DoubleArrowToken) + yylex.(*Parser).comments.AddFromToken(list, yyDollar[3].token, comment.ListToken) + yylex.(*Parser).comments.AddFromToken(list, yyDollar[4].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(list, yyDollar[6].token, comment.CloseParenthesisToken) } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3797 + //line php7/php7.y:3804 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -6766,19 +6772,19 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(list, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(list, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(list, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(list, yyDollar[1].token, comment.ListToken) + yylex.(*Parser).comments.AddFromToken(list, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(list, yyDollar[4].token, comment.CloseParenthesisToken) } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3815 + //line php7/php7.y:3822 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3817 + //line php7/php7.y:3824 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -6787,17 +6793,17 @@ yydefault: yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddComments(encapsed, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(encapsed, yyDollar[2].token, comment.EncapsedAndWhitespaceToken) } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3828 + //line php7/php7.y:3835 { yyVAL.list = []node.Node{yyDollar[1].node} } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3830 + //line php7/php7.y:3837 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -6806,11 +6812,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(encapsed, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(encapsed, yyDollar[1].token, comment.EncapsedAndWhitespaceToken) } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3844 + //line php7/php7.y:3851 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6820,11 +6826,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3856 + //line php7/php7.y:3863 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6836,13 +6842,13 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3872 + //line php7/php7.y:3879 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6856,13 +6862,13 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(fetch, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ObjectOperatorToken) + yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[3].token, comment.StringToken) } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3890 + //line php7/php7.y:3897 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6870,12 +6876,12 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3901 + //line php7/php7.y:3908 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -6885,13 +6891,13 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(name, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringVarnameToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3915 + //line php7/php7.y:3922 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -6903,21 +6909,21 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(variable, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[6].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[2].token, comment.StringVarnameToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CloseSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseCurlyBracesToken) } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3933 + //line php7/php7.y:3940 { yyVAL.node = yyDollar[2].node } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3939 + //line php7/php7.y:3946 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6925,11 +6931,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringToken) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3949 + //line php7/php7.y:3956 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -6942,11 +6948,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NumStringToken) } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3964 + //line php7/php7.y:3971 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -6968,16 +6974,16 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MinusToken) if isInt { - yylex.(*Parser).comments.AddComments(lnumber, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lnumber, yyDollar[2].token, comment.NumStringToken) } else { - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NumStringToken) } } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3993 + //line php7/php7.y:4000 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(identifier) @@ -6987,11 +6993,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:4008 + //line php7/php7.y:4015 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -6999,16 +7005,16 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IssetToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) if yyDollar[4].token != nil { - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CommaToken) } - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[5].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CloseParenthesisToken) } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4023 + //line php7/php7.y:4030 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -7016,13 +7022,13 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EmptyToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4035 + //line php7/php7.y:4042 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -7030,11 +7036,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncludeToken) } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4045 + //line php7/php7.y:4052 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -7042,11 +7048,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncludeOnceToken) } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4055 + //line php7/php7.y:4062 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -7054,13 +7060,13 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EvalToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4067 + //line php7/php7.y:4074 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -7068,11 +7074,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.RequireToken) } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4077 + //line php7/php7.y:4084 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -7080,26 +7086,26 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.RequireOnceToken) } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4090 + //line php7/php7.y:4097 { yyVAL.list = []node.Node{yyDollar[1].node} } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4092 + //line php7/php7.y:4099 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) // save comments - yylex.(*Parser).comments.AddComments(lastNode(yyDollar[1].list), yyDollar[2].token.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4102 + //line php7/php7.y:4109 { yyVAL.node = yyDollar[1].node } diff --git a/php7/php7.y b/php7/php7.y index bb72887..60ee744 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -5,6 +5,7 @@ import ( "strings" "strconv" + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/scanner" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/scalar" @@ -193,6 +194,7 @@ import ( %token '%' %token '<' %token '>' +%token '.' %left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE %left ',' @@ -340,7 +342,7 @@ namespace_name: yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments(namePart, $1.Comments()) + yylex.(*Parser).comments.AddFromToken(namePart, $1, comment.StringToken) } | namespace_name T_NS_SEPARATOR T_STRING { @@ -351,8 +353,8 @@ namespace_name: yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) - yylex.(*Parser).comments.AddComments(namePart, $3.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken(namePart, $3, comment.StringToken) } ; @@ -372,8 +374,8 @@ name: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.NsSeparatorToken) } | T_NS_SEPARATOR namespace_name { @@ -383,7 +385,7 @@ name: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) } ; @@ -411,10 +413,10 @@ top_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.HaltCompilerToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } | T_NAMESPACE namespace_name ';' { @@ -426,8 +428,8 @@ top_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_NAMESPACE namespace_name '{' top_statement_list '}' { @@ -439,9 +441,9 @@ top_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, $5.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.CloseCurlyBracesToken) } | T_NAMESPACE '{' top_statement_list '}' { @@ -451,9 +453,9 @@ top_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) } | T_USE mixed_group_use_declaration ';' { @@ -463,8 +465,8 @@ top_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_USE use_type group_use_declaration ';' { @@ -474,8 +476,8 @@ top_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } | T_USE use_declarations ';' { @@ -485,8 +487,8 @@ top_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_USE use_type use_declarations ';' { @@ -496,8 +498,8 @@ top_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } | T_CONST const_list ';' { @@ -507,8 +509,8 @@ top_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } ; @@ -521,7 +523,7 @@ use_type: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.FunctionToken) } | T_CONST { @@ -531,7 +533,7 @@ use_type: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstToken) } ; @@ -546,12 +548,12 @@ group_use_declaration: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.OpenCurlyBracesToken) if $5 != nil { - yylex.(*Parser).comments.AddComments($$, $5.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.CommaToken) } - yylex.(*Parser).comments.AddComments($$, $6.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseCurlyBracesToken) } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { @@ -563,13 +565,13 @@ group_use_declaration: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.OpenCurlyBracesToken) if $6 != nil { - yylex.(*Parser).comments.AddComments($$, $6.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.CommaToken) } - yylex.(*Parser).comments.AddComments($$, $7.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseCurlyBracesToken) } ; @@ -584,12 +586,12 @@ mixed_group_use_declaration: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.OpenCurlyBracesToken) if $5 != nil { - yylex.(*Parser).comments.AddComments($$, $5.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.CommaToken) } - yylex.(*Parser).comments.AddComments($$, $6.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseCurlyBracesToken) } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { @@ -601,13 +603,13 @@ mixed_group_use_declaration: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.OpenCurlyBracesToken) if $6 != nil { - yylex.(*Parser).comments.AddComments($$, $6.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.CommaToken) } - yylex.(*Parser).comments.AddComments($$, $7.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseCurlyBracesToken) } ; @@ -624,7 +626,7 @@ inline_use_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } | inline_use_declaration { $$ = []node.Node{$1} } @@ -636,7 +638,7 @@ unprefixed_use_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } | unprefixed_use_declaration { $$ = []node.Node{$1} } @@ -648,7 +650,7 @@ use_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } | use_declaration { $$ = []node.Node{$1} } @@ -683,8 +685,8 @@ unprefixed_use_declaration: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments(alias, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(alias, $3, comment.StringToken) } ; @@ -696,7 +698,7 @@ use_declaration: $$ = $2; // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) } ; @@ -706,7 +708,7 @@ const_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } | const_decl { $$ = []node.Node{$1} } @@ -747,10 +749,10 @@ inner_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.HaltCompilerToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } statement: @@ -762,8 +764,8 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) } | if_stmt { $$ = $1; } @@ -781,9 +783,9 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5.node)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.WhileToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) } | T_DO statement T_WHILE '(' expr ')' ';' { @@ -793,11 +795,11 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, $6.Comments()) - yylex.(*Parser).comments.AddComments($$, $7.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.WhileToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $7, comment.SemiColonToken) } | T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement { @@ -811,11 +813,11 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9.node)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, $6.Comments()) - yylex.(*Parser).comments.AddComments($$, $8.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseParenthesisToken) } | T_SWITCH '(' expr ')' switch_case_list { @@ -829,9 +831,9 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5.endToken)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.SwitchToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) } | T_BREAK optional_expr ';' { @@ -841,8 +843,8 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.BreakToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_CONTINUE optional_expr ';' { @@ -852,8 +854,8 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ContinueToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_RETURN optional_expr ';' { @@ -863,8 +865,8 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ReturnToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_GLOBAL global_var_list ';' { @@ -874,8 +876,8 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.GlobalToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_STATIC static_var_list ';' { @@ -885,8 +887,8 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_ECHO echo_expr_list ';' { @@ -896,8 +898,8 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.EchoToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_INLINE_HTML { @@ -907,7 +909,7 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.InlineHTMLToken) } | expr ';' { @@ -917,7 +919,7 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) } | T_UNSET '(' unset_variables possible_comma ')' ';' { @@ -927,13 +929,13 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.UnsetToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) if $4 != nil { - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CommaToken) } - yylex.(*Parser).comments.AddComments($$, $5.Comments()) - yylex.(*Parser).comments.AddComments($$, $6.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.SemiColonToken) } | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement { @@ -947,10 +949,10 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7.node)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, $6.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForeachToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.AsToken) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseParenthesisToken) } | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement { @@ -964,11 +966,11 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9.node)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, $6.Comments()) - yylex.(*Parser).comments.AddComments($$, $8.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForeachToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.AsToken) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.DoubleArrowToken) + yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseParenthesisToken) } | T_DECLARE '(' const_list ')' declare_statement { @@ -978,9 +980,9 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DeclareToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) } | ';' { @@ -990,7 +992,7 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) } | T_TRY '{' inner_statement_list '}' catch_list finally_statement { @@ -1003,9 +1005,9 @@ statement: } // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.TryToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) } | T_THROW expr ';' { @@ -1015,8 +1017,8 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ThrowToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_GOTO T_STRING ';' { @@ -1028,9 +1030,9 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments(label, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.GotoToken) + yylex.(*Parser).comments.AddFromToken(label, $2, comment.StringToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_STRING ':' { @@ -1042,8 +1044,8 @@ statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments(label, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken(label, $1, comment.StringToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.ColonToken) } catch_list: @@ -1062,12 +1064,12 @@ catch_list: yylex.(*Parser).positions.AddPosition(catch, yylex.(*Parser).positionBuilder.NewTokensPosition($2, $9)) // save comments - yylex.(*Parser).comments.AddComments(catch, $2.Comments()) - yylex.(*Parser).comments.AddComments(catch, $3.Comments()) - yylex.(*Parser).comments.AddComments(variable, $5.Comments()) - yylex.(*Parser).comments.AddComments(catch, $6.Comments()) - yylex.(*Parser).comments.AddComments(catch, $7.Comments()) - yylex.(*Parser).comments.AddComments(catch, $9.Comments()) + yylex.(*Parser).comments.AddFromToken(catch, $2, comment.CatchToken) + yylex.(*Parser).comments.AddFromToken(catch, $3, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(variable, $5, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(catch, $6, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(catch, $7, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(catch, $9, comment.CloseCurlyBracesToken) } ; catch_name_list: @@ -1078,7 +1080,7 @@ catch_name_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.VerticalBarToken) } ; @@ -1093,9 +1095,9 @@ finally_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.FinallyToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) } ; @@ -1107,7 +1109,7 @@ unset_variables: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } ; @@ -1127,15 +1129,15 @@ function_declaration_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.FunctionToken) if $2.token != nil { - yylex.(*Parser).comments.AddComments($$, $2.token.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2.token, comment.AmpersandToken) } - yylex.(*Parser).comments.AddComments(name, $3.Comments()) - yylex.(*Parser).comments.AddComments(name, $5.Comments()) - yylex.(*Parser).comments.AddComments(name, $7.Comments()) - yylex.(*Parser).comments.AddComments(name, $9.Comments()) - yylex.(*Parser).comments.AddComments(name, $11.Comments()) + yylex.(*Parser).comments.AddFromToken(name, $3, comment.StringToken) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $9, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $11, comment.CloseCurlyBracesToken) } ; @@ -1164,16 +1166,16 @@ class_declaration_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $9)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments(name, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.ClassToken) + yylex.(*Parser).comments.AddFromToken(name, $3, comment.StringToken) if $4 != nil { - yylex.(*Parser).setCommentsFromChildNode($$, $4) + yylex.(*Parser).comments.AddFromChildNode($$, $4) } if $5 != nil { - yylex.(*Parser).setCommentsFromChildNode($$, firstNode($5)) + yylex.(*Parser).comments.AddFromChildNode($$, firstNode($5)) } - yylex.(*Parser).comments.AddComments($$, $7.Comments()) - yylex.(*Parser).comments.AddComments($$, $9.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $7, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $9, comment.CloseCurlyBracesToken) } | T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' { @@ -1185,16 +1187,16 @@ class_declaration_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments(name, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassToken) + yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringToken) if $3 != nil { - yylex.(*Parser).setCommentsFromChildNode($$, $3) + yylex.(*Parser).comments.AddFromChildNode($$, $3) } if $4 != nil { - yylex.(*Parser).setCommentsFromChildNode($$, firstNode($4)) + yylex.(*Parser).comments.AddFromChildNode($$, firstNode($4)) } - yylex.(*Parser).comments.AddComments($$, $6.Comments()) - yylex.(*Parser).comments.AddComments($$, $8.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseCurlyBracesToken) } ; @@ -1214,7 +1216,7 @@ class_modifier: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.AbstractToken) } | T_FINAL { @@ -1224,7 +1226,7 @@ class_modifier: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.FinalToken) } ; @@ -1239,10 +1241,10 @@ trait_declaration_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments(name, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, $6.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.TraitToken) + yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseCurlyBracesToken) } ; @@ -1257,13 +1259,13 @@ interface_declaration_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments(name, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.InterfaceToken) + yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringToken) if $3 != nil { - yylex.(*Parser).setCommentsFromChildNode($$, firstNode($3)) + yylex.(*Parser).comments.AddFromChildNode($$, firstNode($3)) } - yylex.(*Parser).comments.AddComments($$, $5.Comments()) - yylex.(*Parser).comments.AddComments($$, $7.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseCurlyBracesToken) } ; @@ -1275,7 +1277,7 @@ extends_from: $$ = $2; // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExtendsToken) } ; @@ -1287,7 +1289,7 @@ interface_extends_list: $$ = $2; // save comments - yylex.(*Parser).comments.AddComments(firstNode($$), $1.Comments()) + yylex.(*Parser).comments.AddFromToken(firstNode($$), $1, comment.ExtendsToken) } ; @@ -1299,7 +1301,7 @@ implements_list: $$ = $2; // save comments - yylex.(*Parser).comments.AddComments(firstNode($$), $1.Comments()) + yylex.(*Parser).comments.AddFromToken(firstNode($$), $1, comment.ImplementsToken) } ; @@ -1314,7 +1316,7 @@ foreach_variable: yylex.(*Parser).positions.AddPosition($2, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($2, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($2, $1, comment.AmpersandToken) } | T_LIST '(' array_pair_list ')' { @@ -1325,9 +1327,9 @@ foreach_variable: yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments(list, $1.Comments()) - yylex.(*Parser).comments.AddComments(list, $2.Comments()) - yylex.(*Parser).comments.AddComments(list, $4.Comments()) + yylex.(*Parser).comments.AddFromToken(list, $1, comment.ListToken) + yylex.(*Parser).comments.AddFromToken(list, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(list, $4, comment.CloseParenthesisToken) } | '[' array_pair_list ']' { @@ -1338,8 +1340,8 @@ foreach_variable: yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments(list, $1.Comments()) - yylex.(*Parser).comments.AddComments(list, $3.Comments()) + yylex.(*Parser).comments.AddFromToken(list, $1, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(list, $3, comment.CloseSquareBracket) } ; @@ -1354,9 +1356,9 @@ for_statement: yylex.(*Parser).positions.AddPosition($$.node, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$.node, $1.Comments()) - yylex.(*Parser).comments.AddComments($$.node, $3.Comments()) - yylex.(*Parser).comments.AddComments($$.node, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$.node, $1, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken($$.node, $3, comment.EndforToken) + yylex.(*Parser).comments.AddFromToken($$.node, $4, comment.SemiColonToken) } ; @@ -1371,9 +1373,9 @@ foreach_statement: yylex.(*Parser).positions.AddPosition($$.node, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$.node, $1.Comments()) - yylex.(*Parser).comments.AddComments($$.node, $3.Comments()) - yylex.(*Parser).comments.AddComments($$.node, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$.node, $1, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken($$.node, $3, comment.EndforeachToken) + yylex.(*Parser).comments.AddFromToken($$.node, $4, comment.SemiColonToken) } ; @@ -1388,9 +1390,9 @@ declare_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.EnddeclareToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } ; @@ -1413,8 +1415,8 @@ case_list: yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) // save comments - yylex.(*Parser).comments.AddComments(_case, $2.Comments()) - yylex.(*Parser).comments.AddComments(_case, $4.Comments()) + yylex.(*Parser).comments.AddFromToken(_case, $2, comment.CaseToken) + yylex.(*Parser).comments.AddFromToken(_case, $4, comment.CaseSeparatorToken) } | case_list T_DEFAULT case_separator inner_statement_list { @@ -1425,8 +1427,8 @@ case_list: yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) // save comments - yylex.(*Parser).comments.AddComments(_default, $2.Comments()) - yylex.(*Parser).comments.AddComments(_default, $3.Comments()) + yylex.(*Parser).comments.AddFromToken(_default, $2, comment.DefaultToken) + yylex.(*Parser).comments.AddFromToken(_default, $3, comment.CaseSeparatorToken) } ; @@ -1448,9 +1450,9 @@ while_statement: yylex.(*Parser).positions.AddPosition($$.node, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$.node, $1.Comments()) - yylex.(*Parser).comments.AddComments($$.node, $3.Comments()) - yylex.(*Parser).comments.AddComments($$.node, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$.node, $1, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken($$.node, $3, comment.EndwhileToken) + yylex.(*Parser).comments.AddFromToken($$.node, $4, comment.SemiColonToken) } ; @@ -1463,9 +1465,9 @@ if_stmt_without_else: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.IfToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) } | if_stmt_without_else T_ELSEIF '(' expr ')' statement { @@ -1477,9 +1479,9 @@ if_stmt_without_else: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddComments(_elseIf, $2.Comments()) - yylex.(*Parser).comments.AddComments(_elseIf, $3.Comments()) - yylex.(*Parser).comments.AddComments(_elseIf, $5.Comments()) + yylex.(*Parser).comments.AddFromToken(_elseIf, $2, comment.ElseifToken) + yylex.(*Parser).comments.AddFromToken(_elseIf, $3, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(_elseIf, $5, comment.CloseParenthesisToken) } ; @@ -1496,7 +1498,7 @@ if_stmt: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.ElseToken) } ; @@ -1511,10 +1513,10 @@ alt_if_stmt_without_else: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, $5.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.IfToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.ColonToken) } | alt_if_stmt_without_else T_ELSEIF '(' expr ')' ':' inner_statement_list { @@ -1527,10 +1529,10 @@ alt_if_stmt_without_else: yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $7)) // save comments - yylex.(*Parser).comments.AddComments(_elseIf, $2.Comments()) - yylex.(*Parser).comments.AddComments(_elseIf, $3.Comments()) - yylex.(*Parser).comments.AddComments(_elseIf, $5.Comments()) - yylex.(*Parser).comments.AddComments(_elseIf, $6.Comments()) + yylex.(*Parser).comments.AddFromToken(_elseIf, $2, comment.ElseifToken) + yylex.(*Parser).comments.AddFromToken(_elseIf, $3, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(_elseIf, $5, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(_elseIf, $6, comment.ColonToken) } ; @@ -1543,8 +1545,8 @@ alt_if_stmt: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.EndifToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';' { @@ -1558,10 +1560,10 @@ alt_if_stmt: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddComments(_else, $2.Comments()) - yylex.(*Parser).comments.AddComments(_else, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, $5.Comments()) - yylex.(*Parser).comments.AddComments($$, $6.Comments()) + yylex.(*Parser).comments.AddFromToken(_else, $2, comment.ElseToken) + yylex.(*Parser).comments.AddFromToken(_else, $3, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.EndifToken) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.SemiColonToken) } ; @@ -1580,7 +1582,7 @@ non_empty_parameter_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } ; @@ -1615,12 +1617,12 @@ parameter: // save comments if $2.value { - yylex.(*Parser).comments.AddComments($$, $2.token.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2.token, comment.AmpersandToken) } if $3.value { - yylex.(*Parser).comments.AddComments($$, $3.token.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $3.token, comment.EllipsisToken) } - yylex.(*Parser).comments.AddComments(variable, $4.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, $4, comment.VariableToken) } | optional_type is_reference is_variadic T_VARIABLE '=' expr { @@ -1651,13 +1653,13 @@ parameter: // save comments if $2.value { - yylex.(*Parser).comments.AddComments($$, $2.token.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2.token, comment.AmpersandToken) } if $3.value { - yylex.(*Parser).comments.AddComments($$, $3.token.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $3.token, comment.EllipsisToken) } - yylex.(*Parser).comments.AddComments(variable, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, $5.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, $4, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.EqualToken) } ; @@ -1679,7 +1681,7 @@ type_expr: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.QuestionMarkToken) } ; @@ -1692,7 +1694,7 @@ type: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayToken) } | T_CALLABLE { @@ -1702,7 +1704,7 @@ type: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.CallableToken) } | name { $$ = $1; } @@ -1716,7 +1718,7 @@ return_type: $$ = $2; // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) } ; @@ -1735,7 +1737,7 @@ non_empty_argument_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } ; @@ -1755,7 +1757,7 @@ argument: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.EllipsisToken) } ; @@ -1765,7 +1767,7 @@ global_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } | global_var { $$ = []node.Node{$1} } @@ -1782,7 +1784,7 @@ static_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } | static_var { $$ = []node.Node{$1} } @@ -1801,7 +1803,7 @@ static_var: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) } | T_VARIABLE '=' expr { @@ -1815,8 +1817,8 @@ static_var: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) } ; @@ -1836,7 +1838,7 @@ class_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | method_modifiers T_CONST class_const_list ';' { @@ -1846,8 +1848,8 @@ class_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.ConstToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } | T_USE name_list trait_adaptations { @@ -1857,7 +1859,7 @@ class_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3.endToken)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) } | method_modifiers T_FUNCTION returns_ref identifier backup_doc_comment '(' parameter_list ')' return_type method_body { @@ -1869,13 +1871,13 @@ class_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $10.endToken)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.FunctionToken) if $3.value { - yylex.(*Parser).comments.AddComments($$, $3.token.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $3.token, comment.AmpersandToken) } - yylex.(*Parser).comments.AddComments(name, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, $6.Comments()) - yylex.(*Parser).comments.AddComments($$, $8.Comments()) + yylex.(*Parser).comments.AddFromToken(name, $4, comment.IdentifierToken) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseParenthesisToken) } ; @@ -1887,7 +1889,7 @@ name_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } ; @@ -1913,14 +1915,14 @@ trait_adaptation: $$ = $1; // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) } | trait_alias ';' { $$ = $1; // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) } ; @@ -1933,7 +1935,7 @@ trait_precedence: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.InsteadofToken) } ; @@ -1948,8 +1950,8 @@ trait_alias: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments(alias, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(alias, $3, comment.StringToken) } | trait_method_reference T_AS reserved_non_modifiers { @@ -1961,8 +1963,8 @@ trait_alias: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments(alias, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(alias, $3, comment.StringToken) } | trait_method_reference T_AS member_modifier identifier { @@ -1974,8 +1976,8 @@ trait_alias: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments(alias, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(alias, $4, comment.IdentifierToken) } | trait_method_reference T_AS member_modifier { @@ -1985,7 +1987,7 @@ trait_alias: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) } ; @@ -2000,7 +2002,7 @@ trait_method_reference: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments(name, $1.Comments()) + yylex.(*Parser).comments.AddFromToken(name, $1, comment.IdentifierToken) } | absolute_trait_method_reference { $$ = $1; } @@ -2017,8 +2019,8 @@ absolute_trait_method_reference: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments(target, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + yylex.(*Parser).comments.AddFromToken(target, $3, comment.IdentifierToken) } ; @@ -2039,7 +2041,7 @@ variable_modifiers: yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments(modifier, $1.Comments()) + yylex.(*Parser).comments.AddFromToken(modifier, $1, comment.VarToken) } ; @@ -2066,7 +2068,7 @@ member_modifier: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.PublicToken) } | T_PROTECTED { @@ -2076,7 +2078,7 @@ member_modifier: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ProtectedToken) } | T_PRIVATE { @@ -2086,7 +2088,7 @@ member_modifier: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.PrivateToken) } | T_STATIC { @@ -2096,7 +2098,7 @@ member_modifier: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) } | T_ABSTRACT { @@ -2106,7 +2108,7 @@ member_modifier: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.AbstractToken) } | T_FINAL { @@ -2116,7 +2118,7 @@ member_modifier: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.FinalToken) } ; @@ -2126,7 +2128,7 @@ property_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } | property { $$ = []node.Node{$1} } @@ -2145,7 +2147,7 @@ property: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) } | T_VARIABLE '=' expr backup_doc_comment { @@ -2159,8 +2161,8 @@ property: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) } ; @@ -2170,7 +2172,7 @@ class_const_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } | class_const_decl { $$ = []node.Node{$1} } @@ -2187,8 +2189,8 @@ class_const_decl: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments(name, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken(name, $1, comment.IdentifierToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) } ; @@ -2203,8 +2205,8 @@ const_decl: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments(name, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken(name, $1, comment.StringToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) } ; @@ -2214,7 +2216,7 @@ echo_expr_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } | echo_expr { $$ = []node.Node{$1} } @@ -2238,7 +2240,7 @@ non_empty_for_exprs: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } | expr { $$ = []node.Node{$1} } @@ -2257,15 +2259,15 @@ anonymous_class: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassToken) if $3 != nil { - yylex.(*Parser).setCommentsFromChildNode($$, $3) + yylex.(*Parser).comments.AddFromChildNode($$, $3) } if $4 != nil { - yylex.(*Parser).setCommentsFromChildNode($$, firstNode($4)) + yylex.(*Parser).comments.AddFromChildNode($$, firstNode($4)) } - yylex.(*Parser).comments.AddComments($$, $6.Comments()) - yylex.(*Parser).comments.AddComments($$, $8.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseCurlyBracesToken) } ; @@ -2281,7 +2283,7 @@ new_expr: } // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NewToken) } | T_NEW anonymous_class { @@ -2291,7 +2293,7 @@ new_expr: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NewToken) } ; @@ -2306,10 +2308,10 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) // save comments - yylex.(*Parser).comments.AddComments(list, $1.Comments()) - yylex.(*Parser).comments.AddComments(list, $2.Comments()) - yylex.(*Parser).comments.AddComments(list, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, $5.Comments()) + yylex.(*Parser).comments.AddFromToken(list, $1, comment.ListToken) + yylex.(*Parser).comments.AddFromToken(list, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(list, $4, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.EqualToken) } | '[' array_pair_list ']' '=' expr { @@ -2321,9 +2323,9 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments - yylex.(*Parser).comments.AddComments(shortList, $1.Comments()) - yylex.(*Parser).comments.AddComments(shortList, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken(shortList, $1, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(shortList, $3, comment.CloseSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.EqualToken) } | variable '=' expr { @@ -2333,7 +2335,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) } | variable '=' '&' expr { @@ -2343,8 +2345,8 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.AmpersandToken) } | T_CLONE expr { @@ -2354,7 +2356,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.CloneToken) } | variable T_PLUS_EQUAL expr { @@ -2364,7 +2366,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PlusEqualToken) } | variable T_MINUS_EQUAL expr { @@ -2374,7 +2376,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.MinusEqualToken) } | variable T_MUL_EQUAL expr { @@ -2384,7 +2386,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.MulEqualToken) } | variable T_POW_EQUAL expr { @@ -2394,7 +2396,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PowEqualToken) } | variable T_DIV_EQUAL expr { @@ -2404,7 +2406,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.DivEqualToken) } | variable T_CONCAT_EQUAL expr { @@ -2414,7 +2416,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.ConcatEqualToken) } | variable T_MOD_EQUAL expr { @@ -2424,7 +2426,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.ModEqualToken) } | variable T_AND_EQUAL expr { @@ -2434,7 +2436,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AndEqualToken) } | variable T_OR_EQUAL expr { @@ -2444,7 +2446,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OrEqualToken) } | variable T_XOR_EQUAL expr { @@ -2454,7 +2456,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.XorEqualToken) } | variable T_SL_EQUAL expr { @@ -2464,7 +2466,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlEqualToken) } | variable T_SR_EQUAL expr { @@ -2474,7 +2476,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SrEqualToken) } | variable T_INC { @@ -2484,7 +2486,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IncToken) } | T_INC variable { @@ -2494,7 +2496,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncToken) } | variable T_DEC { @@ -2504,7 +2506,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.DecToken) } | T_DEC variable { @@ -2514,7 +2516,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DecToken) } | expr T_BOOLEAN_OR expr { @@ -2524,7 +2526,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanOrToken) } | expr T_BOOLEAN_AND expr { @@ -2534,7 +2536,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanAndToken) } | expr T_LOGICAL_OR expr { @@ -2544,7 +2546,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalOrToken) } | expr T_LOGICAL_AND expr { @@ -2554,7 +2556,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalAndToken) } | expr T_LOGICAL_XOR expr { @@ -2564,7 +2566,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalXorToken) } | expr '|' expr { @@ -2574,7 +2576,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.VerticalBarToken) } | expr '&' expr { @@ -2584,7 +2586,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) } | expr '^' expr { @@ -2594,12 +2596,17 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.CaretToken) } | expr '.' expr { $$ = binary.NewConcat($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.DotToken) } | expr '+' expr { @@ -2609,7 +2616,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PlusToken) } | expr '-' expr { @@ -2619,7 +2626,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.MinusToken) } | expr '*' expr { @@ -2629,7 +2636,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsteriskToken) } | expr T_POW expr { @@ -2639,7 +2646,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PowToken) } | expr '/' expr { @@ -2649,7 +2656,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlashToken) } | expr '%' expr { @@ -2659,7 +2666,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PercentToken) } | expr T_SL expr { @@ -2669,7 +2676,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlToken) } | expr T_SR expr { @@ -2679,7 +2686,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SrToken) } | '+' expr %prec T_INC { @@ -2689,7 +2696,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.PlusToken) } | '-' expr %prec T_INC { @@ -2699,7 +2706,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.MinusToken) } | '!' expr { @@ -2709,7 +2716,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExclamationMarkToken) } | '~' expr { @@ -2719,7 +2726,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.TildeToken) } | expr T_IS_IDENTICAL expr { @@ -2729,7 +2736,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsIdenticalToken) } | expr T_IS_NOT_IDENTICAL expr { @@ -2739,7 +2746,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotIdenticalToken) } | expr T_IS_EQUAL expr { @@ -2749,7 +2756,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsEqualToken) } | expr T_IS_NOT_EQUAL expr { @@ -2759,7 +2766,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotEqualToken) } | expr '<' expr { @@ -2769,7 +2776,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.LessToken) } | expr T_IS_SMALLER_OR_EQUAL expr { @@ -2779,7 +2786,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsSmallerOrEqualToken) } | expr '>' expr { @@ -2789,7 +2796,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.GreaterToken) } | expr T_IS_GREATER_OR_EQUAL expr { @@ -2799,7 +2806,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsGreaterOrEqualToken) } | expr T_SPACESHIP expr { @@ -2809,7 +2816,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SpaceshipToken) } | expr T_INSTANCEOF class_name_reference { @@ -2819,15 +2826,15 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.InstanceofToken) } | '(' expr ')' { $$ = $2; // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) } | new_expr { $$ = $1; } @@ -2839,8 +2846,8 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.ColonToken) } | expr '?' ':' expr { @@ -2850,8 +2857,8 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.ColonToken) } | expr T_COALESCE expr { @@ -2861,7 +2868,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.CoalesceToken) } | internal_functions_in_yacc { $$ = $1} @@ -2873,7 +2880,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.IntCastToken) } | T_DOUBLE_CAST expr { @@ -2883,7 +2890,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoubleCastToken) } | T_STRING_CAST expr { @@ -2893,7 +2900,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringCastToken) } | T_ARRAY_CAST expr { @@ -2903,7 +2910,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayCastToken) } | T_OBJECT_CAST expr { @@ -2913,7 +2920,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ObjectCastToken) } | T_BOOL_CAST expr { @@ -2923,7 +2930,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.BoolCastToken) } | T_UNSET_CAST expr { @@ -2933,7 +2940,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.UnsetCastToken) } | T_EXIT exit_expr { @@ -2947,7 +2954,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExitToken) } | '@' expr { @@ -2957,7 +2964,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.AtToken) } | scalar { $$ = $1; } @@ -2969,8 +2976,8 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.BackquoteToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.BackquoteToken) } | T_PRINT expr { @@ -2980,7 +2987,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.PrintToken) } | T_YIELD { @@ -2990,7 +2997,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) } | T_YIELD expr { @@ -3000,7 +3007,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) } | T_YIELD expr T_DOUBLE_ARROW expr { @@ -3010,8 +3017,8 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.DoubleArrowToken) } | T_YIELD_FROM expr { @@ -3021,7 +3028,7 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldFromToken) } | T_FUNCTION returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars return_type '{' inner_statement_list '}' { @@ -3031,14 +3038,14 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.FunctionToken) if $2.value { - yylex.(*Parser).comments.AddComments($$, $2.token.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2.token, comment.AmpersandToken) } - yylex.(*Parser).comments.AddComments($$, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, $6.Comments()) - yylex.(*Parser).comments.AddComments($$, $9.Comments()) - yylex.(*Parser).comments.AddComments($$, $11.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $9, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $11, comment.CloseCurlyBracesToken) } | T_STATIC T_FUNCTION returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars return_type '{' inner_statement_list '}' { @@ -3048,15 +3055,15 @@ expr_without_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $12)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.FunctionToken) if $3.value { - yylex.(*Parser).comments.AddComments($$, $3.token.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $3.token, comment.AmpersandToken) } - yylex.(*Parser).comments.AddComments($$, $5.Comments()) - yylex.(*Parser).comments.AddComments($$, $7.Comments()) - yylex.(*Parser).comments.AddComments($$, $10.Comments()) - yylex.(*Parser).comments.AddComments($$, $12.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $10, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $12, comment.CloseCurlyBracesToken) } ; @@ -3088,7 +3095,7 @@ lexical_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } | lexical_var { $$ = []node.Node{$1} } @@ -3107,7 +3114,7 @@ lexical_var: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) } | '&' T_VARIABLE { @@ -3121,8 +3128,8 @@ lexical_var: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments(variable, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.AmpersandToken) + yylex.(*Parser).comments.AddFromToken(variable, $2, comment.VariableToken) } ; @@ -3142,7 +3149,7 @@ function_call: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list { @@ -3152,7 +3159,7 @@ function_call: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } | callable_expr argument_list { @@ -3172,7 +3179,7 @@ class_name: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) } | name { $$ = $1; } @@ -3217,9 +3224,9 @@ dereferencable_scalar: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) } | '[' array_pair_list ']' { @@ -3229,8 +3236,8 @@ dereferencable_scalar: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseSquareBracket) } | T_CONSTANT_ENCAPSED_STRING { @@ -3240,7 +3247,7 @@ dereferencable_scalar: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstantEncapsedStringToken) } ; @@ -3253,7 +3260,7 @@ scalar: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.LnumberToken) } | T_DNUMBER { @@ -3263,7 +3270,7 @@ scalar: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DnumberToken) } | T_LINE { @@ -3273,7 +3280,7 @@ scalar: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.LineToken) } | T_FILE { @@ -3283,7 +3290,7 @@ scalar: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.FileToken) } | T_DIR { @@ -3293,7 +3300,7 @@ scalar: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DirToken) } | T_TRAIT_C { @@ -3303,7 +3310,7 @@ scalar: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.TraitCToken) } | T_METHOD_C { @@ -3313,7 +3320,7 @@ scalar: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.MethodCToken) } | T_FUNC_C { @@ -3323,7 +3330,7 @@ scalar: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.FuncCToken) } | T_NS_C { @@ -3333,7 +3340,7 @@ scalar: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsCToken) } | T_CLASS_C { @@ -3343,7 +3350,7 @@ scalar: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassCToken) } | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { @@ -3355,7 +3362,7 @@ scalar: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) } | T_START_HEREDOC T_END_HEREDOC { @@ -3365,7 +3372,7 @@ scalar: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) } | '"' encaps_list '"' { @@ -3375,7 +3382,7 @@ scalar: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoubleQuoteToken) } | T_START_HEREDOC encaps_list T_END_HEREDOC { @@ -3385,7 +3392,7 @@ scalar: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) } | dereferencable_scalar { $$ = $1; } @@ -3411,8 +3418,8 @@ constant: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments(target, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + yylex.(*Parser).comments.AddFromToken(target, $3, comment.IdentifierToken) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM identifier { @@ -3424,8 +3431,8 @@ constant: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments(target, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + yylex.(*Parser).comments.AddFromToken(target, $3, comment.IdentifierToken) } ; @@ -3456,8 +3463,8 @@ dereferencable: $$ = $2; // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) } | dereferencable_scalar { $$ = $1; } @@ -3471,8 +3478,8 @@ callable_expr: $$ = $2; // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) } | dereferencable_scalar { $$ = $1; } @@ -3489,8 +3496,8 @@ callable_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) } | constant '[' optional_expr ']' { @@ -3500,8 +3507,8 @@ callable_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) } | dereferencable '{' expr '}' { @@ -3511,8 +3518,8 @@ callable_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) } | dereferencable T_OBJECT_OPERATOR property_name argument_list { @@ -3522,7 +3529,7 @@ callable_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.ObjectOperatorToken) } | function_call { $$ = $1; } @@ -3541,7 +3548,7 @@ variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.ObjectOperatorToken) } ; @@ -3556,7 +3563,7 @@ simple_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) } | '$' '{' expr '}' { @@ -3566,9 +3573,9 @@ simple_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) } | '$' simple_variable { @@ -3578,7 +3585,7 @@ simple_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarToken) } ; @@ -3591,7 +3598,7 @@ static_member: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable { @@ -3601,7 +3608,7 @@ static_member: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } ; @@ -3616,8 +3623,8 @@ new_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) } | new_variable '{' expr '}' { @@ -3627,8 +3634,8 @@ new_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) } | new_variable T_OBJECT_OPERATOR property_name { @@ -3638,7 +3645,7 @@ new_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.ObjectOperatorToken) } | class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable { @@ -3648,7 +3655,7 @@ new_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } | new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable { @@ -3658,7 +3665,7 @@ new_variable: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } ; @@ -3671,15 +3678,15 @@ member_name: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.IdentifierToken) } | '{' expr '}' { $$ = $2; // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) } | simple_variable { $$ = $1 } @@ -3694,15 +3701,15 @@ property_name: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringToken) } | '{' expr '}' { $$ = $2; // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) } | simple_variable { $$ = $1 } @@ -3732,7 +3739,7 @@ non_empty_array_pair_list: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } | possible_array_pair { $$ = []node.Node{$1} } @@ -3747,7 +3754,7 @@ array_pair: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.DoubleArrowToken) } | expr { @@ -3764,8 +3771,8 @@ array_pair: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.DoubleArrowToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.AmpersandToken) } | '&' variable { @@ -3775,7 +3782,7 @@ array_pair: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.AmpersandToken) } | expr T_DOUBLE_ARROW T_LIST '(' array_pair_list ')' { @@ -3788,10 +3795,10 @@ array_pair: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments(list, $3.Comments()) - yylex.(*Parser).comments.AddComments(list, $4.Comments()) - yylex.(*Parser).comments.AddComments(list, $6.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.DoubleArrowToken) + yylex.(*Parser).comments.AddFromToken(list, $3, comment.ListToken) + yylex.(*Parser).comments.AddFromToken(list, $4, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(list, $6, comment.CloseParenthesisToken) } | T_LIST '(' array_pair_list ')' { @@ -3804,9 +3811,9 @@ array_pair: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments(list, $1.Comments()) - yylex.(*Parser).comments.AddComments(list, $2.Comments()) - yylex.(*Parser).comments.AddComments(list, $4.Comments()) + yylex.(*Parser).comments.AddFromToken(list, $1, comment.ListToken) + yylex.(*Parser).comments.AddFromToken(list, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(list, $4, comment.CloseParenthesisToken) } ; @@ -3822,7 +3829,7 @@ encaps_list: yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) // save comments - yylex.(*Parser).comments.AddComments(encapsed, $2.Comments()) + yylex.(*Parser).comments.AddFromToken(encapsed, $2, comment.EncapsedAndWhitespaceToken) } | encaps_var { $$ = []node.Node{$1} } @@ -3835,7 +3842,7 @@ encaps_list: yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments(encapsed, $1.Comments()) + yylex.(*Parser).comments.AddFromToken(encapsed, $1, comment.EncapsedAndWhitespaceToken) } ; @@ -3850,7 +3857,7 @@ encaps_var: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) } | T_VARIABLE '[' encaps_var_offset ']' { @@ -3864,9 +3871,9 @@ encaps_var: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) } | T_VARIABLE T_OBJECT_OPERATOR T_STRING { @@ -3882,9 +3889,9 @@ encaps_var: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments(fetch, $3.Comments()) + yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.ObjectOperatorToken) + yylex.(*Parser).comments.AddFromToken(fetch, $3, comment.StringToken) } | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { @@ -3894,8 +3901,8 @@ encaps_var: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { @@ -3907,9 +3914,9 @@ encaps_var: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments(name, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringVarnameToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { @@ -3923,11 +3930,11 @@ encaps_var: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments(variable, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, $5.Comments()) - yylex.(*Parser).comments.AddComments($$, $6.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(variable, $2, comment.StringVarnameToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.CloseSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseCurlyBracesToken) } | T_CURLY_OPEN variable '}' { @@ -3943,7 +3950,7 @@ encaps_var_offset: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringToken) } | T_NUM_STRING { @@ -3958,7 +3965,7 @@ encaps_var_offset: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NumStringToken) } | '-' T_NUM_STRING { @@ -3982,11 +3989,11 @@ encaps_var_offset: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.MinusToken) if isInt { - yylex.(*Parser).comments.AddComments(lnumber, $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lnumber, $2, comment.NumStringToken) } else { - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.NumStringToken) } } | T_VARIABLE @@ -3999,7 +4006,7 @@ encaps_var_offset: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) } ; @@ -4012,12 +4019,12 @@ internal_functions_in_yacc: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.IssetToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) if $4 != nil { - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CommaToken) } - yylex.(*Parser).comments.AddComments($$, $5.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.CloseParenthesisToken) } | T_EMPTY '(' expr ')' { @@ -4027,9 +4034,9 @@ internal_functions_in_yacc: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.EmptyToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) } | T_INCLUDE expr { @@ -4039,7 +4046,7 @@ internal_functions_in_yacc: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncludeToken) } | T_INCLUDE_ONCE expr { @@ -4049,7 +4056,7 @@ internal_functions_in_yacc: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncludeOnceToken) } | T_EVAL '(' expr ')' { @@ -4059,9 +4066,9 @@ internal_functions_in_yacc: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.EvalToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) } | T_REQUIRE expr { @@ -4071,7 +4078,7 @@ internal_functions_in_yacc: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.RequireToken) } | T_REQUIRE_ONCE expr { @@ -4081,7 +4088,7 @@ internal_functions_in_yacc: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.RequireOnceToken) } ; @@ -4093,7 +4100,7 @@ isset_variables: $$ = append($1, $3) // save comments - yylex.(*Parser).comments.AddComments(lastNode($1), $2.Comments()) + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } ; From 6b70d665d451194543d1d0087c31473dba81fa68 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 27 May 2018 22:21:06 +0300 Subject: [PATCH 11/25] remove unused token name constants --- comment/tokenNames.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/comment/tokenNames.go b/comment/tokenNames.go index 75add38..70175f3 100644 --- a/comment/tokenNames.go +++ b/comment/tokenNames.go @@ -16,8 +16,6 @@ const ( VariableToken NumStringToken InlineHTMLToken - CharacterToken - BadCharacterToken EncapsedAndWhitespaceToken ConstantEncapsedStringToken EchoToken @@ -52,13 +50,11 @@ const ( UnsetToken IssetToken EmptyToken - HalcompilerToken ClassToken TraitToken InterfaceToken ExtendsToken ImplementsToken - ObjecoperatorToken DoubleArrowToken ListToken ArrayToken @@ -69,14 +65,7 @@ const ( FuncCToken LineToken FileToken - CommentToken - DocCommentToken - OpenTagToken - OpenTagWithEchoToken - CloseTagToken - WhitespaceToken StartHeredocToken - EndHeredocToken DollarOpenCurlyBracesToken CurlyOpenToken PaamayimNekudotayimToken @@ -118,7 +107,6 @@ const ( UnsetCastToken CoalesceToken SpaceshipToken - NoelseToken PlusEqualToken MinusEqualToken MulEqualToken From be3bdbfdc08324e8c3f93ae145461f94870877dc Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 27 May 2018 22:37:22 +0300 Subject: [PATCH 12/25] dump comment anchor --- comment/tokenNames.go | 160 +++++++++++++++++++++++++++++++++++++++++ visitor/dumper.go | 3 +- visitor/dumper_test.go | 2 +- 3 files changed, 163 insertions(+), 2 deletions(-) diff --git a/comment/tokenNames.go b/comment/tokenNames.go index 70175f3..cff630f 100644 --- a/comment/tokenNames.go +++ b/comment/tokenNames.go @@ -162,3 +162,163 @@ const ( GreaterToken // '>' DotToken // '.' ) + +var TokenNames = map[TokenName]string{ + UnknownToken: "UnknownToken", + IncludeToken: "IncludeToken", + IncludeOnceToken: "IncludeOnceToken", + ExitToken: "ExitToken", + IfToken: "IfToken", + LnumberToken: "LnumberToken", + DnumberToken: "DnumberToken", + StringToken: "StringToken", + StringVarnameToken: "StringVarnameToken", + VariableToken: "VariableToken", + NumStringToken: "NumStringToken", + InlineHTMLToken: "InlineHTMLToken", + EncapsedAndWhitespaceToken: "EncapsedAndWhitespaceToken", + ConstantEncapsedStringToken: "ConstantEncapsedStringToken", + EchoToken: "EchoToken", + DoToken: "DoToken", + WhileToken: "WhileToken", + EndwhileToken: "EndwhileToken", + ForToken: "ForToken", + EndforToken: "EndforToken", + ForeachToken: "ForeachToken", + EndforeachToken: "EndforeachToken", + DeclareToken: "DeclareToken", + EnddeclareToken: "EnddeclareToken", + AsToken: "AsToken", + SwitchToken: "SwitchToken", + EndswitchToken: "EndswitchToken", + CaseToken: "CaseToken", + DefaultToken: "DefaultToken", + BreakToken: "BreakToken", + ContinueToken: "ContinueToken", + GotoToken: "GotoToken", + FunctionToken: "FunctionToken", + ConstToken: "ConstToken", + ReturnToken: "ReturnToken", + TryToken: "TryToken", + CatchToken: "CatchToken", + FinallyToken: "FinallyToken", + ThrowToken: "ThrowToken", + UseToken: "UseToken", + InsteadofToken: "InsteadofToken", + GlobalToken: "GlobalToken", + VarToken: "VarToken", + UnsetToken: "UnsetToken", + IssetToken: "IssetToken", + EmptyToken: "EmptyToken", + ClassToken: "ClassToken", + TraitToken: "TraitToken", + InterfaceToken: "InterfaceToken", + ExtendsToken: "ExtendsToken", + ImplementsToken: "ImplementsToken", + DoubleArrowToken: "DoubleArrowToken", + ListToken: "ListToken", + ArrayToken: "ArrayToken", + CallableToken: "CallableToken", + ClassCToken: "ClassCToken", + TraitCToken: "TraitCToken", + MethodCToken: "MethodCToken", + FuncCToken: "FuncCToken", + LineToken: "LineToken", + FileToken: "FileToken", + StartHeredocToken: "StartHeredocToken", + DollarOpenCurlyBracesToken: "DollarOpenCurlyBracesToken", + CurlyOpenToken: "CurlyOpenToken", + PaamayimNekudotayimToken: "PaamayimNekudotayimToken", + NamespaceToken: "NamespaceToken", + NsCToken: "NsCToken", + DirToken: "DirToken", + NsSeparatorToken: "NsSeparatorToken", + EllipsisToken: "EllipsisToken", + EvalToken: "EvalToken", + RequireToken: "RequireToken", + RequireOnceToken: "RequireOnceToken", + LogicalOrToken: "LogicalOrToken", + LogicalXorToken: "LogicalXorToken", + LogicalAndToken: "LogicalAndToken", + InstanceofToken: "InstanceofToken", + NewToken: "NewToken", + CloneToken: "CloneToken", + ElseifToken: "ElseifToken", + ElseToken: "ElseToken", + EndifToken: "EndifToken", + PrintToken: "PrintToken", + YieldToken: "YieldToken", + StaticToken: "StaticToken", + AbstractToken: "AbstractToken", + FinalToken: "FinalToken", + PrivateToken: "PrivateToken", + ProtectedToken: "ProtectedToken", + PublicToken: "PublicToken", + IncToken: "IncToken", + DecToken: "DecToken", + YieldFromToken: "YieldFromToken", + ObjectOperatorToken: "ObjectOperatorToken", + IntCastToken: "IntCastToken", + DoubleCastToken: "DoubleCastToken", + StringCastToken: "StringCastToken", + ArrayCastToken: "ArrayCastToken", + ObjectCastToken: "ObjectCastToken", + BoolCastToken: "BoolCastToken", + UnsetCastToken: "UnsetCastToken", + CoalesceToken: "CoalesceToken", + SpaceshipToken: "SpaceshipToken", + PlusEqualToken: "PlusEqualToken", + MinusEqualToken: "MinusEqualToken", + MulEqualToken: "MulEqualToken", + PowEqualToken: "PowEqualToken", + DivEqualToken: "DivEqualToken", + ConcatEqualToken: "ConcatEqualToken", + ModEqualToken: "ModEqualToken", + AndEqualToken: "AndEqualToken", + OrEqualToken: "OrEqualToken", + XorEqualToken: "XorEqualToken", + SlEqualToken: "SlEqualToken", + SrEqualToken: "SrEqualToken", + BooleanOrToken: "BooleanOrToken", + BooleanAndToken: "BooleanAndToken", + PowToken: "PowToken", + SlToken: "SlToken", + SrToken: "SrToken", + IsIdenticalToken: "IsIdenticalToken", + IsNotIdenticalToken: "IsNotIdenticalToken", + IsEqualToken: "IsEqualToken", + IsNotEqualToken: "IsNotEqualToken", + IsSmallerOrEqualToken: "IsSmallerOrEqualToken", + IsGreaterOrEqualToken: "IsGreaterOrEqualToken", + HaltCompilerToken: "HaltCompilerToken", + IdentifierToken: "IdentifierToken", + CaseSeparatorToken: "CaseSeparatorToken", + DoubleQuoteToken: "DoubleQuoteToken", + BackquoteToken: "BackquoteToken", + OpenCurlyBracesToken: "OpenCurlyBracesToken", + CloseCurlyBracesToken: "CloseCurlyBracesToken", + SemiColonToken: "SemiColonToken", + ColonToken: "ColonToken", + OpenParenthesisToken: "OpenParenthesisToken", + CloseParenthesisToken: "CloseParenthesisToken", + OpenSquareBracket: "OpenSquareBracket", + CloseSquareBracket: "CloseSquareBracket", + QuestionMarkToken: "QuestionMarkToken", + AmpersandToken: "AmpersandToken", + MinusToken: "MinusToken", + PlusToken: "PlusToken", + ExclamationMarkToken: "ExclamationMarkToken", + TildeToken: "TildeToken", + AtToken: "AtToken", + DollarToken: "DollarToken", + CommaToken: "CommaToken", + VerticalBarToken: "VerticalBarToken", + EqualToken: "EqualToken", + CaretToken: "CaretToken", + AsteriskToken: "AsteriskToken", + SlashToken: "SlashToken", + PercentToken: "PercentToken", + LessToken: "LessToken", + GreaterToken: "GreaterToken", + DotToken: "DotToken", +} diff --git a/visitor/dumper.go b/visitor/dumper.go index 6930f1b..0cf56e1 100644 --- a/visitor/dumper.go +++ b/visitor/dumper.go @@ -6,6 +6,7 @@ import ( "io" "reflect" + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/parser" @@ -44,7 +45,7 @@ func (d Dumper) EnterNode(w walker.Walkable) bool { if c := d.Comments[n]; len(c) > 0 { fmt.Fprintf(d.Writer, "%v\"Comments\":\n", d.Indent+" ") for _, cc := range c { - fmt.Fprintf(d.Writer, "%v%q\n", d.Indent+" ", cc) + fmt.Fprintf(d.Writer, "%v%q before %q\n", d.Indent+" ", cc, comment.TokenNames[cc.TokenName()]) } } } diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index f6bad0f..cb3094c 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -111,7 +111,7 @@ func ExampleDumper() { //| [*expr.Variable] //| "Position": Pos{Line: 8-8 Pos: 124-127}; //| "Comments": - //| "// some comment\n" + //| "// some comment\n" before "VariableToken" //| "VarName": //| [*node.Identifier] //| "Position": Pos{Line: 8-8 Pos: 124-127}; From 8fc4c60bfeef790351ed231c0b63d552bb804a57 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 29 Apr 2018 19:58:49 +0300 Subject: [PATCH 13/25] create ArgumentList node --- node/expr/assign/t_assign_op_test.go | 12 +- node/expr/n_function_call.go | 18 +- node/expr/n_method_call.go | 20 +- node/expr/n_new.go | 18 +- node/expr/n_static_call.go | 20 +- node/expr/t_function_call_test.go | 48 +- node/expr/t_method_call_test.go | 6 +- node/expr/t_new_test.go | 12 +- node/expr/t_static_call_test.go | 22 +- node/expr/t_visitor_test.go | 28 +- node/n_argument_list.go | 41 + node/name/t_name_test.go | 6 +- node/scalar/t_encapsed_test.go | 6 +- node/stmt/n_class.go | 16 +- node/stmt/t_class_test.go | 5 +- node/stmt/t_global_test.go | 2 +- node/stmt/t_visitor_test.go | 10 +- node/t_node_test.go | 104 +- node/t_visitor_test.go | 9 + php5/php5.go | 1348 +++++++++++++------------- php5/php5.y | 75 +- php5/php5_test.go | 182 ++-- php7/php7.go | 1098 ++++++++++----------- php7/php7.y | 449 ++++----- php7/php7_test.go | 155 +-- printer/printer.go | 14 +- printer/printer_test.go | 80 +- visitor/namespace_resolver_test.go | 38 +- 28 files changed, 2010 insertions(+), 1832 deletions(-) create mode 100644 node/n_argument_list.go diff --git a/node/expr/assign/t_assign_op_test.go b/node/expr/assign/t_assign_op_test.go index a901fae..90e3527 100644 --- a/node/expr/assign/t_assign_op_test.go +++ b/node/expr/assign/t_assign_op_test.go @@ -99,11 +99,13 @@ func TestReferenceArgs(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Arguments: []node.Node{ - &node.Argument{ - Variadic: false, - IsReference: false, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + Variadic: false, + IsReference: false, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, }, }, }, diff --git a/node/expr/n_function_call.go b/node/expr/n_function_call.go index 22f2d07..2d17fdc 100644 --- a/node/expr/n_function_call.go +++ b/node/expr/n_function_call.go @@ -7,15 +7,15 @@ import ( // FunctionCall node type FunctionCall struct { - Function node.Node - Arguments []node.Node + Function node.Node + ArgumentList *node.ArgumentList } // NewFunctionCall node constructor -func NewFunctionCall(Function node.Node, Arguments []node.Node) *FunctionCall { +func NewFunctionCall(Function node.Node, ArgumentList *node.ArgumentList) *FunctionCall { return &FunctionCall{ Function, - Arguments, + ArgumentList, } } @@ -36,13 +36,9 @@ func (n *FunctionCall) Walk(v walker.Visitor) { n.Function.Walk(vv) } - if n.Arguments != nil { - vv := v.GetChildrenVisitor("Arguments") - for _, nn := range n.Arguments { - if nn != nil { - nn.Walk(vv) - } - } + if n.ArgumentList != nil { + vv := v.GetChildrenVisitor("ArgumentList") + n.ArgumentList.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/n_method_call.go b/node/expr/n_method_call.go index 8746418..1bcc4fb 100644 --- a/node/expr/n_method_call.go +++ b/node/expr/n_method_call.go @@ -7,17 +7,17 @@ import ( // MethodCall node type MethodCall struct { - Variable node.Node - Method node.Node - Arguments []node.Node + Variable node.Node + Method node.Node + ArgumentList *node.ArgumentList } // NewMethodCall node constructor -func NewMethodCall(Variable node.Node, Method node.Node, Arguments []node.Node) *MethodCall { +func NewMethodCall(Variable node.Node, Method node.Node, ArgumentList *node.ArgumentList) *MethodCall { return &MethodCall{ Variable, Method, - Arguments, + ArgumentList, } } @@ -43,13 +43,9 @@ func (n *MethodCall) Walk(v walker.Visitor) { n.Method.Walk(vv) } - if n.Arguments != nil { - vv := v.GetChildrenVisitor("Arguments") - for _, nn := range n.Arguments { - if nn != nil { - nn.Walk(vv) - } - } + if n.ArgumentList != nil { + vv := v.GetChildrenVisitor("ArgumentList") + n.ArgumentList.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/n_new.go b/node/expr/n_new.go index d773daf..c68b102 100644 --- a/node/expr/n_new.go +++ b/node/expr/n_new.go @@ -7,15 +7,15 @@ import ( // New node type New struct { - Class node.Node - Arguments []node.Node + Class node.Node + ArgumentList *node.ArgumentList } // NewNew node constructor -func NewNew(Class node.Node, Arguments []node.Node) *New { +func NewNew(Class node.Node, ArgumentList *node.ArgumentList) *New { return &New{ Class, - Arguments, + ArgumentList, } } @@ -36,13 +36,9 @@ func (n *New) Walk(v walker.Visitor) { n.Class.Walk(vv) } - if n.Arguments != nil { - vv := v.GetChildrenVisitor("Arguments") - for _, nn := range n.Arguments { - if nn != nil { - nn.Walk(vv) - } - } + if n.ArgumentList != nil { + vv := v.GetChildrenVisitor("ArgumentList") + n.ArgumentList.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/n_static_call.go b/node/expr/n_static_call.go index a9cded4..0324a6c 100644 --- a/node/expr/n_static_call.go +++ b/node/expr/n_static_call.go @@ -7,17 +7,17 @@ import ( // StaticCall node type StaticCall struct { - Class node.Node - Call node.Node - Arguments []node.Node + Class node.Node + Call node.Node + ArgumentList *node.ArgumentList } // NewStaticCall node constructor -func NewStaticCall(Class node.Node, Call node.Node, Arguments []node.Node) *StaticCall { +func NewStaticCall(Class node.Node, Call node.Node, ArgumentList *node.ArgumentList) *StaticCall { return &StaticCall{ Class, Call, - Arguments, + ArgumentList, } } @@ -43,13 +43,9 @@ func (n *StaticCall) Walk(v walker.Visitor) { n.Call.Walk(vv) } - if n.Arguments != nil { - vv := v.GetChildrenVisitor("Arguments") - for _, nn := range n.Arguments { - if nn != nil { - nn.Walk(vv) - } - } + if n.ArgumentList != nil { + vv := v.GetChildrenVisitor("ArgumentList") + n.ArgumentList.Walk(vv) } v.LeaveNode(n) diff --git a/node/expr/t_function_call_test.go b/node/expr/t_function_call_test.go index 03d4c33..8bb96dc 100644 --- a/node/expr/t_function_call_test.go +++ b/node/expr/t_function_call_test.go @@ -29,7 +29,7 @@ func TestFunctionCall(t *testing.T) { &name.NamePart{Value: "foo"}, }, }, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, }, }, @@ -58,7 +58,7 @@ func TestFunctionCallRelative(t *testing.T) { &name.NamePart{Value: "foo"}, }, }, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, }, }, @@ -87,12 +87,14 @@ func TestFunctionFullyQualified(t *testing.T) { &name.NamePart{Value: "foo"}, }, }, - Arguments: []node.Node{ - &node.Argument{ - Variadic: false, - IsReference: false, - Expr: &expr.ShortArray{ - Items: []node.Node{}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + Variadic: false, + IsReference: false, + Expr: &expr.ShortArray{ + Items: []node.Node{}, + }, }, }, }, @@ -120,12 +122,14 @@ func TestFunctionCallVar(t *testing.T) { &stmt.Expression{ Expr: &expr.FunctionCall{ Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Arguments: []node.Node{ - &node.Argument{ - Variadic: false, - IsReference: false, - Expr: &expr.Yield{ - Value: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + Variadic: false, + IsReference: false, + Expr: &expr.Yield{ + Value: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, }, }, }, @@ -157,13 +161,15 @@ func TestFunctionCallExprArg(t *testing.T) { &name.NamePart{Value: "ceil"}, }, }, - Arguments: []node.Node{ - &node.Argument{ - Variadic: false, - IsReference: false, - Expr: &binary.Div{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Right: &scalar.Lnumber{Value: "3"}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + Variadic: false, + IsReference: false, + Expr: &binary.Div{ + Left: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Right: &scalar.Lnumber{Value: "3"}, + }, }, }, }, diff --git a/node/expr/t_method_call_test.go b/node/expr/t_method_call_test.go index bcd5376..05ae22a 100644 --- a/node/expr/t_method_call_test.go +++ b/node/expr/t_method_call_test.go @@ -19,9 +19,9 @@ func TestMethodCall(t *testing.T) { Stmts: []node.Node{ &stmt.Expression{ Expr: &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Method: &node.Identifier{Value: "foo"}, - Arguments: []node.Node{}, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Method: &node.Identifier{Value: "foo"}, + ArgumentList: &node.ArgumentList{}, }, }, }, diff --git a/node/expr/t_new_test.go b/node/expr/t_new_test.go index 656abdf..e286459 100644 --- a/node/expr/t_new_test.go +++ b/node/expr/t_new_test.go @@ -54,7 +54,7 @@ func TestNewRelative(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, }, }, @@ -83,7 +83,7 @@ func TestNewFullyQualified(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, }, }, @@ -109,9 +109,11 @@ func TestNewAnonymous(t *testing.T) { Expr: &expr.New{ Class: &stmt.Class{ PhpDocComment: "", - Args: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, Stmts: []node.Node{}, }, diff --git a/node/expr/t_static_call_test.go b/node/expr/t_static_call_test.go index 4b03128..9d3601b 100644 --- a/node/expr/t_static_call_test.go +++ b/node/expr/t_static_call_test.go @@ -26,8 +26,8 @@ func TestStaticCall(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{}, + Call: &node.Identifier{Value: "bar"}, + ArgumentList: &node.ArgumentList{}, }, }, }, @@ -56,8 +56,8 @@ func TestStaticCallRelative(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{}, + Call: &node.Identifier{Value: "bar"}, + ArgumentList: &node.ArgumentList{}, }, }, }, @@ -86,8 +86,8 @@ func TestStaticCallFullyQualified(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{}, + Call: &node.Identifier{Value: "bar"}, + ArgumentList: &node.ArgumentList{}, }, }, }, @@ -116,8 +116,8 @@ func TestStaticCallVar(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - Arguments: []node.Node{}, + Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + ArgumentList: &node.ArgumentList{}, }, }, }, @@ -141,9 +141,9 @@ func TestStaticCallVarVar(t *testing.T) { Stmts: []node.Node{ &stmt.Expression{ Expr: &expr.StaticCall{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - Arguments: []node.Node{}, + Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + ArgumentList: &node.ArgumentList{}, }, }, }, diff --git a/node/expr/t_visitor_test.go b/node/expr/t_visitor_test.go index 89a9261..1434ee7 100644 --- a/node/expr/t_visitor_test.go +++ b/node/expr/t_visitor_test.go @@ -146,10 +146,10 @@ var nodesToTest = []struct { }, { &expr.FunctionCall{ - Function: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Arguments: []node.Node{&node.Argument{}}, + Function: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + ArgumentList: &node.ArgumentList{}, }, - []string{"Function", "Arguments"}, + []string{"Function", "ArgumentList"}, map[string]interface{}{}, }, { @@ -194,19 +194,19 @@ var nodesToTest = []struct { }, { &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Method: &node.Identifier{Value: "foo"}, - Arguments: []node.Node{&node.Argument{}}, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Method: &node.Identifier{Value: "foo"}, + ArgumentList: &node.ArgumentList{}, }, - []string{"Variable", "Method", "Arguments"}, + []string{"Variable", "Method", "ArgumentList"}, map[string]interface{}{}, }, { &expr.New{ - Class: &name.Name{}, - Arguments: []node.Node{&node.Argument{}}, + Class: &name.Name{}, + ArgumentList: &node.ArgumentList{}, }, - []string{"Class", "Arguments"}, + []string{"Class", "ArgumentList"}, map[string]interface{}{}, }, { @@ -295,11 +295,11 @@ var nodesToTest = []struct { }, { &expr.StaticCall{ - Class: &name.Name{}, - Call: &node.Identifier{Value: "foo"}, - Arguments: []node.Node{&node.Argument{}}, + Class: &name.Name{}, + Call: &node.Identifier{Value: "foo"}, + ArgumentList: &node.ArgumentList{}, }, - []string{"Class", "Call", "Arguments"}, + []string{"Class", "Call", "ArgumentList"}, map[string]interface{}{}, }, { diff --git a/node/n_argument_list.go b/node/n_argument_list.go new file mode 100644 index 0000000..843030f --- /dev/null +++ b/node/n_argument_list.go @@ -0,0 +1,41 @@ +package node + +import ( + "github.com/z7zmey/php-parser/walker" +) + +// ArgumentList node +type ArgumentList struct { + Arguments []Node +} + +// NewArgumentList node constructor +func NewArgumentList(Arguments []Node) *ArgumentList { + return &ArgumentList{ + Arguments, + } +} + +// Attributes returns node attributes as map +func (n *ArgumentList) Attributes() map[string]interface{} { + return nil +} + +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true +func (n *ArgumentList) Walk(v walker.Visitor) { + if v.EnterNode(n) == false { + return + } + + if n.Arguments != nil { + vv := v.GetChildrenVisitor("Arguments") + for _, nn := range n.Arguments { + if nn != nil { + nn.Walk(vv) + } + } + } + + v.LeaveNode(n) +} diff --git a/node/name/t_name_test.go b/node/name/t_name_test.go index 7cd1396..be8414f 100644 --- a/node/name/t_name_test.go +++ b/node/name/t_name_test.go @@ -38,7 +38,7 @@ func TestName(t *testing.T) { Function: &name.Name{ Parts: []node.Node{&name.NamePart{Value: "foo"}}, }, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, }, }, @@ -65,7 +65,7 @@ func TestFullyQualified(t *testing.T) { Function: &name.FullyQualified{ Parts: []node.Node{&name.NamePart{Value: "foo"}}, }, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, }, }, @@ -92,7 +92,7 @@ func TestRelative(t *testing.T) { Function: &name.Relative{ Parts: []node.Node{&name.NamePart{Value: "foo"}}, }, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, }, }, diff --git a/node/scalar/t_encapsed_test.go b/node/scalar/t_encapsed_test.go index 2e13d96..1c02adf 100644 --- a/node/scalar/t_encapsed_test.go +++ b/node/scalar/t_encapsed_test.go @@ -221,9 +221,9 @@ func TestCurlyOpenMethodCall(t *testing.T) { Parts: []node.Node{ &scalar.EncapsedStringPart{Value: "test "}, &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Method: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{}, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Method: &node.Identifier{Value: "bar"}, + ArgumentList: &node.ArgumentList{}, }, }, }, diff --git a/node/stmt/n_class.go b/node/stmt/n_class.go index 6301874..002a9b2 100644 --- a/node/stmt/n_class.go +++ b/node/stmt/n_class.go @@ -10,19 +10,19 @@ type Class struct { PhpDocComment string ClassName node.Node Modifiers []node.Node - Args []node.Node + ArgumentList *node.ArgumentList Extends node.Node Implements []node.Node Stmts []node.Node } // NewClass node constructor -func NewClass(ClassName node.Node, Modifiers []node.Node, Args []node.Node, Extends node.Node, Implements []node.Node, Stmts []node.Node, PhpDocComment string) *Class { +func NewClass(ClassName node.Node, Modifiers []node.Node, ArgumentList *node.ArgumentList, Extends node.Node, Implements []node.Node, Stmts []node.Node, PhpDocComment string) *Class { return &Class{ PhpDocComment, ClassName, Modifiers, - Args, + ArgumentList, Extends, Implements, Stmts, @@ -57,13 +57,9 @@ func (n *Class) Walk(v walker.Visitor) { } } - if n.Args != nil { - vv := v.GetChildrenVisitor("Args") - for _, nn := range n.Args { - if nn != nil { - nn.Walk(vv) - } - } + if n.ArgumentList != nil { + vv := v.GetChildrenVisitor("ArgumentList") + n.ArgumentList.Walk(vv) } if n.Extends != nil { diff --git a/node/stmt/t_class_test.go b/node/stmt/t_class_test.go index c3c6d31..fced4c7 100644 --- a/node/stmt/t_class_test.go +++ b/node/stmt/t_class_test.go @@ -2,9 +2,10 @@ package stmt_test import ( "bytes" + "testing" + "github.com/z7zmey/php-parser/node/expr" "github.com/z7zmey/php-parser/node/name" - "testing" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/stmt" @@ -171,7 +172,7 @@ func TestAnonimousClass(t *testing.T) { &stmt.Expression{ Expr: &expr.New{ Class: &stmt.Class{ - Args: []node.Node{}, + ArgumentList: &node.ArgumentList{}, Extends: &name.Name{ Parts: []node.Node{ &name.NamePart{Value: "foo"}, diff --git a/node/stmt/t_global_test.go b/node/stmt/t_global_test.go index 7d72898..1565966 100644 --- a/node/stmt/t_global_test.go +++ b/node/stmt/t_global_test.go @@ -53,7 +53,7 @@ func TestGlobalVars(t *testing.T) { &name.NamePart{Value: "foo"}, }, }, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, }, }, diff --git a/node/stmt/t_visitor_test.go b/node/stmt/t_visitor_test.go index 85b185a..0ec5c3c 100644 --- a/node/stmt/t_visitor_test.go +++ b/node/stmt/t_visitor_test.go @@ -92,12 +92,12 @@ var nodesToTest = []struct { PhpDocComment: "/** */", ClassName: &node.Identifier{}, Modifiers: []node.Node{&stmt.Expression{}}, - Args: []node.Node{&stmt.Expression{}}, - Extends: &node.Identifier{}, - Implements: []node.Node{&stmt.Expression{}}, - Stmts: []node.Node{&stmt.Expression{}}, + ArgumentList: &node.ArgumentList{}, + Extends: &node.Identifier{}, + Implements: []node.Node{&stmt.Expression{}}, + Stmts: []node.Node{&stmt.Expression{}}, }, - []string{"ClassName", "Modifiers", "Args", "Extends", "Implements", "Stmts"}, + []string{"ClassName", "Modifiers", "ArgumentList", "Extends", "Implements", "Stmts"}, map[string]interface{}{"PhpDocComment": "/** */"}, }, { diff --git a/node/t_node_test.go b/node/t_node_test.go index b7dc2c0..efb75e3 100644 --- a/node/t_node_test.go +++ b/node/t_node_test.go @@ -70,18 +70,22 @@ func TestPhp7ArgumentNode(t *testing.T) { &stmt.Expression{ Expr: &expr.FunctionCall{ Function: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, &stmt.Expression{ Expr: &expr.FunctionCall{ Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, @@ -89,9 +93,11 @@ func TestPhp7ArgumentNode(t *testing.T) { Expr: &expr.MethodCall{ Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, Method: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, @@ -99,9 +105,11 @@ func TestPhp7ArgumentNode(t *testing.T) { Expr: &expr.StaticCall{ Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, @@ -109,18 +117,22 @@ func TestPhp7ArgumentNode(t *testing.T) { Expr: &expr.StaticCall{ Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, &stmt.Expression{ Expr: &expr.New{ Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, @@ -128,9 +140,11 @@ func TestPhp7ArgumentNode(t *testing.T) { Expr: &expr.New{ Class: &stmt.Class{ PhpDocComment: "/** anonymous class */", - Args: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, Stmts: []node.Node{}, }, @@ -160,18 +174,22 @@ func TestPhp5ArgumentNode(t *testing.T) { &stmt.Expression{ Expr: &expr.FunctionCall{ Function: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, &stmt.Expression{ Expr: &expr.FunctionCall{ Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, @@ -179,9 +197,11 @@ func TestPhp5ArgumentNode(t *testing.T) { Expr: &expr.MethodCall{ Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, Method: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, @@ -189,9 +209,11 @@ func TestPhp5ArgumentNode(t *testing.T) { Expr: &expr.StaticCall{ Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, @@ -199,18 +221,22 @@ func TestPhp5ArgumentNode(t *testing.T) { Expr: &expr.StaticCall{ Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, &stmt.Expression{ Expr: &expr.New{ Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, diff --git a/node/t_visitor_test.go b/node/t_visitor_test.go index 1fc3545..262a4f5 100644 --- a/node/t_visitor_test.go +++ b/node/t_visitor_test.go @@ -44,6 +44,15 @@ var nodesToTest = []struct { []string{"VariableType", "Variable", "DefaultValue"}, map[string]interface{}{"ByRef": false, "Variadic": true}, }, + { + &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{}, + }, + }, + []string{"Arguments"}, + map[string]interface{}{}, + }, } type visitorMock struct { diff --git a/php5/php5.go b/php5/php5.go index 51560c5..7e0c848 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -344,7 +344,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:3858 +//line php5/php5.y:3873 type foreachVariable struct { node node.Node @@ -1638,41 +1638,41 @@ var yyPgo = [...]int{ 73, 68, 61, 1068, 1067, 1066, 35, 1065, 1063, 4, 1062, 1061, 1060, 17, 1059, 1058, 1057, 1056, 1055, 51, 5, 1054, 1053, 1051, 1049, 1048, 2, 1047, 631, 1046, - 39, 0, 1045, 1043, 1042, 117, 1041, 1040, 553, 1037, - 1033, 42, 8, 1032, 9, 1030, 1029, 1028, 14, 49, - 1027, 1026, 1024, 1018, 1017, 1013, 3, 1007, 16, 1001, - 1000, 998, 995, 993, 28, 992, 991, 990, 988, 985, - 983, 982, 21, 980, 976, 974, 25, 971, 23, 12, - 962, 40, 961, 959, 958, 955, 41, 6, 19, 18, - 22, 953, 945, 939, 13, 937, 933, 930, 15, 853, + 18, 22, 39, 0, 1045, 1043, 1042, 117, 1041, 1040, + 553, 1037, 1033, 42, 8, 1032, 9, 1030, 1029, 1028, + 14, 49, 1027, 1026, 1024, 1018, 1017, 1013, 3, 1007, + 16, 1001, 1000, 998, 995, 993, 28, 992, 991, 990, + 988, 985, 983, 982, 21, 980, 976, 974, 25, 971, + 23, 12, 962, 40, 961, 959, 958, 955, 41, 6, + 19, 953, 945, 939, 13, 937, 933, 930, 15, 853, 7, 20, } var yyR1 = [...]int{ - 0, 149, 80, 80, 81, 81, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 82, 82, - 4, 4, 4, 4, 83, 83, 5, 5, 5, 5, - 84, 84, 6, 6, 6, 6, 53, 53, 85, 85, + 0, 149, 82, 82, 83, 83, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 84, 84, + 4, 4, 4, 4, 85, 85, 5, 5, 5, 5, + 86, 86, 6, 6, 6, 6, 53, 53, 87, 87, 24, 24, 24, 24, 24, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 103, 103, 58, 58, 104, - 104, 105, 105, 59, 101, 101, 56, 51, 52, 144, + 26, 26, 26, 26, 26, 105, 105, 58, 58, 106, + 106, 107, 107, 59, 103, 103, 56, 51, 52, 144, 144, 145, 145, 60, 61, 61, 64, 64, 64, 64, - 65, 65, 2, 113, 113, 109, 109, 114, 114, 138, - 138, 137, 137, 137, 147, 147, 148, 148, 57, 57, - 102, 102, 141, 141, 141, 141, 99, 99, 99, 150, - 150, 146, 146, 95, 95, 96, 96, 54, 54, 55, - 55, 106, 106, 107, 107, 63, 63, 62, 62, 62, - 62, 140, 140, 140, 115, 115, 69, 69, 69, 69, - 86, 86, 27, 27, 27, 87, 87, 87, 87, 108, - 108, 66, 66, 66, 66, 68, 116, 116, 143, 143, - 117, 117, 118, 118, 70, 70, 71, 119, 119, 74, - 74, 73, 72, 72, 75, 75, 142, 142, 110, 110, - 111, 111, 120, 120, 76, 76, 76, 76, 76, 76, - 112, 112, 112, 112, 67, 67, 100, 100, 98, 98, - 97, 97, 126, 126, 124, 124, 125, 125, 125, 127, - 127, 42, 15, 15, 15, 15, 15, 15, 15, 15, + 65, 65, 2, 115, 115, 111, 111, 116, 116, 140, + 140, 139, 139, 139, 147, 147, 148, 148, 57, 57, + 104, 104, 141, 141, 141, 141, 101, 101, 101, 150, + 150, 146, 146, 97, 97, 98, 98, 54, 54, 55, + 55, 108, 108, 109, 109, 63, 63, 62, 62, 62, + 62, 81, 81, 81, 117, 117, 69, 69, 69, 69, + 88, 88, 27, 27, 27, 89, 89, 89, 89, 110, + 110, 66, 66, 66, 66, 68, 118, 118, 143, 143, + 119, 119, 120, 120, 70, 70, 71, 121, 121, 74, + 74, 73, 72, 72, 75, 75, 142, 142, 112, 112, + 113, 113, 122, 122, 76, 76, 76, 76, 76, 76, + 114, 114, 114, 114, 67, 67, 102, 102, 100, 100, + 99, 99, 128, 128, 126, 126, 127, 127, 127, 129, + 129, 42, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, @@ -1680,27 +1680,27 @@ var yyR1 = [...]int{ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 50, 50, 50, 50, - 47, 47, 47, 47, 46, 46, 1, 94, 94, 93, - 93, 93, 93, 23, 23, 23, 23, 23, 23, 23, + 47, 47, 47, 47, 46, 46, 1, 96, 96, 95, + 95, 95, 95, 23, 23, 23, 23, 23, 23, 23, 23, 11, 11, 11, 11, 45, 45, 45, 43, 43, - 41, 41, 134, 134, 133, 49, 49, 49, 121, 121, - 121, 139, 139, 7, 7, 7, 7, 7, 7, 7, + 41, 41, 136, 136, 135, 49, 49, 49, 123, 123, + 123, 80, 80, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 28, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 35, 35, 35, 35, 29, 29, 29, 29, 29, 29, - 29, 122, 122, 151, 151, 123, 123, 123, 123, 14, - 14, 48, 48, 16, 17, 18, 19, 19, 135, 135, - 128, 130, 130, 77, 129, 129, 129, 40, 40, 44, + 29, 124, 124, 151, 151, 125, 125, 125, 125, 14, + 14, 48, 48, 16, 17, 18, 19, 19, 137, 137, + 130, 132, 132, 77, 131, 131, 131, 40, 40, 44, 44, 12, 22, 22, 20, 20, 20, 21, 21, 21, - 10, 10, 10, 9, 9, 13, 13, 131, 131, 132, - 132, 132, 39, 39, 136, 136, 92, 92, 38, 38, - 38, 91, 91, 90, 90, 90, 90, 90, 90, 90, - 90, 88, 88, 88, 88, 33, 33, 33, 33, 33, + 10, 10, 10, 9, 9, 13, 13, 133, 133, 134, + 134, 134, 39, 39, 138, 138, 94, 94, 38, 38, + 38, 93, 93, 92, 92, 92, 92, 92, 92, 92, + 92, 90, 90, 90, 90, 33, 33, 33, 33, 33, 33, 34, 34, 34, 37, 37, 37, 37, 37, 37, - 37, 37, 89, 89, 36, 36, 30, 30, 31, 32, + 37, 37, 91, 91, 36, 36, 30, 30, 31, 32, } var yyR2 = [...]int{ @@ -1759,7 +1759,7 @@ var yyR2 = [...]int{ } var yyChk = [...]int{ - -1000, -149, -80, -3, 2, -25, -51, -52, 51, 79, + -1000, -149, -82, -3, 2, -25, -51, -52, 51, 79, 44, -53, -26, 10, -60, -61, 38, 142, 7, 21, 20, 23, 30, 34, 35, 39, -50, 46, 98, 19, 14, -14, 48, 25, 27, 144, 40, 43, 36, -1, @@ -1769,99 +1769,99 @@ var yyChk = [...]int{ 112, 113, 6, 156, -29, -47, -46, 141, 96, -20, 91, 49, 50, 4, 5, 84, 85, 86, 11, -35, -32, -7, 140, 74, 62, 18, 60, 148, -21, -22, - -23, -30, -81, 82, -11, 8, 9, 66, 67, 81, - 63, 64, 65, 80, -10, -136, -44, -12, -40, -9, - 157, 12, 146, -81, 142, 82, 10, -82, 37, 38, - -4, -81, 82, 144, 158, 145, 10, -85, -48, 146, + -23, -30, -83, 82, -11, 8, 9, 66, 67, 81, + 63, 64, 65, 80, -10, -138, -44, -12, -40, -9, + 157, 12, 146, -83, 142, 82, 10, -84, 37, 38, + -4, -83, 82, 144, 158, 145, 10, -87, -48, 146, -48, -25, -1, 79, 146, -48, 144, -14, 97, 98, - 144, -14, 144, -15, -19, -14, 144, -86, -27, 12, - 157, -87, -1, 12, -100, -14, 144, 129, 130, 87, + 144, -14, 144, -15, -19, -14, 144, -88, -27, 12, + 157, -89, -1, 12, -102, -14, 144, 129, 130, 87, 89, 88, 159, 151, 161, 167, 153, 152, 162, 131, 163, 164, 132, 133, 134, 135, 136, 137, 165, 138, 166, 139, 90, 150, 146, 146, 146, 142, -14, 10, -144, 151, 10, 10, -15, -19, -14, 52, 52, 160, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 146, -14, 104, 105, -18, -19, -81, 79, + 127, 128, 146, -14, 104, 105, -18, -19, -83, 79, 82, -11, -12, 98, -18, -14, -14, -14, -14, -42, -14, -50, -14, -14, -14, -14, -14, -14, -14, -49, - 146, -48, -14, 148, 148, -121, 17, -88, -33, 12, - 76, 77, -14, 57, -43, -11, -41, -81, 79, 82, - -21, -10, -136, -12, 146, 146, -14, -14, 146, -14, - -14, 148, -88, 17, 17, 75, -88, 148, 146, -91, - -90, -14, 151, 148, 148, 82, -140, 146, -81, 78, - 148, 142, -10, 157, 78, -140, 142, 147, 144, 142, - -80, -81, 144, 158, -83, -5, -81, 82, -84, -6, - -81, 82, 29, -81, 10, 160, -24, 143, 2, -25, + 146, -48, -14, 148, 148, -123, 17, -90, -33, 12, + 76, 77, -14, 57, -43, -11, -41, -83, 79, 82, + -21, -10, -138, -12, 146, 146, -14, -14, 146, -14, + -14, 148, -90, 17, 17, 75, -90, 148, 146, -93, + -92, -14, 151, 148, 148, 82, -81, 146, -83, 78, + 148, 142, -10, 157, 78, -81, 142, 147, 144, 142, + -82, -83, 144, 158, -85, -5, -83, 82, -86, -6, + -83, 82, 29, -83, 10, 160, -24, 143, 2, -25, -51, -52, 51, -25, 145, -146, -25, 145, 21, -144, - -98, -97, -14, -141, 142, 145, 144, 144, 144, 144, + -100, -99, -14, -141, 142, 145, 144, 144, 144, 144, 144, 158, -16, 142, -19, 144, 158, -144, 160, 144, 158, -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, -43, -14, 145, -101, - -56, -19, -19, -15, -102, 10, -85, 144, 144, 10, - 146, -65, 55, -113, 55, 58, -14, 151, -14, -14, + -14, -14, -14, -14, -14, -14, -43, -14, 145, -103, + -56, -19, -19, -15, -104, 10, -87, 144, 144, 10, + 146, -65, 55, -115, 55, 58, -14, 151, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -92, -38, -19, 59, 82, -81, 78, 78, 147, 147, + -94, -38, -19, 59, 82, -83, 78, 78, 147, 147, 147, 147, -13, -14, -13, 141, -33, -33, 17, 148, - 57, -14, 11, -19, -131, -132, -40, -39, -10, -136, - 10, 142, -139, -140, 78, 82, -81, 57, -10, 78, - -89, -36, -19, -15, -19, -15, -14, -13, 140, 75, - 75, -13, -91, 149, -151, 158, 58, -17, -19, -13, - -13, 10, 147, -115, -50, -69, -15, -19, 151, 83, - -140, -39, -40, 10, 52, -13, -14, -39, -40, 10, - -14, 144, -80, 143, -140, -4, 144, 158, 29, -81, - 144, 158, 29, -81, 10, 29, 160, -28, -78, -7, - -31, -81, 79, 82, 60, 148, -8, 62, -79, 18, - 74, -11, 154, 155, 153, 152, 146, 146, -95, -85, - -85, -48, 144, 158, -99, 144, -99, 144, -27, -14, + 57, -14, 11, -19, -133, -134, -40, -39, -10, -138, + 10, 142, -80, -81, 78, 82, -83, 57, -10, 78, + -91, -36, -19, -15, -19, -15, -14, -13, 140, 75, + 75, -13, -93, 149, -151, 158, 58, -17, -19, -13, + -13, 10, 147, -117, -50, -69, -15, -19, 151, 83, + -81, -39, -40, 10, 52, -13, -14, -39, -40, 10, + -14, 144, -82, 143, -81, -4, 144, 158, 29, -83, + 144, 158, 29, -83, 10, 29, 160, -28, -78, -7, + -31, -83, 79, 82, 60, 148, -8, 62, -79, 18, + 74, -11, 154, 155, 153, 152, 146, 146, -97, -87, + -87, -48, 144, 158, -101, 144, -101, 144, -27, -14, 12, 146, -28, -14, 145, -14, 147, 158, 29, 29, - 147, 158, 160, 143, 146, -106, -107, -63, -62, 60, - 61, -45, -81, 79, 82, -109, 56, -45, 142, -114, - -45, -15, -19, -19, 91, 147, 158, 146, -81, -127, - -125, -124, -126, 148, -128, 57, 149, 149, -34, 10, - 13, 12, 10, 143, 148, 143, -129, -77, -130, -140, - 148, 142, -10, -14, -40, -81, -131, -40, 147, 158, + 147, 158, 160, 143, 146, -108, -109, -63, -62, 60, + 61, -45, -83, 79, 82, -111, 56, -45, 142, -116, + -45, -15, -19, -19, 91, 147, 158, 146, -83, -129, + -127, -126, -128, 148, -130, 57, 149, 149, -34, 10, + 13, 12, 10, 143, 148, 143, -131, -77, -132, -81, + 148, 142, -10, -14, -40, -83, -133, -40, 147, 158, 147, 147, 147, 149, 149, 147, -14, 151, -14, 151, - 149, 149, 147, 158, 147, -17, -14, -140, -140, 149, - 143, -140, -140, 143, 143, -5, 10, 29, -6, 10, + 149, 149, 147, 158, 147, -17, -14, -81, -81, 149, + 143, -81, -81, 143, 143, -5, 10, 29, -6, 10, 29, 10, -28, 148, 153, 152, 162, 131, 163, 164, 159, 151, 161, 132, 133, 167, 88, 89, 87, 130, 129, 134, 135, 136, 137, 165, 166, 138, 139, 150, - 82, -81, 146, -122, -123, -78, 17, 78, -78, -78, - -78, -78, -78, 147, -54, 93, 94, -96, 22, 144, - -98, -14, 143, 32, 33, -99, 31, -99, 143, 160, - -106, -14, 144, -56, -137, -19, 151, 59, -137, -57, - -25, 145, 10, -28, -103, 41, -106, 147, 158, -144, - 82, -81, 142, -114, -108, 158, -43, 160, -38, -92, - 148, -126, -128, -13, -131, 149, -14, -135, 148, 148, - -13, -14, 143, -134, -36, 58, -17, -17, -69, 10, + 82, -83, 146, -124, -125, -78, 17, 78, -78, -78, + -78, -78, -78, 147, -54, 93, 94, -98, 22, 144, + -100, -14, 143, 32, 33, -101, 31, -101, 143, 160, + -108, -14, 144, -56, -139, -19, 151, 59, -139, -57, + -25, 145, 10, -28, -105, 41, -108, 147, 158, -144, + 82, -83, 142, -116, -110, 158, -43, 160, -38, -94, + 148, -128, -130, -13, -133, 149, -14, -137, 148, 148, + -13, -14, 143, -136, -36, 58, -17, -17, -69, 10, 10, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, 145, -78, -81, - -122, 149, -151, 158, 58, 10, 52, 147, 144, -48, + -78, -78, -78, -78, -78, -78, -78, 145, -78, -83, + -124, 149, -151, 158, 58, 10, 52, 147, 144, -48, -25, -55, 93, 94, 144, 144, -14, -150, 145, 144, - 143, 144, 31, -28, 147, -138, 58, -19, 146, -138, - -85, 160, -58, 42, 146, 147, -94, 44, -63, -145, - 83, -81, -108, 143, -66, -110, -67, -68, -111, -120, + 143, 144, 31, -28, 147, -140, 58, -19, 146, -140, + -87, 160, -58, 42, 146, 147, -96, 44, -63, -145, + 83, -83, -110, 143, -66, -112, -67, -68, -113, -122, 47, 38, 44, -76, 103, 102, 101, 98, 99, 100, - -45, -139, -14, 147, -13, 149, -129, 149, -128, -13, - -13, 149, 143, -133, 57, -14, 151, 149, -78, 145, - 147, -78, -78, -25, 95, -48, 145, -98, -150, -85, - 144, -94, 147, -137, -92, 147, 28, -28, 142, -45, - 142, 142, 146, 12, 143, -112, 12, 144, 158, -1, - -76, 10, -116, -45, 149, 143, 149, 149, -131, -17, - -78, 58, 144, 145, -85, 147, -85, 142, -148, -25, - 145, 147, -148, 144, -85, 12, -85, -85, -93, 12, + -45, -80, -14, 147, -13, 149, -131, 149, -130, -13, + -13, 149, 143, -135, 57, -14, 151, 149, -78, 145, + 147, -78, -78, -25, 95, -48, 145, -100, -150, -87, + 144, -96, 147, -139, -94, 147, 28, -28, 142, -45, + 142, 142, 146, 12, 143, -114, 12, 144, 158, -1, + -76, 10, -118, -45, 149, 143, 149, 149, -133, -17, + -78, 58, 144, 145, -87, 147, -87, 142, -148, -25, + 145, 147, -148, 144, -87, 12, -87, -87, -95, 12, 151, 160, 144, 158, 160, 10, -144, 160, -143, 158, - 144, 142, -78, -85, -147, -25, 145, -85, -85, 143, + 144, 142, -78, -87, -147, -25, 145, -87, -87, 143, 147, 143, 143, 147, 158, 12, -28, 12, -28, 160, - 10, -28, -45, -117, -118, -70, -71, -72, -73, -74, - -45, 10, -85, 143, 26, 142, 12, 151, 160, -28, + 10, -28, -45, -119, -120, -70, -71, -72, -73, -74, + -45, 10, -87, 143, 26, 142, 12, 151, 160, -28, 146, 143, -70, 144, 144, 45, 29, 78, 24, 144, - -85, 12, -28, -106, -119, -45, -75, -76, 10, 144, - 143, 147, 158, 10, -104, -105, -59, 41, -142, 144, - 142, -45, -59, 146, -85, -45, 143, 12, 147, 142, - -85, 143, + -87, 12, -28, -108, -121, -45, -75, -76, 10, 144, + 143, 147, 158, 10, -106, -107, -59, 41, -142, 144, + 142, -45, -59, 146, -87, -45, 143, 12, 147, 142, + -87, 143, } var yyDef = [...]int{ @@ -2345,14 +2345,14 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:269 + //line php5/php5.y:270 { yylex.(*Parser).rootNode = stmt.NewStmtList(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) } case 2: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:277 + //line php5/php5.y:278 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2360,13 +2360,13 @@ yydefault: } case 3: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:282 + //line php5/php5.y:283 { yyVAL.list = []node.Node{} } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:287 + //line php5/php5.y:288 { namePart := name.NewNamePart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2375,7 +2375,7 @@ yydefault: } case 5: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:294 + //line php5/php5.y:295 { namePart := name.NewNamePart(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2384,32 +2384,32 @@ yydefault: } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:304 + //line php5/php5.y:305 { // error yyVAL.node = nil } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:309 + //line php5/php5.y:310 { yyVAL.node = yyDollar[1].node } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:311 + //line php5/php5.y:312 { yyVAL.node = yyDollar[1].node } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:313 + //line php5/php5.y:314 { yyVAL.node = yyDollar[1].node } case 10: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:315 + //line php5/php5.y:316 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2417,7 +2417,7 @@ yydefault: } case 11: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:321 + //line php5/php5.y:322 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2429,7 +2429,7 @@ yydefault: } case 12: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:331 + //line php5/php5.y:332 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2441,7 +2441,7 @@ yydefault: } case 13: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:341 + //line php5/php5.y:342 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2449,7 +2449,7 @@ yydefault: } case 14: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:347 + //line php5/php5.y:348 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2457,7 +2457,7 @@ yydefault: } case 15: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:353 + //line php5/php5.y:354 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2469,7 +2469,7 @@ yydefault: } case 16: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:363 + //line php5/php5.y:364 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2481,25 +2481,25 @@ yydefault: } case 17: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:373 + //line php5/php5.y:374 { yyVAL.node = yyDollar[1].node } case 18: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:378 + //line php5/php5.y:379 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:380 + //line php5/php5.y:381 { yyVAL.list = []node.Node{yyDollar[1].node} } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:385 + //line php5/php5.y:386 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2511,7 +2511,7 @@ yydefault: } case 21: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:395 + //line php5/php5.y:396 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2526,7 +2526,7 @@ yydefault: } case 22: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:408 + //line php5/php5.y:409 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2538,7 +2538,7 @@ yydefault: } case 23: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:418 + //line php5/php5.y:419 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2553,19 +2553,19 @@ yydefault: } case 24: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:434 + //line php5/php5.y:435 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:436 + //line php5/php5.y:437 { yyVAL.list = []node.Node{yyDollar[1].node} } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:441 + //line php5/php5.y:442 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2577,7 +2577,7 @@ yydefault: } case 27: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:451 + //line php5/php5.y:452 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2592,7 +2592,7 @@ yydefault: } case 28: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:464 + //line php5/php5.y:465 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2604,7 +2604,7 @@ yydefault: } case 29: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:474 + //line php5/php5.y:475 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2619,19 +2619,19 @@ yydefault: } case 30: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:490 + //line php5/php5.y:491 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:492 + //line php5/php5.y:493 { yyVAL.list = []node.Node{yyDollar[1].node} } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:497 + //line php5/php5.y:498 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2643,7 +2643,7 @@ yydefault: } case 33: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:507 + //line php5/php5.y:508 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2658,7 +2658,7 @@ yydefault: } case 34: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:520 + //line php5/php5.y:521 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2670,7 +2670,7 @@ yydefault: } case 35: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:530 + //line php5/php5.y:531 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2685,7 +2685,7 @@ yydefault: } case 36: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:546 + //line php5/php5.y:547 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2703,7 +2703,7 @@ yydefault: } case 37: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:562 + //line php5/php5.y:563 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2721,7 +2721,7 @@ yydefault: } case 38: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:581 + //line php5/php5.y:582 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2729,38 +2729,38 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:587 + //line php5/php5.y:588 { yyVAL.list = []node.Node{} } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:593 + //line php5/php5.y:594 { // error yyVAL.node = nil } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:598 + //line php5/php5.y:599 { yyVAL.node = yyDollar[1].node } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:600 + //line php5/php5.y:601 { yyVAL.node = yyDollar[1].node } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:602 + //line php5/php5.y:603 { yyVAL.node = yyDollar[1].node } case 44: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:604 + //line php5/php5.y:605 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2768,13 +2768,13 @@ yydefault: } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:614 + //line php5/php5.y:615 { yyVAL.node = yyDollar[1].node } case 46: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:616 + //line php5/php5.y:617 { label := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2786,7 +2786,7 @@ yydefault: } case 47: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:629 + //line php5/php5.y:630 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2794,7 +2794,7 @@ yydefault: } case 48: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:635 + //line php5/php5.y:636 { yyVAL.node = stmt.NewIf(yyDollar[2].node, yyDollar[3].node, yyDollar[4].list, yyDollar[5].node) @@ -2810,7 +2810,7 @@ yydefault: } case 49: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:649 + //line php5/php5.y:650 { stmts := stmt.NewStmtList(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) @@ -2821,7 +2821,7 @@ yydefault: } case 50: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:658 + //line php5/php5.y:659 { if yyDollar[3].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltWhile(yyDollar[2].node, yyDollar[3].altSyntaxNode.node) @@ -2833,7 +2833,7 @@ yydefault: } case 51: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:668 + //line php5/php5.y:669 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2841,7 +2841,7 @@ yydefault: } case 52: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:674 + //line php5/php5.y:675 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltFor(yyDollar[3].list, yyDollar[5].list, yyDollar[7].list, yyDollar[9].altSyntaxNode.node) @@ -2853,7 +2853,7 @@ yydefault: } case 53: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:684 + //line php5/php5.y:685 { if yyDollar[3].nodesWithEndToken.endToken.Value == ";" { yyVAL.node = stmt.NewAltSwitch(yyDollar[2].node, yyDollar[3].nodesWithEndToken.nodes) @@ -2865,7 +2865,7 @@ yydefault: } case 54: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:694 + //line php5/php5.y:695 { yyVAL.node = stmt.NewBreak(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2873,7 +2873,7 @@ yydefault: } case 55: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:700 + //line php5/php5.y:701 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2881,7 +2881,7 @@ yydefault: } case 56: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:706 + //line php5/php5.y:707 { yyVAL.node = stmt.NewContinue(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2889,7 +2889,7 @@ yydefault: } case 57: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:712 + //line php5/php5.y:713 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2897,7 +2897,7 @@ yydefault: } case 58: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:718 + //line php5/php5.y:719 { yyVAL.node = stmt.NewReturn(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2905,7 +2905,7 @@ yydefault: } case 59: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:724 + //line php5/php5.y:725 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2913,7 +2913,7 @@ yydefault: } case 60: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:730 + //line php5/php5.y:731 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2921,7 +2921,7 @@ yydefault: } case 61: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:736 + //line php5/php5.y:737 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2929,7 +2929,7 @@ yydefault: } case 62: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:742 + //line php5/php5.y:743 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2937,7 +2937,7 @@ yydefault: } case 63: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:748 + //line php5/php5.y:749 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2945,7 +2945,7 @@ yydefault: } case 64: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:754 + //line php5/php5.y:755 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2953,7 +2953,7 @@ yydefault: } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:760 + //line php5/php5.y:761 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2961,7 +2961,7 @@ yydefault: } case 66: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:766 + //line php5/php5.y:767 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2969,7 +2969,7 @@ yydefault: } case 67: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:772 + //line php5/php5.y:773 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2977,7 +2977,7 @@ yydefault: } case 68: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:778 + //line php5/php5.y:779 { if yyDollar[6].foreachVariable.node == nil { if yyDollar[8].altSyntaxNode.isAlt { @@ -2997,7 +2997,7 @@ yydefault: } case 69: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:796 + //line php5/php5.y:797 { if yyDollar[6].foreachVariable.node == nil { if yyDollar[8].altSyntaxNode.isAlt { @@ -3017,7 +3017,7 @@ yydefault: } case 70: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:814 + //line php5/php5.y:815 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) @@ -3025,7 +3025,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:820 + //line php5/php5.y:821 { yyVAL.node = stmt.NewNop() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3033,7 +3033,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:826 + //line php5/php5.y:827 { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3047,7 +3047,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:838 + //line php5/php5.y:839 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -3055,7 +3055,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:844 + //line php5/php5.y:845 { label := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3067,13 +3067,13 @@ yydefault: } case 75: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:857 + //line php5/php5.y:858 { yyVAL.list = []node.Node{} } case 76: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:859 + //line php5/php5.y:860 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3091,13 +3091,13 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:877 + //line php5/php5.y:878 { yyVAL.node = nil } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:879 + //line php5/php5.y:880 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3105,31 +3105,31 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:888 + //line php5/php5.y:889 { yyVAL.list = yyDollar[1].list } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:890 + //line php5/php5.y:891 { yyVAL.list = []node.Node{} } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:895 + //line php5/php5.y:896 { yyVAL.list = []node.Node{yyDollar[1].node} } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:897 + //line php5/php5.y:898 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:902 + //line php5/php5.y:903 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3145,61 +3145,61 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:919 + //line php5/php5.y:920 { yyVAL.list = []node.Node{yyDollar[1].node} } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:921 + //line php5/php5.y:922 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:926 + //line php5/php5.y:927 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:931 + //line php5/php5.y:932 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:936 + //line php5/php5.y:937 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:941 + //line php5/php5.y:942 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:943 + //line php5/php5.y:944 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:948 + //line php5/php5.y:949 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:950 + //line php5/php5.y:951 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:955 + //line php5/php5.y:956 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3211,7 +3211,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:968 + //line php5/php5.y:969 { switch n := yyDollar[1].node.(type) { case *stmt.Class: @@ -3234,7 +3234,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:989 + //line php5/php5.y:990 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3246,7 +3246,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1003 + //line php5/php5.y:1004 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3254,7 +3254,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1009 + //line php5/php5.y:1010 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3266,7 +3266,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1019 + //line php5/php5.y:1020 { yyVAL.node = stmt.NewTrait(nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3274,7 +3274,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1025 + //line php5/php5.y:1026 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3286,85 +3286,85 @@ yydefault: } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1038 + //line php5/php5.y:1039 { yyVAL.node = nil } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1040 + //line php5/php5.y:1041 { yyVAL.node = yyDollar[2].node } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1045 + //line php5/php5.y:1046 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1050 + //line php5/php5.y:1051 { yyVAL.list = nil } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1052 + //line php5/php5.y:1053 { yyVAL.list = yyDollar[2].list } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1057 + //line php5/php5.y:1058 { yyVAL.list = nil } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1059 + //line php5/php5.y:1060 { yyVAL.list = yyDollar[2].list } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1064 + //line php5/php5.y:1065 { yyVAL.list = []node.Node{yyDollar[1].node} } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1066 + //line php5/php5.y:1067 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1071 + //line php5/php5.y:1072 { yyVAL.foreachVariable = foreachVariable{nil, false} } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1073 + //line php5/php5.y:1074 { yyVAL.foreachVariable = yyDollar[2].foreachVariable } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1078 + //line php5/php5.y:1079 { yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1080 + //line php5/php5.y:1081 { yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1082 + //line php5/php5.y:1083 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3373,39 +3373,39 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1092 + //line php5/php5.y:1093 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1094 + //line php5/php5.y:1095 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1103 + //line php5/php5.y:1104 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1105 + //line php5/php5.y:1106 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1114 + //line php5/php5.y:1115 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1116 + //line php5/php5.y:1117 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3413,7 +3413,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1126 + //line php5/php5.y:1127 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3427,7 +3427,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1138 + //line php5/php5.y:1139 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3441,37 +3441,37 @@ yydefault: } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1154 + //line php5/php5.y:1155 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1156 + //line php5/php5.y:1157 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[4].token} } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1158 + //line php5/php5.y:1159 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[4].token} } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1160 + //line php5/php5.y:1161 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[5].token} } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1166 + //line php5/php5.y:1167 { yyVAL.list = []node.Node{} } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1168 + //line php5/php5.y:1169 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) @@ -3480,7 +3480,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1175 + //line php5/php5.y:1176 { _default := stmt.NewDefault(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) @@ -3489,26 +3489,26 @@ yydefault: } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1192 + //line php5/php5.y:1193 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1194 + //line php5/php5.y:1195 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1204 + //line php5/php5.y:1205 { yyVAL.list = nil } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1206 + //line php5/php5.y:1207 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) @@ -3518,13 +3518,13 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1218 + //line php5/php5.y:1219 { yyVAL.list = nil } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1220 + //line php5/php5.y:1221 { stmts := stmt.NewStmtList(yyDollar[5].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[5].list)) @@ -3537,13 +3537,13 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1235 + //line php5/php5.y:1236 { yyVAL.node = nil } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1237 + //line php5/php5.y:1238 { yyVAL.node = stmt.NewElse(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3551,13 +3551,13 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1247 + //line php5/php5.y:1248 { yyVAL.node = nil } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1249 + //line php5/php5.y:1250 { stmts := stmt.NewStmtList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) @@ -3568,31 +3568,31 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1262 + //line php5/php5.y:1263 { yyVAL.list = yyDollar[1].list } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1264 + //line php5/php5.y:1265 { yyVAL.list = nil } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1269 + //line php5/php5.y:1270 { yyVAL.list = []node.Node{yyDollar[1].node} } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1271 + //line php5/php5.y:1272 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1276 + //line php5/php5.y:1277 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3620,7 +3620,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1302 + //line php5/php5.y:1303 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3648,13 +3648,13 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1332 + //line php5/php5.y:1333 { yyVAL.node = nil } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1334 + //line php5/php5.y:1335 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3662,7 +3662,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1340 + //line php5/php5.y:1341 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3670,47 +3670,54 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1346 + //line php5/php5.y:1347 { yyVAL.node = yyDollar[1].node } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1352 + //line php5/php5.y:1353 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{[]node.Node{}, yyDollar[2].token} + yyVAL.node = node.NewArgumentList(nil) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1354 + //line php5/php5.y:1360 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} + yyVAL.node = node.NewArgumentList(yyDollar[2].list) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1356 + //line php5/php5.y:1367 { arg := node.NewArgument(yyDollar[2].node, false, false) - yylex.(*Parser).positions.AddPosition(arg, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(arg, yylex.(*Parser).comments[yyDollar[2].node]) + yyVAL.node = node.NewArgumentList([]node.Node{arg}) - yyVAL.nodesWithEndToken = &nodesWithEndToken{[]node.Node{arg}, yyDollar[3].token} + // save position + yylex.(*Parser).positions.AddPosition(arg, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1368 + //line php5/php5.y:1380 { yyVAL.list = []node.Node{yyDollar[1].node} } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1370 + //line php5/php5.y:1382 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1375 + //line php5/php5.y:1387 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3718,7 +3725,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1381 + //line php5/php5.y:1393 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3726,7 +3733,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1387 + //line php5/php5.y:1399 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -3734,7 +3741,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1393 + //line php5/php5.y:1405 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3742,19 +3749,19 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1402 + //line php5/php5.y:1414 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1404 + //line php5/php5.y:1416 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1410 + //line php5/php5.y:1422 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3766,7 +3773,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1420 + //line php5/php5.y:1432 { yyVAL.node = expr.NewVariable(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3774,7 +3781,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1426 + //line php5/php5.y:1438 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3782,7 +3789,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1436 + //line php5/php5.y:1448 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3801,7 +3808,7 @@ yydefault: } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1453 + //line php5/php5.y:1465 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3820,7 +3827,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1470 + //line php5/php5.y:1482 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3839,7 +3846,7 @@ yydefault: } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1487 + //line php5/php5.y:1499 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3858,19 +3865,19 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1509 + //line php5/php5.y:1521 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1511 + //line php5/php5.y:1523 { yyVAL.list = []node.Node{} } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1517 + //line php5/php5.y:1529 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) @@ -3878,19 +3885,19 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1523 + //line php5/php5.y:1535 { yyVAL.node = yyDollar[1].node } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1525 + //line php5/php5.y:1537 { yyVAL.node = yyDollar[1].node } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1527 + //line php5/php5.y:1539 { name := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3902,7 +3909,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1540 + //line php5/php5.y:1552 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].nodesWithEndToken.nodes) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].nodesWithEndToken.endToken)) @@ -3910,67 +3917,67 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1549 + //line php5/php5.y:1561 { yyVAL.list = []node.Node{yyDollar[1].node} } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1551 + //line php5/php5.y:1563 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1556 + //line php5/php5.y:1568 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1558 + //line php5/php5.y:1570 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1563 + //line php5/php5.y:1575 { yyVAL.list = nil } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1565 + //line php5/php5.y:1577 { yyVAL.list = yyDollar[1].list } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1570 + //line php5/php5.y:1582 { yyVAL.list = []node.Node{yyDollar[1].node} } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1572 + //line php5/php5.y:1584 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1577 + //line php5/php5.y:1589 { yyVAL.node = yyDollar[1].node } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1579 + //line php5/php5.y:1591 { yyVAL.node = yyDollar[1].node } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1584 + //line php5/php5.y:1596 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) @@ -3978,19 +3985,19 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1593 + //line php5/php5.y:1605 { yyVAL.list = []node.Node{yyDollar[1].node} } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1595 + //line php5/php5.y:1607 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1600 + //line php5/php5.y:1612 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4002,13 +4009,13 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1610 + //line php5/php5.y:1622 { yyVAL.node = yyDollar[1].node } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1615 + //line php5/php5.y:1627 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4020,7 +4027,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1628 + //line php5/php5.y:1640 { alias := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -4032,7 +4039,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1638 + //line php5/php5.y:1650 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4040,37 +4047,37 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1647 + //line php5/php5.y:1659 { yyVAL.node = nil } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1649 + //line php5/php5.y:1661 { yyVAL.node = yyDollar[1].node } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1654 + //line php5/php5.y:1666 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1656 + //line php5/php5.y:1668 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1661 + //line php5/php5.y:1673 { yyVAL.list = yyDollar[1].list } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1663 + //line php5/php5.y:1675 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4080,45 +4087,29 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1674 + //line php5/php5.y:1686 { yyVAL.list = nil } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1676 + //line php5/php5.y:1688 { yyVAL.list = yyDollar[1].list } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1681 + //line php5/php5.y:1693 { yyVAL.list = []node.Node{yyDollar[1].node} } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1683 + //line php5/php5.y:1695 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 204: - yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1688 - { - yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - } - case 205: - yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1694 - { - yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - } - case 206: yyDollar = yyS[yypt-1 : yypt+1] //line php5/php5.y:1700 { @@ -4126,7 +4117,7 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } - case 207: + case 205: yyDollar = yyS[yypt-1 : yypt+1] //line php5/php5.y:1706 { @@ -4134,7 +4125,7 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } - case 208: + case 206: yyDollar = yyS[yypt-1 : yypt+1] //line php5/php5.y:1712 { @@ -4142,7 +4133,7 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } - case 209: + case 207: yyDollar = yyS[yypt-1 : yypt+1] //line php5/php5.y:1718 { @@ -4150,9 +4141,25 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } + case 208: + yyDollar = yyS[yypt-1 : yypt+1] + //line php5/php5.y:1724 + { + yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + } + case 209: + yyDollar = yyS[yypt-1 : yypt+1] + //line php5/php5.y:1730 + { + yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1727 + //line php5/php5.y:1739 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4170,7 +4177,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1743 + //line php5/php5.y:1755 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4188,7 +4195,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1759 + //line php5/php5.y:1771 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4206,7 +4213,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1775 + //line php5/php5.y:1787 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4224,7 +4231,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1794 + //line php5/php5.y:1806 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4241,7 +4248,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1809 + //line php5/php5.y:1821 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -4257,55 +4264,55 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1826 + //line php5/php5.y:1838 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1828 + //line php5/php5.y:1840 { yyVAL.list = []node.Node{yyDollar[1].node} } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1834 + //line php5/php5.y:1846 { yyVAL.list = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1836 + //line php5/php5.y:1848 { yyVAL.list = yyDollar[1].list } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1841 + //line php5/php5.y:1853 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1843 + //line php5/php5.y:1855 { yyVAL.list = []node.Node{yyDollar[1].node} } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1848 + //line php5/php5.y:1860 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1850 + //line php5/php5.y:1862 { yyVAL.list = yyDollar[1].list } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1855 + //line php5/php5.y:1867 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -4314,7 +4321,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1862 + //line php5/php5.y:1874 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -4323,41 +4330,42 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1872 + //line php5/php5.y:1884 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1874 + //line php5/php5.y:1886 { yyVAL.list = yyDollar[1].list } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1876 + //line php5/php5.y:1888 { yyVAL.list = yyDollar[1].list } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1881 + //line php5/php5.y:1893 { yyVAL.list = nil } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1883 + //line php5/php5.y:1895 { yyVAL.list = yyDollar[1].list } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1888 + //line php5/php5.y:1900 { - if yyDollar[3].nodesWithEndToken != nil { - yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].nodesWithEndToken.nodes) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].nodesWithEndToken.endToken)) + + if yyDollar[3].node != nil { + yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) } else { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4367,7 +4375,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1903 + //line php5/php5.y:1916 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -4379,7 +4387,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1913 + //line php5/php5.y:1926 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4387,7 +4395,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1919 + //line php5/php5.y:1932 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4395,14 +4403,16 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1925 + //line php5/php5.y:1938 { - _new := expr.NewNew(yyDollar[5].node, nil) - yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[5].node)) + var _new *expr.New - if yyDollar[6].nodesWithEndToken != nil { - _new = expr.NewNew(yyDollar[5].node, yyDollar[6].nodesWithEndToken.nodes) - yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[4].token, yyDollar[6].nodesWithEndToken.endToken)) + if yyDollar[6].node != nil { + _new = expr.NewNew(yyDollar[5].node, yyDollar[6].node.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[6].node)) + } else { + _new = expr.NewNew(yyDollar[5].node, nil) + yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[5].node)) } yylex.(*Parser).comments.AddComments(_new, yylex.(*Parser).comments[yyDollar[1].node]) @@ -4412,7 +4422,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1940 + //line php5/php5.y:1955 { yyVAL.node = expr.NewClone(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4420,7 +4430,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1946 + //line php5/php5.y:1961 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4428,7 +4438,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1952 + //line php5/php5.y:1967 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4436,7 +4446,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1958 + //line php5/php5.y:1973 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4444,7 +4454,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1964 + //line php5/php5.y:1979 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4452,7 +4462,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1970 + //line php5/php5.y:1985 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4460,7 +4470,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1976 + //line php5/php5.y:1991 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4468,7 +4478,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1982 + //line php5/php5.y:1997 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4476,7 +4486,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1988 + //line php5/php5.y:2003 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4484,7 +4494,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1994 + //line php5/php5.y:2009 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4492,7 +4502,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2000 + //line php5/php5.y:2015 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4500,7 +4510,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2006 + //line php5/php5.y:2021 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4508,7 +4518,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2012 + //line php5/php5.y:2027 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4516,7 +4526,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2018 + //line php5/php5.y:2033 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4524,7 +4534,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2024 + //line php5/php5.y:2039 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4532,7 +4542,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2030 + //line php5/php5.y:2045 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4540,7 +4550,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2036 + //line php5/php5.y:2051 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4548,7 +4558,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2042 + //line php5/php5.y:2057 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4556,7 +4566,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2048 + //line php5/php5.y:2063 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4564,7 +4574,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2054 + //line php5/php5.y:2069 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4572,7 +4582,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2060 + //line php5/php5.y:2075 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4580,7 +4590,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2066 + //line php5/php5.y:2081 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4588,7 +4598,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2072 + //line php5/php5.y:2087 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4596,7 +4606,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2078 + //line php5/php5.y:2093 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4604,7 +4614,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2084 + //line php5/php5.y:2099 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4612,7 +4622,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2090 + //line php5/php5.y:2105 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4620,7 +4630,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2096 + //line php5/php5.y:2111 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4628,7 +4638,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2102 + //line php5/php5.y:2117 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4636,7 +4646,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2108 + //line php5/php5.y:2123 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4644,7 +4654,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2114 + //line php5/php5.y:2129 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4652,7 +4662,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2120 + //line php5/php5.y:2135 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4660,7 +4670,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2126 + //line php5/php5.y:2141 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4668,7 +4678,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2132 + //line php5/php5.y:2147 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4676,7 +4686,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2138 + //line php5/php5.y:2153 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4684,7 +4694,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2144 + //line php5/php5.y:2159 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4692,7 +4702,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2150 + //line php5/php5.y:2165 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4700,7 +4710,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2156 + //line php5/php5.y:2171 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4708,7 +4718,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2162 + //line php5/php5.y:2177 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4716,7 +4726,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2168 + //line php5/php5.y:2183 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4724,7 +4734,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2174 + //line php5/php5.y:2189 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4732,7 +4742,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2180 + //line php5/php5.y:2195 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4740,7 +4750,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2186 + //line php5/php5.y:2201 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4748,7 +4758,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2192 + //line php5/php5.y:2207 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4756,7 +4766,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2198 + //line php5/php5.y:2213 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4764,7 +4774,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2204 + //line php5/php5.y:2219 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4772,7 +4782,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2210 + //line php5/php5.y:2225 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4780,7 +4790,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2216 + //line php5/php5.y:2231 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4788,19 +4798,19 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2222 + //line php5/php5.y:2237 { yyVAL.node = yyDollar[1].node } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2224 + //line php5/php5.y:2239 { yyVAL.node = yyDollar[1].node } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2226 + //line php5/php5.y:2241 { yyVAL.node = yyDollar[2].node @@ -4828,7 +4838,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2252 + //line php5/php5.y:2267 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -4836,7 +4846,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2258 + //line php5/php5.y:2273 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4844,13 +4854,13 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2264 + //line php5/php5.y:2279 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2266 + //line php5/php5.y:2281 { yyVAL.node = cast.NewInt(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4858,7 +4868,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2272 + //line php5/php5.y:2287 { yyVAL.node = cast.NewDouble(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4866,7 +4876,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2278 + //line php5/php5.y:2293 { yyVAL.node = cast.NewString(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4874,7 +4884,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2284 + //line php5/php5.y:2299 { yyVAL.node = cast.NewArray(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4882,7 +4892,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2290 + //line php5/php5.y:2305 { yyVAL.node = cast.NewObject(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4890,7 +4900,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2296 + //line php5/php5.y:2311 { yyVAL.node = cast.NewBool(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4898,7 +4908,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2302 + //line php5/php5.y:2317 { yyVAL.node = cast.NewUnset(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4906,7 +4916,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2308 + //line php5/php5.y:2323 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -4918,7 +4928,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2318 + //line php5/php5.y:2333 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4926,25 +4936,25 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2324 + //line php5/php5.y:2339 { yyVAL.node = yyDollar[1].node } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2326 + //line php5/php5.y:2341 { yyVAL.node = yyDollar[1].node } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2328 + //line php5/php5.y:2343 { yyVAL.node = yyDollar[1].node } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2330 + //line php5/php5.y:2345 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -4952,7 +4962,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2336 + //line php5/php5.y:2351 { yyVAL.node = expr.NewPrint(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4960,7 +4970,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2342 + //line php5/php5.y:2357 { yyVAL.node = expr.NewYield(nil, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4968,7 +4978,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:2348 + //line php5/php5.y:2363 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].list, nil, yyDollar[8].list, false, yyDollar[2].boolWithToken.value, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) @@ -4977,7 +4987,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:2355 + //line php5/php5.y:2370 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, nil, yyDollar[9].list, true, yyDollar[3].boolWithToken.value, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) @@ -4986,7 +4996,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2365 + //line php5/php5.y:2380 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4994,7 +5004,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2371 + //line php5/php5.y:2386 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5002,7 +5012,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2377 + //line php5/php5.y:2392 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5010,7 +5020,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2383 + //line php5/php5.y:2398 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5018,7 +5028,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2392 + //line php5/php5.y:2407 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5026,7 +5036,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2398 + //line php5/php5.y:2413 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5034,7 +5044,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2404 + //line php5/php5.y:2419 { str := scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(str, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5046,7 +5056,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2414 + //line php5/php5.y:2429 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5054,7 +5064,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2423 + //line php5/php5.y:2438 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5062,7 +5072,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2429 + //line php5/php5.y:2444 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5070,25 +5080,25 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2438 + //line php5/php5.y:2453 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2443 + //line php5/php5.y:2458 { yyVAL.list = []node.Node{} } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2445 + //line php5/php5.y:2460 { yyVAL.list = yyDollar[3].list } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2450 + //line php5/php5.y:2465 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5106,7 +5116,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2466 + //line php5/php5.y:2481 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -5124,7 +5134,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2482 + //line php5/php5.y:2497 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5142,7 +5152,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2498 + //line php5/php5.y:2513 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5160,83 +5170,83 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2517 + //line php5/php5.y:2532 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) - yyVAL.node = expr.NewFunctionCall(name, yyDollar[2].nodesWithEndToken.nodes) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(name, yyDollar[2].nodesWithEndToken.endToken)) + yyVAL.node = expr.NewFunctionCall(name, yyDollar[2].node.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(name, yyDollar[2].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[name]) } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2527 + //line php5/php5.y:2542 { funcName := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) yylex.(*Parser).comments.AddComments(funcName, yyDollar[1].token.Comments()) - yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[4].nodesWithEndToken.nodes) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(funcName, yyDollar[4].nodesWithEndToken.endToken)) + yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[4].node.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[4].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[funcName]) } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2537 + //line php5/php5.y:2552 { funcName := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) yylex.(*Parser).comments.AddComments(funcName, yyDollar[1].token.Comments()) - yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[3].nodesWithEndToken.nodes) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(funcName, yyDollar[3].nodesWithEndToken.endToken)) + yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[3].node.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[3].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[funcName]) } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2547 + //line php5/php5.y:2562 { - yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) + yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2553 + //line php5/php5.y:2568 { - yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) + yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2559 + //line php5/php5.y:2574 { - yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) + yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2565 + //line php5/php5.y:2580 { - yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) + yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2571 + //line php5/php5.y:2586 { - yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].nodesWithEndToken.nodes) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].nodesWithEndToken.endToken)) + yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2580 + //line php5/php5.y:2595 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5244,7 +5254,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2586 + //line php5/php5.y:2601 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5252,7 +5262,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2592 + //line php5/php5.y:2607 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5260,7 +5270,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2598 + //line php5/php5.y:2613 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5268,7 +5278,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2607 + //line php5/php5.y:2622 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5276,7 +5286,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2613 + //line php5/php5.y:2628 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5284,7 +5294,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2619 + //line php5/php5.y:2634 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5292,19 +5302,19 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2628 + //line php5/php5.y:2643 { yyVAL.node = yyDollar[1].node } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2630 + //line php5/php5.y:2645 { yyVAL.node = yyDollar[1].node } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2635 + //line php5/php5.y:2650 { yyVAL.node = yyDollar[1].node @@ -5342,79 +5352,79 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2671 + //line php5/php5.y:2686 { yyVAL.node = yyDollar[1].node } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2677 + //line php5/php5.y:2692 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2679 + //line php5/php5.y:2694 { yyVAL.list = []node.Node{} } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2685 + //line php5/php5.y:2700 { yyVAL.list = yyDollar[2].list } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2690 + //line php5/php5.y:2705 { yyVAL.node = nil } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2692 + //line php5/php5.y:2707 { yyVAL.node = nil } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2694 + //line php5/php5.y:2709 { yyVAL.node = yyDollar[1].node } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2699 + //line php5/php5.y:2714 { yyVAL.list = []node.Node{} } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2701 + //line php5/php5.y:2716 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2703 + //line php5/php5.y:2718 { yyVAL.list = yyDollar[1].list } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2708 + //line php5/php5.y:2723 { - yyVAL.nodesWithEndToken = nil + yyVAL.node = nil } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2710 + //line php5/php5.y:2725 { - yyVAL.nodesWithEndToken = yyDollar[1].nodesWithEndToken + yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2715 + //line php5/php5.y:2730 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5422,7 +5432,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2721 + //line php5/php5.y:2736 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5430,7 +5440,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2727 + //line php5/php5.y:2742 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5438,7 +5448,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2733 + //line php5/php5.y:2748 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5446,7 +5456,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2739 + //line php5/php5.y:2754 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5454,7 +5464,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2745 + //line php5/php5.y:2760 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5462,7 +5472,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2751 + //line php5/php5.y:2766 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5470,7 +5480,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2757 + //line php5/php5.y:2772 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5478,7 +5488,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2763 + //line php5/php5.y:2778 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5486,7 +5496,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2769 + //line php5/php5.y:2784 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5494,7 +5504,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2775 + //line php5/php5.y:2790 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5506,7 +5516,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2785 + //line php5/php5.y:2800 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -5514,7 +5524,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2794 + //line php5/php5.y:2809 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5526,25 +5536,25 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2807 + //line php5/php5.y:2822 { yyVAL.node = yyDollar[1].node } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2812 + //line php5/php5.y:2827 { yyVAL.node = yyDollar[1].node } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2814 + //line php5/php5.y:2829 { yyVAL.node = yyDollar[1].node } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2816 + //line php5/php5.y:2831 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5556,7 +5566,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2826 + //line php5/php5.y:2841 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5568,7 +5578,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2836 + //line php5/php5.y:2851 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5580,7 +5590,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2846 + //line php5/php5.y:2861 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5588,7 +5598,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2852 + //line php5/php5.y:2867 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5596,13 +5606,13 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2858 + //line php5/php5.y:2873 { yyVAL.node = yyDollar[1].node } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2860 + //line php5/php5.y:2875 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5610,13 +5620,13 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2866 + //line php5/php5.y:2881 { yyVAL.node = yyDollar[1].node } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2871 + //line php5/php5.y:2886 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5624,7 +5634,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2877 + //line php5/php5.y:2892 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5632,7 +5642,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2883 + //line php5/php5.y:2898 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5640,7 +5650,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2889 + //line php5/php5.y:2904 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5648,7 +5658,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2895 + //line php5/php5.y:2910 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5656,7 +5666,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2901 + //line php5/php5.y:2916 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5664,7 +5674,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2907 + //line php5/php5.y:2922 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5672,7 +5682,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2913 + //line php5/php5.y:2928 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5680,7 +5690,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2919 + //line php5/php5.y:2934 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5688,7 +5698,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2925 + //line php5/php5.y:2940 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5696,7 +5706,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2931 + //line php5/php5.y:2946 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5704,7 +5714,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2937 + //line php5/php5.y:2952 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5712,7 +5722,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2943 + //line php5/php5.y:2958 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5720,7 +5730,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2949 + //line php5/php5.y:2964 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5728,7 +5738,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2955 + //line php5/php5.y:2970 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5736,7 +5746,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2961 + //line php5/php5.y:2976 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5744,7 +5754,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2967 + //line php5/php5.y:2982 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5752,7 +5762,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2973 + //line php5/php5.y:2988 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5760,7 +5770,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2979 + //line php5/php5.y:2994 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5768,7 +5778,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2985 + //line php5/php5.y:3000 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5776,7 +5786,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2991 + //line php5/php5.y:3006 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5784,7 +5794,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2997 + //line php5/php5.y:3012 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5792,7 +5802,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3003 + //line php5/php5.y:3018 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5800,7 +5810,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3009 + //line php5/php5.y:3024 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5808,7 +5818,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3015 + //line php5/php5.y:3030 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5816,7 +5826,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3021 + //line php5/php5.y:3036 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5824,7 +5834,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3027 + //line php5/php5.y:3042 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5832,7 +5842,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3033 + //line php5/php5.y:3048 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5840,7 +5850,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3039 + //line php5/php5.y:3054 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5848,7 +5858,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3045 + //line php5/php5.y:3060 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -5856,7 +5866,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3051 + //line php5/php5.y:3066 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5864,7 +5874,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3057 + //line php5/php5.y:3072 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5872,19 +5882,19 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3063 + //line php5/php5.y:3078 { yyVAL.node = yyDollar[2].node } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3068 + //line php5/php5.y:3083 { yyVAL.node = yyDollar[1].node } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3070 + //line php5/php5.y:3085 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5896,7 +5906,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3080 + //line php5/php5.y:3095 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5908,7 +5918,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3090 + //line php5/php5.y:3105 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5920,7 +5930,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3103 + //line php5/php5.y:3118 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5932,25 +5942,25 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3113 + //line php5/php5.y:3128 { yyVAL.node = yyDollar[1].node } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3115 + //line php5/php5.y:3130 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3117 + //line php5/php5.y:3132 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3119 + //line php5/php5.y:3134 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5958,7 +5968,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3125 + //line php5/php5.y:3140 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5966,7 +5976,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3131 + //line php5/php5.y:3146 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5974,19 +5984,19 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3140 + //line php5/php5.y:3155 { yyVAL.list = nil } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3142 + //line php5/php5.y:3157 { yyVAL.list = yyDollar[1].list } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3152 + //line php5/php5.y:3167 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -5996,7 +6006,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3160 + //line php5/php5.y:3175 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6006,7 +6016,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3168 + //line php5/php5.y:3183 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6016,7 +6026,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3176 + //line php5/php5.y:3191 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6026,49 +6036,49 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3187 + //line php5/php5.y:3202 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3189 + //line php5/php5.y:3204 { yyVAL.node = yyDollar[1].node } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3194 + //line php5/php5.y:3209 { yyVAL.node = yyDollar[2].node } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3196 + //line php5/php5.y:3211 { yyVAL.node = yyDollar[2].node } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3202 + //line php5/php5.y:3217 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3208 + //line php5/php5.y:3223 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3213 + //line php5/php5.y:3228 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3218 + //line php5/php5.y:3233 { yyVAL.node = yyDollar[1].node @@ -6123,25 +6133,25 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3271 + //line php5/php5.y:3286 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3276 + //line php5/php5.y:3291 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3278 + //line php5/php5.y:3293 { yyVAL.list = []node.Node{} } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3284 + //line php5/php5.y:3299 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -6152,7 +6162,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3296 + //line php5/php5.y:3311 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6161,7 +6171,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3303 + //line php5/php5.y:3318 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6170,38 +6180,38 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3313 + //line php5/php5.y:3328 { - yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].nodesWithEndToken.nodes) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].nodesWithEndToken.nodes, yyDollar[1].nodesWithEndToken.endToken)) + yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3321 + //line php5/php5.y:3336 { yyVAL.list = []node.Node{yyDollar[1].node} } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3323 + //line php5/php5.y:3338 { yyVAL.list = yyDollar[1].list } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3325 + //line php5/php5.y:3340 { yyVAL.list = nil } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3330 + //line php5/php5.y:3345 { yyVAL.node = yyDollar[1].node } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3332 + //line php5/php5.y:3347 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6213,7 +6223,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3345 + //line php5/php5.y:3360 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6221,7 +6231,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3351 + //line php5/php5.y:3366 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6229,13 +6239,13 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3361 + //line php5/php5.y:3376 { yyVAL.node = yyDollar[1].node } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3366 + //line php5/php5.y:3381 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6243,7 +6253,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3372 + //line php5/php5.y:3387 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6251,31 +6261,31 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3380 + //line php5/php5.y:3395 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3381 + //line php5/php5.y:3396 { yyVAL.node = yyDollar[1].node } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3382 + //line php5/php5.y:3397 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3388 + //line php5/php5.y:3403 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3390 + //line php5/php5.y:3405 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6287,13 +6297,13 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3400 + //line php5/php5.y:3415 { yyVAL.node = yyDollar[1].node } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3405 + //line php5/php5.y:3420 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6301,7 +6311,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3411 + //line php5/php5.y:3426 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6309,13 +6319,13 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3417 + //line php5/php5.y:3432 { yyVAL.node = yyDollar[1].node } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3423 + //line php5/php5.y:3438 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6327,7 +6337,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3433 + //line php5/php5.y:3448 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6335,25 +6345,25 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3442 + //line php5/php5.y:3457 { yyVAL.node = nil } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3444 + //line php5/php5.y:3459 { yyVAL.node = yyDollar[1].node } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3450 + //line php5/php5.y:3465 { yyVAL.list = yyDollar[1].list } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3452 + //line php5/php5.y:3467 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6362,7 +6372,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3462 + //line php5/php5.y:3477 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6371,7 +6381,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3469 + //line php5/php5.y:3484 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6380,7 +6390,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3476 + //line php5/php5.y:3491 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6389,7 +6399,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3486 + //line php5/php5.y:3501 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6397,13 +6407,13 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3492 + //line php5/php5.y:3507 { yyVAL.node = yyDollar[2].node } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3497 + //line php5/php5.y:3512 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6413,7 +6423,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3505 + //line php5/php5.y:3520 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6427,13 +6437,13 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3520 + //line php5/php5.y:3535 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3522 + //line php5/php5.y:3537 { if yyDollar[1].node == nil { yyVAL.list = []node.Node{} @@ -6443,7 +6453,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3534 + //line php5/php5.y:3549 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6451,7 +6461,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3540 + //line php5/php5.y:3555 { item := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6463,25 +6473,25 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3550 + //line php5/php5.y:3565 { yyVAL.node = nil } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3556 + //line php5/php5.y:3571 { yyVAL.list = []node.Node{} } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3558 + //line php5/php5.y:3573 { yyVAL.list = yyDollar[1].list } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3563 + //line php5/php5.y:3578 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -6491,7 +6501,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3571 + //line php5/php5.y:3586 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6501,7 +6511,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3579 + //line php5/php5.y:3594 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6511,7 +6521,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3587 + //line php5/php5.y:3602 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6521,7 +6531,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3595 + //line php5/php5.y:3610 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[6].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) @@ -6531,7 +6541,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3603 + //line php5/php5.y:3618 { arrayItem := expr.NewArrayItem(nil, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) @@ -6541,7 +6551,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3611 + //line php5/php5.y:3626 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -6551,7 +6561,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3619 + //line php5/php5.y:3634 { arrayItem := expr.NewArrayItem(nil, yyDollar[2].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6561,13 +6571,13 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3630 + //line php5/php5.y:3645 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3632 + //line php5/php5.y:3647 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6576,13 +6586,13 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3639 + //line php5/php5.y:3654 { yyVAL.list = []node.Node{yyDollar[1].node} } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3641 + //line php5/php5.y:3656 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6591,7 +6601,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3651 + //line php5/php5.y:3666 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6603,7 +6613,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3661 + //line php5/php5.y:3676 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6618,7 +6628,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3674 + //line php5/php5.y:3689 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6636,7 +6646,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3690 + //line php5/php5.y:3705 { yyVAL.node = yyDollar[2].node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6644,7 +6654,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3696 + //line php5/php5.y:3711 { identifier := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6659,13 +6669,13 @@ yydefault: } case 500: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3710 + //line php5/php5.y:3725 { yyVAL.node = yyDollar[2].node } case 501: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3715 + //line php5/php5.y:3730 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6673,7 +6683,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3721 + //line php5/php5.y:3736 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -6687,7 +6697,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3733 + //line php5/php5.y:3748 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6699,7 +6709,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3746 + //line php5/php5.y:3761 { yyVAL.node = expr.NewIsset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6707,7 +6717,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3752 + //line php5/php5.y:3767 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6715,7 +6725,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3758 + //line php5/php5.y:3773 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6723,7 +6733,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3764 + //line php5/php5.y:3779 { yyVAL.node = expr.NewInclude(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6731,7 +6741,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3770 + //line php5/php5.y:3785 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6739,7 +6749,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3776 + //line php5/php5.y:3791 { yyVAL.node = expr.NewEval(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6747,7 +6757,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3782 + //line php5/php5.y:3797 { yyVAL.node = expr.NewRequire(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6755,7 +6765,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3788 + //line php5/php5.y:3803 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6763,31 +6773,31 @@ yydefault: } case 512: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3797 + //line php5/php5.y:3812 { yyVAL.list = []node.Node{yyDollar[1].node} } case 513: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3799 + //line php5/php5.y:3814 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 514: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3804 + //line php5/php5.y:3819 { yyVAL.node = yyDollar[1].node } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3806 + //line php5/php5.y:3821 { yyVAL.node = yyDollar[1].node } case 516: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3811 + //line php5/php5.y:3826 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6799,7 +6809,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3821 + //line php5/php5.y:3836 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6811,7 +6821,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3834 + //line php5/php5.y:3849 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6823,7 +6833,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3847 + //line php5/php5.y:3862 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) diff --git a/php5/php5.y b/php5/php5.y index 8d620e6..fe82192 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -242,6 +242,7 @@ import ( %type trait_use_statement function_call_parameter trait_adaptation_statement trait_precedence trait_alias %type trait_method_reference_fully_qualified trait_method_reference trait_modifiers member_modifier method %type static_scalar_value static_operation +%type ctor_arguments function_call_parameter_list %type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations %type inner_statement_list global_var_list static_var_list encaps_list isset_variables non_empty_array_pair_list @@ -258,7 +259,7 @@ import ( %type simple_indirect_reference %type foreach_variable foreach_optional_arg -%type ctor_arguments function_call_parameter_list switch_case_list method_body trait_adaptations +%type switch_case_list method_body trait_adaptations %type is_reference is_variadic %type while_statement for_statement foreach_statement @@ -1349,16 +1350,27 @@ optional_class_type: function_call_parameter_list: '(' ')' - { $$ = &nodesWithEndToken{[]node.Node{}, $2} } + { + $$ = node.NewArgumentList(nil) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + } | '(' non_empty_function_call_parameter_list ')' - { $$ = &nodesWithEndToken{$2, $3} } + { + $$ = node.NewArgumentList($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + } | '(' yield_expr ')' { arg := node.NewArgument($2, false, false) - yylex.(*Parser).positions.AddPosition(arg, yylex.(*Parser).positionBuilder.NewNodePosition($2)) - yylex.(*Parser).comments.AddComments(arg, yylex.(*Parser).comments[$2]) + $$ = node.NewArgumentList([]node.Node{arg}) - $$ = &nodesWithEndToken{[]node.Node{arg}, $3} + // save position + yylex.(*Parser).positions.AddPosition(arg, yylex.(*Parser).positionBuilder.NewNodePosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) } ; @@ -1886,9 +1898,10 @@ instance_call: new_expr: T_NEW class_name_reference ctor_arguments { + if $3 != nil { - $$ = expr.NewNew($2, $3.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3.endToken)) + $$ = expr.NewNew($2, $3.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) } else { $$ = expr.NewNew($2, nil) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) @@ -1923,12 +1936,14 @@ expr_without_variable: } | variable '=' '&' T_NEW class_name_reference ctor_arguments { - _new := expr.NewNew($5, nil) - yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $5)) + var _new *expr.New if $6 != nil { - _new = expr.NewNew($5, $6.nodes) - yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokensPosition($4, $6.endToken)) + _new = expr.NewNew($5, $6.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) + } else { + _new = expr.NewNew($5, nil) + yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $5)) } yylex.(*Parser).comments.AddComments(_new, yylex.(*Parser).comments[$1]) @@ -2519,8 +2534,8 @@ function_call: yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($1)) - $$ = expr.NewFunctionCall(name, $2.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(name, $2.endToken)) + $$ = expr.NewFunctionCall(name, $2.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition(name, $2)) yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[name]) } | T_NAMESPACE T_NS_SEPARATOR namespace_name function_call_parameter_list @@ -2529,8 +2544,8 @@ function_call: yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) yylex.(*Parser).comments.AddComments(funcName, $1.Comments()) - $$ = expr.NewFunctionCall(funcName, $4.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(funcName, $4.endToken)) + $$ = expr.NewFunctionCall(funcName, $4.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $4)) yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[funcName]) } | T_NS_SEPARATOR namespace_name function_call_parameter_list @@ -2539,38 +2554,38 @@ function_call: yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) yylex.(*Parser).comments.AddComments(funcName, $1.Comments()) - $$ = expr.NewFunctionCall(funcName, $3.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(funcName, $3.endToken)) + $$ = expr.NewFunctionCall(funcName, $3.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $3)) yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[funcName]) } | class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list { - $$ = expr.NewStaticCall($1, $3, $4.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken)) + $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) } | class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list { - $$ = expr.NewStaticCall($1, $3, $4.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken)) + $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list { - $$ = expr.NewStaticCall($1, $3, $4.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken)) + $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list { - $$ = expr.NewStaticCall($1, $3, $4.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken)) + $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) } | variable_without_objects function_call_parameter_list { - $$ = expr.NewFunctionCall($1, $2.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2.endToken)) + $$ = expr.NewFunctionCall($1, $2.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) } ; @@ -3311,8 +3326,8 @@ array_method_dereference: method: function_call_parameter_list { - $$ = expr.NewMethodCall(nil, nil, $1.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1.nodes, $1.endToken)) + $$ = expr.NewMethodCall(nil, nil, $1.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) } ; diff --git a/php5/php5_test.go b/php5/php5_test.go index 4dccea5..093aa6a 100644 --- a/php5/php5_test.go +++ b/php5/php5_test.go @@ -434,18 +434,22 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Expr: &expr.FunctionCall{ Function: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, &stmt.Expression{ Expr: &expr.FunctionCall{ Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, @@ -453,9 +457,11 @@ func TestPhp5(t *testing.T) { Expr: &expr.MethodCall{ Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, Method: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, @@ -463,9 +469,11 @@ func TestPhp5(t *testing.T) { Expr: &expr.StaticCall{ Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, @@ -473,18 +481,22 @@ func TestPhp5(t *testing.T) { Expr: &expr.StaticCall{ Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, &stmt.Expression{ Expr: &expr.New{ Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, @@ -665,9 +677,9 @@ func TestPhp5(t *testing.T) { Parts: []node.Node{ &scalar.EncapsedStringPart{Value: "test "}, &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Method: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{}, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Method: &node.Identifier{Value: "bar"}, + ArgumentList: &node.ArgumentList{}, }, }, }, @@ -1134,7 +1146,7 @@ func TestPhp5(t *testing.T) { &name.NamePart{Value: "foo"}, }, }, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, }, }, @@ -2081,7 +2093,7 @@ func TestPhp5(t *testing.T) { &name.NamePart{Value: "foo"}, }, }, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2091,11 +2103,13 @@ func TestPhp5(t *testing.T) { &name.NamePart{Value: "foo"}, }, }, - Arguments: []node.Node{ - &node.Argument{ - Variadic: false, - IsReference: true, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + Variadic: false, + IsReference: true, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, }, }, }, @@ -2107,12 +2121,14 @@ func TestPhp5(t *testing.T) { &name.NamePart{Value: "foo"}, }, }, - Arguments: []node.Node{ - &node.Argument{ - Variadic: false, - IsReference: false, - Expr: &expr.ShortArray{ - Items: []node.Node{}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + Variadic: false, + IsReference: false, + Expr: &expr.ShortArray{ + Items: []node.Node{}, + }, }, }, }, @@ -2121,12 +2137,14 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Expr: &expr.FunctionCall{ Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Arguments: []node.Node{ - &node.Argument{ - Variadic: false, - IsReference: false, - Expr: &expr.Yield{ - Value: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + Variadic: false, + IsReference: false, + Expr: &expr.Yield{ + Value: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, }, }, }, @@ -2281,9 +2299,9 @@ func TestPhp5(t *testing.T) { }, &stmt.Expression{ Expr: &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Method: &node.Identifier{Value: "foo"}, - Arguments: []node.Node{}, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Method: &node.Identifier{Value: "foo"}, + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2302,7 +2320,7 @@ func TestPhp5(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2312,7 +2330,7 @@ func TestPhp5(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2346,8 +2364,8 @@ func TestPhp5(t *testing.T) { }, Property: &node.Identifier{Value: "bar"}, }, - Method: &node.Identifier{Value: "baz"}, - Arguments: []node.Node{}, + Method: &node.Identifier{Value: "baz"}, + ArgumentList: &node.ArgumentList{}, }, Property: &node.Identifier{Value: "quux"}, }, @@ -2358,9 +2376,9 @@ func TestPhp5(t *testing.T) { Expr: &expr.ArrayDimFetch{ Variable: &expr.ArrayDimFetch{ Variable: &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Method: &node.Identifier{Value: "foo"}, - Arguments: []node.Node{}, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Method: &node.Identifier{Value: "foo"}, + ArgumentList: &node.ArgumentList{}, }, Dim: &scalar.Lnumber{Value: "1"}, }, @@ -2424,8 +2442,8 @@ func TestPhp5(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{}, + Call: &node.Identifier{Value: "bar"}, + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2435,8 +2453,8 @@ func TestPhp5(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{}, + Call: &node.Identifier{Value: "bar"}, + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2446,8 +2464,8 @@ func TestPhp5(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{}, + Call: &node.Identifier{Value: "bar"}, + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2457,15 +2475,15 @@ func TestPhp5(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - Arguments: []node.Node{}, + Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ Expr: &expr.StaticCall{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - Arguments: []node.Node{}, + Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2815,11 +2833,13 @@ func TestPhp5(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Arguments: []node.Node{ - &node.Argument{ - Variadic: false, - IsReference: false, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + Variadic: false, + IsReference: false, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, }, }, }, @@ -2910,7 +2930,7 @@ func TestPhp5(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2922,10 +2942,10 @@ func TestPhp5(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, - Method: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{}, + Method: &node.Identifier{Value: "bar"}, + ArgumentList: &node.ArgumentList{}, }, Property: &node.Identifier{Value: "baz"}, }, @@ -2939,7 +2959,7 @@ func TestPhp5(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, Dim: &scalar.Lnumber{Value: "0"}, }, @@ -2955,12 +2975,12 @@ func TestPhp5(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, Dim: &scalar.Lnumber{Value: "0"}, }, - Method: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{}, + Method: &node.Identifier{Value: "bar"}, + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -3574,16 +3594,16 @@ func TestPhp5(t *testing.T) { }, &stmt.Expression{ Expr: &expr.FunctionCall{ - Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Arguments: []node.Node{}, + Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ Expr: &expr.ArrayDimFetch{ Variable: &expr.ArrayDimFetch{ Variable: &expr.FunctionCall{ - Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Arguments: []node.Node{}, + Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + ArgumentList: &node.ArgumentList{}, }, Dim: &scalar.Lnumber{Value: "0"}, }, @@ -3601,9 +3621,9 @@ func TestPhp5(t *testing.T) { }, &stmt.Expression{ Expr: &expr.StaticCall{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - Arguments: []node.Node{}, + Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ diff --git a/php7/php7.go b/php7/php7.go index b4eac43..32ba4b3 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -345,7 +345,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:4114 +//line php7/php7.y:4125 type foreachVariable struct { node node.Node @@ -1452,8 +1452,8 @@ var yyPgo = [...]int{ 872, 868, 13, 46, 866, 858, 100, 84, 199, 856, 855, 853, 5, 852, 83, 40, 845, 138, 43, 840, 837, 835, 825, 823, 119, 822, 819, 818, 817, 12, - 815, 814, 44, 42, 32, 2, 15, 629, 8, 686, - 20, 812, 809, 807, 41, 74, 536, 806, 121, 803, + 815, 814, 44, 42, 32, 2, 15, 629, 41, 74, + 8, 686, 20, 812, 809, 807, 536, 806, 121, 803, 802, 800, 71, 798, 33, 797, 795, 30, 37, 791, 789, 28, 787, 786, 545, 784, 18, 783, 776, 26, 773, 63, 1, 4, 768, 17, 767, 39, 765, 763, @@ -1471,7 +1471,7 @@ var yyR1 = [...]int{ 5, 5, 5, 5, 5, 5, 6, 6, 111, 111, 88, 88, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 79, 79, 16, 16, 18, 18, 7, 7, 98, 98, + 81, 81, 16, 16, 18, 18, 7, 7, 98, 98, 97, 97, 104, 104, 17, 17, 20, 20, 19, 19, 92, 92, 112, 112, 22, 22, 22, 22, 22, 22, 22, 11, 11, 11, 11, 11, 11, 11, 11, 11, @@ -1479,16 +1479,16 @@ var yyR1 = [...]int{ 11, 11, 11, 11, 11, 90, 90, 89, 89, 26, 26, 103, 103, 27, 12, 1, 1, 2, 2, 13, 13, 122, 122, 77, 77, 14, 15, 29, 29, 116, - 116, 117, 117, 80, 80, 80, 80, 125, 125, 126, - 126, 25, 25, 82, 82, 82, 82, 101, 101, 101, + 116, 117, 117, 82, 82, 82, 82, 125, 125, 126, + 126, 25, 25, 84, 84, 84, 84, 101, 101, 101, 8, 8, 124, 124, 68, 68, 66, 66, 70, 70, 67, 67, 113, 113, 114, 114, 30, 30, 31, 31, - 76, 76, 74, 74, 74, 75, 75, 84, 84, 110, + 76, 76, 74, 74, 74, 75, 75, 78, 78, 110, 110, 32, 32, 96, 96, 34, 100, 100, 35, 35, - 115, 115, 36, 36, 36, 36, 121, 121, 83, 83, - 83, 102, 102, 37, 37, 38, 39, 39, 39, 39, - 41, 41, 40, 81, 81, 119, 119, 118, 118, 120, - 120, 78, 78, 78, 78, 78, 78, 99, 99, 42, + 115, 115, 36, 36, 36, 36, 121, 121, 85, 85, + 85, 102, 102, 37, 37, 38, 39, 39, 39, 39, + 41, 41, 40, 83, 83, 119, 119, 118, 118, 120, + 120, 80, 80, 80, 80, 80, 80, 99, 99, 42, 42, 91, 91, 69, 21, 93, 93, 43, 94, 94, 95, 95, 45, 44, 44, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, @@ -1500,7 +1500,7 @@ var yyR1 = [...]int{ 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 123, 3, 3, 106, 106, 105, 105, 52, 52, 53, 53, 53, 53, 46, 46, 47, 47, 50, 50, - 87, 87, 87, 85, 85, 57, 57, 57, 51, 51, + 87, 87, 87, 79, 79, 57, 57, 57, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 58, 58, 58, 23, 23, 24, 24, 56, 59, 59, 59, 60, 60, 60, 61, 61, @@ -1576,7 +1576,7 @@ var yyChk = [...]int{ -58, -53, -46, -56, -57, 91, 49, 50, 4, 5, 84, 85, 86, 8, 9, 66, 67, 81, 63, 64, 65, 80, 62, 74, 140, 12, 157, -10, -60, 60, - 18, -88, 82, 146, 82, -88, 142, 10, -18, -79, + 18, -88, 82, 146, 82, -88, 142, 10, -18, -81, -104, -88, 82, 37, 38, -19, -20, -92, -21, 10, -112, 146, -11, 37, 79, 146, 146, -24, -23, 98, -24, -24, -96, -34, -48, -100, 37, -35, 12, -93, @@ -1593,7 +1593,7 @@ var yyChk = [...]int{ -23, -87, 17, -86, -64, 12, 76, 77, -23, -23, -23, 148, 78, 78, -47, -45, -46, -63, 52, -10, -48, 146, 146, -23, -23, 146, -23, -23, 17, 75, - -86, -86, 17, 142, -48, -84, 146, -84, 146, 82, + -86, -86, 17, 142, -48, -78, 146, -78, 146, 82, -88, 147, -88, 144, 142, -111, 144, -16, -104, -88, 82, 144, 158, 82, 29, -88, -20, 144, 158, 160, -22, 143, 2, -11, -12, -13, -14, -15, 51, -23, @@ -1616,21 +1616,21 @@ var yyChk = [...]int{ 50, 35, 36, 37, 38, 39, 96, 97, 59, 30, 31, 32, 33, 34, 60, 61, 55, 56, 79, 53, 54, 52, 62, 63, 65, 64, 66, 67, 81, 80, - -54, -6, -48, -85, -84, 78, 148, 142, 57, 78, - -85, -107, -73, -23, -23, -23, 75, 75, 140, -23, + -54, -6, -48, -79, -78, 78, 148, 142, 57, 78, + -79, -107, -73, -23, -23, -23, 75, 75, 140, -23, 147, -110, -32, -23, 83, -109, 10, 144, -111, 143, 144, 144, 82, -88, -19, 82, -88, 142, 10, 82, -21, -23, 146, 147, 146, 144, 158, 147, -34, -35, -123, -23, -43, 145, -23, -7, 158, 29, 147, 143, -123, 146, -29, -117, 56, -10, 142, -123, -121, -10, - -23, -23, -112, -23, 147, 149, 143, -84, -23, 147, + -23, -23, -112, -23, 147, 149, 143, -78, -23, 147, 160, -72, -23, 151, 59, -109, 147, 149, 147, -65, 10, 13, 152, 12, 10, 143, 143, 148, 143, -23, - 149, -84, -23, -84, -48, -24, -23, -55, -48, -29, + 149, -78, -23, -78, -48, -24, -23, -55, -48, -29, -7, 158, 147, 147, 143, -7, 158, -23, 147, 143, - 142, 82, -98, -17, -20, -79, 142, -123, 147, -124, - -11, 145, -23, -94, -23, -82, 142, 145, 146, -23, - 147, -27, -80, -28, 151, 59, 148, -25, -11, 145, + 142, 82, -98, -17, -20, -81, 142, -123, 147, -124, + -11, 145, -23, -94, -23, -84, 142, 145, 146, -23, + 147, -27, -82, -28, 151, 59, 148, -25, -11, 145, -90, 146, -113, -114, -30, -31, -76, -74, 150, 60, 61, -10, -117, -123, -121, -115, 142, 158, 147, 147, 95, -11, 145, 143, 160, -23, -28, 146, 147, 149, @@ -1639,25 +1639,25 @@ var yyChk = [...]int{ 144, -101, 144, -101, 144, -113, 144, 147, 58, -28, 146, -109, -112, -26, 41, 42, -113, 147, 158, -1, 151, -74, -123, 142, 143, -36, -119, -118, 44, -120, - 47, -78, 103, 102, 101, 98, 99, 100, -115, -10, + 47, -80, 103, 102, 101, 98, 99, 100, -115, -10, -11, 145, 144, -112, -23, -109, 149, -123, -7, 158, -97, 143, -17, -7, 22, 144, -94, 143, 32, 33, - -101, 31, -101, 147, -126, -11, 145, -80, -28, -109, + -101, 31, -101, 147, -126, -11, 145, -82, -28, -109, 149, 28, 146, 142, 147, -106, 44, -30, -2, 83, - 142, -115, -99, -42, 12, 38, 37, -121, -78, 143, + 142, -115, -99, -42, 12, 38, 37, -121, -80, 143, -112, 147, 143, 142, 143, -20, -7, 143, 144, 147, -23, -8, 145, 144, 143, 144, 31, -106, -112, 147, 147, 144, -89, -10, -112, -75, 145, -75, 146, 12, -115, 143, 144, 158, -123, 160, -91, -69, -6, -3, - -83, 144, 142, -115, 143, -125, -11, 145, -8, -112, + -85, 144, 142, -115, 143, -125, -11, 145, -8, -112, 144, -75, 26, -126, 12, 159, 143, 142, -76, 142, -105, -52, 12, 151, 160, 143, -42, -23, 144, 158, 160, -6, 143, -102, -37, -38, -39, -40, -41, -10, -6, 79, 10, 143, -112, -112, 142, 144, 147, -10, -112, -112, 147, 158, 12, -23, -123, -69, -23, -123, 143, -37, 144, 144, 45, 29, 78, 24, -112, 142, - 143, 143, -52, -123, 146, -121, 10, -4, -78, -6, - 144, 143, -112, -113, -6, 143, 147, -75, -81, 144, + 143, 143, -52, -123, 146, -121, 10, -4, -80, -6, + 144, 143, -112, -113, -6, 143, 147, -75, -83, 144, 142, -112, 143, } var yyDef = [...]int{ @@ -2133,7 +2133,7 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:293 + //line php7/php7.y:294 { yylex.(*Parser).rootNode = stmt.NewStmtList(yyDollar[1].list) @@ -2142,463 +2142,463 @@ yydefault: } case 2: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 3: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 5: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 10: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 11: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 12: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 13: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 14: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 15: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 16: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 17: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 18: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 21: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 22: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 23: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 24: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 27: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 28: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 29: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 30: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 33: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 34: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 35: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 36: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 37: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 38: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 39: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 44: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 46: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 47: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 48: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 49: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 50: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 51: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 52: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 53: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 54: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 55: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 56: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 57: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 58: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 59: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 60: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 61: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 62: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 63: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 64: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 66: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 67: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 68: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 69: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 70: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 72: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 73: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 74: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 75: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 76: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 77: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:321 + //line php7/php7.y:322 { yyVAL.token = yyDollar[1].token } case 78: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:326 + //line php7/php7.y:327 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2606,13 +2606,13 @@ yydefault: } case 79: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:332 + //line php7/php7.y:333 { yyVAL.list = []node.Node{} } case 80: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:337 + //line php7/php7.y:338 { namePart := name.NewNamePart(yyDollar[1].token.Value) yyVAL.list = []node.Node{namePart} @@ -2625,7 +2625,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:348 + //line php7/php7.y:349 { namePart := name.NewNamePart(yyDollar[3].token.Value) yyVAL.list = append(yyDollar[1].list, namePart) @@ -2639,7 +2639,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:363 + //line php7/php7.y:364 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -2648,7 +2648,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:370 + //line php7/php7.y:371 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -2661,7 +2661,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:381 + //line php7/php7.y:382 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -2673,44 +2673,44 @@ yydefault: } case 85: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:394 + //line php7/php7.y:395 { // error yyVAL.node = nil } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:399 + //line php7/php7.y:400 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:401 + //line php7/php7.y:402 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:403 + //line php7/php7.y:404 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:405 + //line php7/php7.y:406 { yyVAL.node = yyDollar[1].node } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:407 + //line php7/php7.y:408 { yyVAL.node = yyDollar[1].node } case 91: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:409 + //line php7/php7.y:410 { yyVAL.node = stmt.NewHaltCompiler() @@ -2725,7 +2725,7 @@ yydefault: } case 92: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:422 + //line php7/php7.y:423 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2740,7 +2740,7 @@ yydefault: } case 93: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:435 + //line php7/php7.y:436 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2756,7 +2756,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:449 + //line php7/php7.y:450 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2770,7 +2770,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:461 + //line php7/php7.y:462 { yyVAL.node = yyDollar[2].node @@ -2783,7 +2783,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:472 + //line php7/php7.y:473 { yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) @@ -2796,7 +2796,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:483 + //line php7/php7.y:484 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2809,7 +2809,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:494 + //line php7/php7.y:495 { yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) @@ -2822,7 +2822,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:505 + //line php7/php7.y:506 { yyVAL.node = stmt.NewConstList(yyDollar[2].list) @@ -2835,7 +2835,7 @@ yydefault: } case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:519 + //line php7/php7.y:520 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2847,7 +2847,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:529 + //line php7/php7.y:530 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2859,7 +2859,7 @@ yydefault: } case 102: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:542 + //line php7/php7.y:543 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2878,7 +2878,7 @@ yydefault: } case 103: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:559 + //line php7/php7.y:560 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2898,7 +2898,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:580 + //line php7/php7.y:581 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2917,7 +2917,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:597 + //line php7/php7.y:598 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2937,19 +2937,19 @@ yydefault: } case 106: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:618 + //line php7/php7.y:619 { yyVAL.token = nil } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:620 + //line php7/php7.y:621 { yyVAL.token = yyDollar[1].token } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:625 + //line php7/php7.y:626 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2958,13 +2958,13 @@ yydefault: } case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:632 + //line php7/php7.y:633 { yyVAL.list = []node.Node{yyDollar[1].node} } case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:637 + //line php7/php7.y:638 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2973,13 +2973,13 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:644 + //line php7/php7.y:645 { yyVAL.list = []node.Node{yyDollar[1].node} } case 112: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:649 + //line php7/php7.y:650 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2988,25 +2988,25 @@ yydefault: } case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:656 + //line php7/php7.y:657 { yyVAL.list = []node.Node{yyDollar[1].node} } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:661 + //line php7/php7.y:662 { yyVAL.node = yyDollar[1].node } case 115: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:663 + //line php7/php7.y:664 { yyVAL.node = yyDollar[2].node.(*stmt.Use).SetUseType(yyDollar[1].node) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:668 + //line php7/php7.y:669 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -3017,7 +3017,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:677 + //line php7/php7.y:678 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -3034,13 +3034,13 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:695 + //line php7/php7.y:696 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:697 + //line php7/php7.y:698 { yyVAL.node = yyDollar[2].node @@ -3049,7 +3049,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:707 + //line php7/php7.y:708 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3058,13 +3058,13 @@ yydefault: } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:714 + //line php7/php7.y:715 { yyVAL.list = []node.Node{yyDollar[1].node} } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:719 + //line php7/php7.y:720 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3072,50 +3072,50 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:725 + //line php7/php7.y:726 { yyVAL.list = []node.Node{} } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:730 + //line php7/php7.y:731 { // error yyVAL.node = nil } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:735 + //line php7/php7.y:736 { yyVAL.node = yyDollar[1].node } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:737 + //line php7/php7.y:738 { yyVAL.node = yyDollar[1].node } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:739 + //line php7/php7.y:740 { yyVAL.node = yyDollar[1].node } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:741 + //line php7/php7.y:742 { yyVAL.node = yyDollar[1].node } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:743 + //line php7/php7.y:744 { yyVAL.node = yyDollar[1].node } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:745 + //line php7/php7.y:746 { yyVAL.node = stmt.NewHaltCompiler() @@ -3130,7 +3130,7 @@ yydefault: } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:760 + //line php7/php7.y:761 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3143,19 +3143,19 @@ yydefault: } case 132: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:771 + //line php7/php7.y:772 { yyVAL.node = yyDollar[1].node } case 133: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:773 + //line php7/php7.y:774 { yyVAL.node = yyDollar[1].node } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:775 + //line php7/php7.y:776 { if yyDollar[5].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltWhile(yyDollar[3].node, yyDollar[5].altSyntaxNode.node) @@ -3173,7 +3173,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:791 + //line php7/php7.y:792 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) @@ -3189,7 +3189,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:805 + //line php7/php7.y:806 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltFor(yyDollar[3].list, yyDollar[5].list, yyDollar[7].list, yyDollar[9].altSyntaxNode.node) @@ -3209,7 +3209,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:823 + //line php7/php7.y:824 { if yyDollar[5].nodesWithEndToken.endToken.Value == ";" { yyVAL.node = stmt.NewAltSwitch(yyDollar[3].node, yyDollar[5].nodesWithEndToken.nodes) @@ -3227,7 +3227,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:839 + //line php7/php7.y:840 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3240,7 +3240,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:850 + //line php7/php7.y:851 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3253,7 +3253,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:861 + //line php7/php7.y:862 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3266,7 +3266,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:872 + //line php7/php7.y:873 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3279,7 +3279,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:883 + //line php7/php7.y:884 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3292,7 +3292,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:894 + //line php7/php7.y:895 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3305,7 +3305,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:905 + //line php7/php7.y:906 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3317,7 +3317,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:915 + //line php7/php7.y:916 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3329,7 +3329,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:925 + //line php7/php7.y:926 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3347,7 +3347,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:941 + //line php7/php7.y:942 { if yyDollar[7].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, nil, yyDollar[5].foreachVariable.node, yyDollar[7].altSyntaxNode.node, yyDollar[5].foreachVariable.byRef) @@ -3366,7 +3366,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:958 + //line php7/php7.y:959 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, yyDollar[5].node, yyDollar[7].foreachVariable.node, yyDollar[9].altSyntaxNode.node, yyDollar[7].foreachVariable.byRef) @@ -3386,7 +3386,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:976 + //line php7/php7.y:977 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) @@ -3400,7 +3400,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:988 + //line php7/php7.y:989 { yyVAL.node = stmt.NewNop() @@ -3412,7 +3412,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:998 + //line php7/php7.y:999 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3429,7 +3429,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1013 + //line php7/php7.y:1014 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3442,7 +3442,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1024 + //line php7/php7.y:1025 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3458,7 +3458,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1038 + //line php7/php7.y:1039 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -3473,13 +3473,13 @@ yydefault: } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1053 + //line php7/php7.y:1054 { yyVAL.list = []node.Node{} } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1055 + //line php7/php7.y:1056 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[5].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -3501,13 +3501,13 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1077 + //line php7/php7.y:1078 { yyVAL.list = []node.Node{yyDollar[1].node} } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1079 + //line php7/php7.y:1080 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3516,13 +3516,13 @@ yydefault: } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1089 + //line php7/php7.y:1090 { yyVAL.node = nil } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1091 + //line php7/php7.y:1092 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3536,13 +3536,13 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1106 + //line php7/php7.y:1107 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1108 + //line php7/php7.y:1109 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3551,13 +3551,13 @@ yydefault: } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1118 + //line php7/php7.y:1119 { yyVAL.node = yyDollar[1].node } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1123 + //line php7/php7.y:1124 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].boolWithToken.value, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) @@ -3579,31 +3579,31 @@ yydefault: } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1146 + //line php7/php7.y:1147 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1148 + //line php7/php7.y:1149 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1153 + //line php7/php7.y:1154 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1155 + //line php7/php7.y:1156 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1160 + //line php7/php7.y:1161 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].node, yyDollar[5].list, yyDollar[8].list, yyDollar[6].str) @@ -3626,7 +3626,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1181 + //line php7/php7.y:1182 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) @@ -3649,19 +3649,19 @@ yydefault: } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1205 + //line php7/php7.y:1206 { yyVAL.list = []node.Node{yyDollar[1].node} } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1207 + //line php7/php7.y:1208 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1212 + //line php7/php7.y:1213 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3673,7 +3673,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1222 + //line php7/php7.y:1223 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3685,7 +3685,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1235 + //line php7/php7.y:1236 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3702,7 +3702,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1253 + //line php7/php7.y:1254 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].list, yyDollar[6].list, yyDollar[4].str) @@ -3722,13 +3722,13 @@ yydefault: } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1274 + //line php7/php7.y:1275 { yyVAL.node = nil } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1276 + //line php7/php7.y:1277 { yyVAL.node = yyDollar[2].node @@ -3737,13 +3737,13 @@ yydefault: } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1286 + //line php7/php7.y:1287 { yyVAL.list = nil } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1288 + //line php7/php7.y:1289 { yyVAL.list = yyDollar[2].list @@ -3752,13 +3752,13 @@ yydefault: } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1298 + //line php7/php7.y:1299 { yyVAL.list = nil } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1300 + //line php7/php7.y:1301 { yyVAL.list = yyDollar[2].list @@ -3767,13 +3767,13 @@ yydefault: } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1310 + //line php7/php7.y:1311 { yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1312 + //line php7/php7.y:1313 { yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} @@ -3785,7 +3785,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1322 + //line php7/php7.y:1323 { list := expr.NewList(yyDollar[3].list) yyVAL.foreachVariable = foreachVariable{list, false} @@ -3800,7 +3800,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1335 + //line php7/php7.y:1336 { list := expr.NewShortList(yyDollar[2].list) yyVAL.foreachVariable = foreachVariable{list, false} @@ -3814,13 +3814,13 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1350 + //line php7/php7.y:1351 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1352 + //line php7/php7.y:1353 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} @@ -3834,13 +3834,13 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1367 + //line php7/php7.y:1368 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1369 + //line php7/php7.y:1370 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} @@ -3854,13 +3854,13 @@ yydefault: } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1384 + //line php7/php7.y:1385 { yyVAL.node = yyDollar[1].node } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1386 + //line php7/php7.y:1387 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3874,37 +3874,37 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1400 + //line php7/php7.y:1401 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1401 + //line php7/php7.y:1402 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[4].token} } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1402 + //line php7/php7.y:1403 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[4].token} } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1403 + //line php7/php7.y:1404 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[5].token} } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1408 + //line php7/php7.y:1409 { yyVAL.list = []node.Node{} } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1410 + //line php7/php7.y:1411 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -3918,7 +3918,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1422 + //line php7/php7.y:1423 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -3932,25 +3932,25 @@ yydefault: } case 200: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1437 + //line php7/php7.y:1438 { yyVAL.token = yyDollar[1].token } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1439 + //line php7/php7.y:1440 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1444 + //line php7/php7.y:1445 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1446 + //line php7/php7.y:1447 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} @@ -3964,7 +3964,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1461 + //line php7/php7.y:1462 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -3978,7 +3978,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1473 + //line php7/php7.y:1474 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -3994,13 +3994,13 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1490 + //line php7/php7.y:1491 { yyVAL.node = yyDollar[1].node } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1492 + //line php7/php7.y:1493 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4014,7 +4014,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1507 + //line php7/php7.y:1508 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4031,7 +4031,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1522 + //line php7/php7.y:1523 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4049,7 +4049,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1541 + //line php7/php7.y:1542 { yyVAL.node = yyDollar[1].node @@ -4062,7 +4062,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1552 + //line php7/php7.y:1553 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4081,25 +4081,25 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1572 + //line php7/php7.y:1573 { yyVAL.list = yyDollar[1].list } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1574 + //line php7/php7.y:1575 { yyVAL.list = nil } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1579 + //line php7/php7.y:1580 { yyVAL.list = []node.Node{yyDollar[1].node} } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1581 + //line php7/php7.y:1582 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4108,7 +4108,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1591 + //line php7/php7.y:1592 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4147,7 +4147,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1628 + //line php7/php7.y:1629 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4186,25 +4186,25 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1668 + //line php7/php7.y:1669 { yyVAL.node = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1670 + //line php7/php7.y:1671 { yyVAL.node = yyDollar[1].node } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1675 + //line php7/php7.y:1676 { yyVAL.node = yyDollar[1].node } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1677 + //line php7/php7.y:1678 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4216,7 +4216,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1690 + //line php7/php7.y:1691 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4228,7 +4228,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1700 + //line php7/php7.y:1701 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4240,19 +4240,19 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1710 + //line php7/php7.y:1711 { yyVAL.node = yyDollar[1].node } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1715 + //line php7/php7.y:1716 { yyVAL.node = nil } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1717 + //line php7/php7.y:1718 { yyVAL.node = yyDollar[2].node @@ -4261,25 +4261,31 @@ yydefault: } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1727 + //line php7/php7.y:1728 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{[]node.Node{}, yyDollar[2].token} + yyVAL.node = node.NewArgumentList(nil) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1729 + //line php7/php7.y:1735 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[4].token} + yyVAL.node = node.NewArgumentList(yyDollar[2].list) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1734 + //line php7/php7.y:1745 { yyVAL.list = []node.Node{yyDollar[1].node} } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1736 + //line php7/php7.y:1747 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4288,7 +4294,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1746 + //line php7/php7.y:1757 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4297,7 +4303,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1753 + //line php7/php7.y:1764 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4309,7 +4315,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1766 + //line php7/php7.y:1777 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4318,19 +4324,19 @@ yydefault: } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1773 + //line php7/php7.y:1784 { yyVAL.list = []node.Node{yyDollar[1].node} } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1778 + //line php7/php7.y:1789 { yyVAL.node = yyDollar[1].node } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1783 + //line php7/php7.y:1794 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4339,13 +4345,13 @@ yydefault: } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1790 + //line php7/php7.y:1801 { yyVAL.list = []node.Node{yyDollar[1].node} } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1795 + //line php7/php7.y:1806 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4361,7 +4367,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1809 + //line php7/php7.y:1820 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4378,19 +4384,19 @@ yydefault: } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1827 + //line php7/php7.y:1838 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1829 + //line php7/php7.y:1840 { yyVAL.list = []node.Node{} } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1834 + //line php7/php7.y:1845 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4402,7 +4408,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1844 + //line php7/php7.y:1855 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4415,7 +4421,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1855 + //line php7/php7.y:1866 { yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].nodesWithEndToken.nodes) @@ -4427,7 +4433,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:1865 + //line php7/php7.y:1876 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].boolWithToken.value, yyDollar[7].list, yyDollar[9].node, yyDollar[10].nodesWithEndToken.nodes, yyDollar[5].str) @@ -4447,13 +4453,13 @@ yydefault: } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1886 + //line php7/php7.y:1897 { yyVAL.list = []node.Node{yyDollar[1].node} } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1888 + //line php7/php7.y:1899 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4462,37 +4468,37 @@ yydefault: } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1898 + //line php7/php7.y:1909 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1900 + //line php7/php7.y:1911 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[2].token} } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1902 + //line php7/php7.y:1913 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1907 + //line php7/php7.y:1918 { yyVAL.list = []node.Node{yyDollar[1].node} } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1909 + //line php7/php7.y:1920 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1914 + //line php7/php7.y:1925 { yyVAL.node = yyDollar[1].node @@ -4501,7 +4507,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1921 + //line php7/php7.y:1932 { yyVAL.node = yyDollar[1].node @@ -4510,7 +4516,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1931 + //line php7/php7.y:1942 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4522,7 +4528,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1944 + //line php7/php7.y:1955 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4537,7 +4543,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1957 + //line php7/php7.y:1968 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4552,7 +4558,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1970 + //line php7/php7.y:1981 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -4567,7 +4573,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1983 + //line php7/php7.y:1994 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -4579,7 +4585,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1996 + //line php7/php7.y:2007 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -4593,13 +4599,13 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2008 + //line php7/php7.y:2019 { yyVAL.node = yyDollar[1].node } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2013 + //line php7/php7.y:2024 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -4614,25 +4620,25 @@ yydefault: } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2028 + //line php7/php7.y:2039 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2029 + //line php7/php7.y:2040 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2034 + //line php7/php7.y:2045 { yyVAL.list = yyDollar[1].list } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2036 + //line php7/php7.y:2047 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -4645,31 +4651,31 @@ yydefault: } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2050 + //line php7/php7.y:2061 { yyVAL.list = nil } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2052 + //line php7/php7.y:2063 { yyVAL.list = yyDollar[1].list } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2057 + //line php7/php7.y:2068 { yyVAL.list = []node.Node{yyDollar[1].node} } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2059 + //line php7/php7.y:2070 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2064 + //line php7/php7.y:2075 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4681,7 +4687,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2074 + //line php7/php7.y:2085 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4693,7 +4699,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2084 + //line php7/php7.y:2095 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4705,7 +4711,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2094 + //line php7/php7.y:2105 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4717,7 +4723,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2104 + //line php7/php7.y:2115 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4729,7 +4735,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2114 + //line php7/php7.y:2125 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4741,7 +4747,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2127 + //line php7/php7.y:2138 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4750,13 +4756,13 @@ yydefault: } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2134 + //line php7/php7.y:2145 { yyVAL.list = []node.Node{yyDollar[1].node} } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2139 + //line php7/php7.y:2150 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4772,7 +4778,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2153 + //line php7/php7.y:2164 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4789,7 +4795,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2171 + //line php7/php7.y:2182 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4798,13 +4804,13 @@ yydefault: } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2178 + //line php7/php7.y:2189 { yyVAL.list = []node.Node{yyDollar[1].node} } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2183 + //line php7/php7.y:2194 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4819,7 +4825,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2199 + //line php7/php7.y:2210 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4834,7 +4840,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2215 + //line php7/php7.y:2226 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4843,31 +4849,31 @@ yydefault: } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2222 + //line php7/php7.y:2233 { yyVAL.list = []node.Node{yyDollar[1].node} } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2227 + //line php7/php7.y:2238 { yyVAL.node = yyDollar[1].node } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2232 + //line php7/php7.y:2243 { yyVAL.list = nil } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2234 + //line php7/php7.y:2245 { yyVAL.list = yyDollar[1].list } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2239 + //line php7/php7.y:2250 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4876,16 +4882,16 @@ yydefault: } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2246 + //line php7/php7.y:2257 { yyVAL.list = []node.Node{yyDollar[1].node} } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:2251 + //line php7/php7.y:2262 { - if yyDollar[2].nodesWithEndToken != nil { - yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].nodesWithEndToken.nodes, yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) + if yyDollar[2].node != nil { + yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) } else { yyVAL.node = stmt.NewClass(nil, nil, nil, yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) } @@ -4906,11 +4912,11 @@ yydefault: } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2276 + //line php7/php7.y:2287 { - if yyDollar[3].nodesWithEndToken != nil { - yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].nodesWithEndToken.nodes) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].nodesWithEndToken.endToken)) + if yyDollar[3].node != nil { + yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) } else { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4921,7 +4927,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2289 + //line php7/php7.y:2300 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -4933,7 +4939,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2302 + //line php7/php7.y:2313 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -4950,7 +4956,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:2317 + //line php7/php7.y:2328 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -4966,7 +4972,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2331 + //line php7/php7.y:2342 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -4978,7 +4984,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2341 + //line php7/php7.y:2352 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -4991,7 +4997,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2352 + //line php7/php7.y:2363 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5003,7 +5009,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2362 + //line php7/php7.y:2373 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5015,7 +5021,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2372 + //line php7/php7.y:2383 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5027,7 +5033,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2382 + //line php7/php7.y:2393 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5039,7 +5045,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2392 + //line php7/php7.y:2403 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5051,7 +5057,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2402 + //line php7/php7.y:2413 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5063,7 +5069,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2412 + //line php7/php7.y:2423 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5075,7 +5081,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2422 + //line php7/php7.y:2433 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5087,7 +5093,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2432 + //line php7/php7.y:2443 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5099,7 +5105,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2442 + //line php7/php7.y:2453 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5111,7 +5117,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2452 + //line php7/php7.y:2463 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5123,7 +5129,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2462 + //line php7/php7.y:2473 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5135,7 +5141,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2472 + //line php7/php7.y:2483 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5147,7 +5153,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2482 + //line php7/php7.y:2493 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5159,7 +5165,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2492 + //line php7/php7.y:2503 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5171,7 +5177,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2502 + //line php7/php7.y:2513 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5183,7 +5189,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2512 + //line php7/php7.y:2523 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5195,7 +5201,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2522 + //line php7/php7.y:2533 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5207,7 +5213,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2532 + //line php7/php7.y:2543 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5219,7 +5225,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2542 + //line php7/php7.y:2553 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5231,7 +5237,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2552 + //line php7/php7.y:2563 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5243,7 +5249,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2562 + //line php7/php7.y:2573 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5255,7 +5261,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2572 + //line php7/php7.y:2583 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5267,7 +5273,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2582 + //line php7/php7.y:2593 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5279,7 +5285,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2592 + //line php7/php7.y:2603 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5291,7 +5297,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2602 + //line php7/php7.y:2613 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5303,7 +5309,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2612 + //line php7/php7.y:2623 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5315,7 +5321,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2622 + //line php7/php7.y:2633 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5327,7 +5333,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2632 + //line php7/php7.y:2643 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5339,7 +5345,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2642 + //line php7/php7.y:2653 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5351,7 +5357,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2652 + //line php7/php7.y:2663 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5363,7 +5369,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2662 + //line php7/php7.y:2673 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5375,7 +5381,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2672 + //line php7/php7.y:2683 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5387,7 +5393,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2682 + //line php7/php7.y:2693 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5399,7 +5405,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2692 + //line php7/php7.y:2703 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -5411,7 +5417,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2702 + //line php7/php7.y:2713 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -5423,7 +5429,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2712 + //line php7/php7.y:2723 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -5435,7 +5441,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2722 + //line php7/php7.y:2733 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -5447,7 +5453,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2732 + //line php7/php7.y:2743 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5459,7 +5465,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2742 + //line php7/php7.y:2753 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5471,7 +5477,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2752 + //line php7/php7.y:2763 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -5483,7 +5489,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2762 + //line php7/php7.y:2773 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -5495,7 +5501,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2772 + //line php7/php7.y:2783 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -5507,7 +5513,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2782 + //line php7/php7.y:2793 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5519,7 +5525,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2792 + //line php7/php7.y:2803 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -5531,7 +5537,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2802 + //line php7/php7.y:2813 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5543,7 +5549,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2812 + //line php7/php7.y:2823 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -5555,7 +5561,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2822 + //line php7/php7.y:2833 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -5567,7 +5573,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2832 + //line php7/php7.y:2843 { yyVAL.node = yyDollar[2].node @@ -5577,13 +5583,13 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2840 + //line php7/php7.y:2851 { yyVAL.node = yyDollar[1].node } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:2842 + //line php7/php7.y:2853 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -5596,7 +5602,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2853 + //line php7/php7.y:2864 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -5609,7 +5615,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2864 + //line php7/php7.y:2875 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -5621,13 +5627,13 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2874 + //line php7/php7.y:2885 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2876 + //line php7/php7.y:2887 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -5639,7 +5645,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2886 + //line php7/php7.y:2897 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -5651,7 +5657,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2896 + //line php7/php7.y:2907 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -5663,7 +5669,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2906 + //line php7/php7.y:2917 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -5675,7 +5681,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2916 + //line php7/php7.y:2927 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -5687,7 +5693,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2926 + //line php7/php7.y:2937 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -5699,7 +5705,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2936 + //line php7/php7.y:2947 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -5711,7 +5717,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2946 + //line php7/php7.y:2957 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -5727,7 +5733,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2960 + //line php7/php7.y:2971 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -5739,13 +5745,13 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2970 + //line php7/php7.y:2981 { yyVAL.node = yyDollar[1].node } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2972 + //line php7/php7.y:2983 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -5758,7 +5764,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2983 + //line php7/php7.y:2994 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -5770,7 +5776,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2993 + //line php7/php7.y:3004 { yyVAL.node = expr.NewYield(nil, nil) @@ -5782,7 +5788,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3003 + //line php7/php7.y:3014 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -5794,7 +5800,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3013 + //line php7/php7.y:3024 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -5807,7 +5813,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3024 + //line php7/php7.y:3035 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -5819,7 +5825,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3034 + //line php7/php7.y:3045 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].boolWithToken.value, yyDollar[3].str) @@ -5838,7 +5844,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:3051 + //line php7/php7.y:3062 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].list, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].boolWithToken.value, yyDollar[4].str) @@ -5858,38 +5864,38 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3072 + //line php7/php7.y:3083 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3080 + //line php7/php7.y:3091 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3082 + //line php7/php7.y:3093 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3087 + //line php7/php7.y:3098 { yyVAL.list = []node.Node{} } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3089 + //line php7/php7.y:3100 { yyVAL.list = yyDollar[3].list } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3094 + //line php7/php7.y:3105 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5898,13 +5904,13 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3101 + //line php7/php7.y:3112 { yyVAL.list = []node.Node{yyDollar[1].node} } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3106 + //line php7/php7.y:3117 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -5920,7 +5926,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3120 + //line php7/php7.y:3131 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -5937,49 +5943,49 @@ yydefault: } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3138 + //line php7/php7.y:3149 { - yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].nodesWithEndToken.nodes) + yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].nodesWithEndToken.endToken)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3145 + //line php7/php7.y:3156 { - yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) + yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3155 + //line php7/php7.y:3166 { - yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) + yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3165 + //line php7/php7.y:3176 { - yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].nodesWithEndToken.nodes) + yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].nodesWithEndToken.endToken)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3175 + //line php7/php7.y:3186 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5991,67 +5997,67 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3185 + //line php7/php7.y:3196 { yyVAL.node = yyDollar[1].node } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3190 + //line php7/php7.y:3201 { yyVAL.node = yyDollar[1].node } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3192 + //line php7/php7.y:3203 { yyVAL.node = yyDollar[1].node } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3197 + //line php7/php7.y:3208 { yyVAL.node = nil } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3199 + //line php7/php7.y:3210 { yyVAL.node = yyDollar[2].node } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3204 + //line php7/php7.y:3215 { yyVAL.list = []node.Node{} } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3206 + //line php7/php7.y:3217 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3208 + //line php7/php7.y:3219 { yyVAL.list = yyDollar[1].list } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3213 + //line php7/php7.y:3224 { - yyVAL.nodesWithEndToken = nil + yyVAL.node = nil } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3215 + //line php7/php7.y:3226 { - yyVAL.nodesWithEndToken = yyDollar[1].nodesWithEndToken + yyVAL.node = yyDollar[1].node } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3220 + //line php7/php7.y:3231 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6065,7 +6071,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3232 + //line php7/php7.y:3243 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6078,7 +6084,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3243 + //line php7/php7.y:3254 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6090,7 +6096,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3256 + //line php7/php7.y:3267 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6102,7 +6108,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3266 + //line php7/php7.y:3277 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6114,7 +6120,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3276 + //line php7/php7.y:3287 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6126,7 +6132,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3286 + //line php7/php7.y:3297 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6138,7 +6144,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3296 + //line php7/php7.y:3307 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6150,7 +6156,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3306 + //line php7/php7.y:3317 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6162,7 +6168,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3316 + //line php7/php7.y:3327 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6174,7 +6180,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3326 + //line php7/php7.y:3337 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6186,7 +6192,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3336 + //line php7/php7.y:3347 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6198,7 +6204,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3346 + //line php7/php7.y:3357 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6210,7 +6216,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3356 + //line php7/php7.y:3367 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -6224,7 +6230,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3368 + //line php7/php7.y:3379 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -6236,7 +6242,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3378 + //line php7/php7.y:3389 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -6248,7 +6254,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3388 + //line php7/php7.y:3399 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -6260,19 +6266,19 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3398 + //line php7/php7.y:3409 { yyVAL.node = yyDollar[1].node } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3400 + //line php7/php7.y:3411 { yyVAL.node = yyDollar[1].node } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3405 + //line php7/php7.y:3416 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -6281,7 +6287,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3412 + //line php7/php7.y:3423 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6296,7 +6302,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3425 + //line php7/php7.y:3436 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6311,43 +6317,43 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3441 + //line php7/php7.y:3452 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3443 + //line php7/php7.y:3454 { yyVAL.node = yyDollar[1].node } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3448 + //line php7/php7.y:3459 { yyVAL.node = nil } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3450 + //line php7/php7.y:3461 { yyVAL.node = yyDollar[1].node } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3455 + //line php7/php7.y:3466 { yyVAL.node = yyDollar[1].node } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3460 + //line php7/php7.y:3471 { yyVAL.node = yyDollar[1].node } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3462 + //line php7/php7.y:3473 { yyVAL.node = yyDollar[2].node @@ -6357,19 +6363,19 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3470 + //line php7/php7.y:3481 { yyVAL.node = yyDollar[1].node } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3475 + //line php7/php7.y:3486 { yyVAL.node = yyDollar[1].node } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3477 + //line php7/php7.y:3488 { yyVAL.node = yyDollar[2].node @@ -6379,30 +6385,17 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3485 + //line php7/php7.y:3496 { yyVAL.node = yyDollar[1].node } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3490 + //line php7/php7.y:3501 { yyVAL.node = yyDollar[1].node } case 429: - yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3492 - { - yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) - - // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - - // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) - } - case 430: yyDollar = yyS[yypt-4 : yypt+1] //line php7/php7.y:3503 { @@ -6415,7 +6408,7 @@ yydefault: yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) } - case 431: + case 430: yyDollar = yyS[yypt-4 : yypt+1] //line php7/php7.y:3514 { @@ -6424,43 +6417,56 @@ yydefault: // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) + } + case 431: + yyDollar = yyS[yypt-4 : yypt+1] + //line php7/php7.y:3525 + { + yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) + // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3525 + //line php7/php7.y:3536 { - yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].nodesWithEndToken.nodes) + yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].nodesWithEndToken.endToken)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ObjectOperatorToken) } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3535 + //line php7/php7.y:3546 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3540 + //line php7/php7.y:3551 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3542 + //line php7/php7.y:3553 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3544 + //line php7/php7.y:3555 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6472,7 +6478,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3557 + //line php7/php7.y:3568 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6486,7 +6492,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3569 + //line php7/php7.y:3580 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -6500,7 +6506,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3581 + //line php7/php7.y:3592 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6512,7 +6518,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3594 + //line php7/php7.y:3605 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6524,7 +6530,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3604 + //line php7/php7.y:3615 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6536,13 +6542,13 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3617 + //line php7/php7.y:3628 { yyVAL.node = yyDollar[1].node } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3619 + //line php7/php7.y:3630 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6555,7 +6561,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3630 + //line php7/php7.y:3641 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6568,7 +6574,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3641 + //line php7/php7.y:3652 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6580,7 +6586,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3651 + //line php7/php7.y:3662 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6592,7 +6598,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3661 + //line php7/php7.y:3672 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6604,7 +6610,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3674 + //line php7/php7.y:3685 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6616,7 +6622,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3684 + //line php7/php7.y:3695 { yyVAL.node = yyDollar[2].node @@ -6626,13 +6632,13 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3692 + //line php7/php7.y:3703 { yyVAL.node = yyDollar[1].node } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3697 + //line php7/php7.y:3708 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6644,7 +6650,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3707 + //line php7/php7.y:3718 { yyVAL.node = yyDollar[2].node @@ -6654,13 +6660,13 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3715 + //line php7/php7.y:3726 { yyVAL.node = yyDollar[1].node } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3720 + //line php7/php7.y:3731 { if yyDollar[1].list[len(yyDollar[1].list)-1] == nil { yyVAL.list = yyDollar[1].list[:len(yyDollar[1].list)-1] @@ -6670,19 +6676,19 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3731 + //line php7/php7.y:3742 { yyVAL.node = nil } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3733 + //line php7/php7.y:3744 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3738 + //line php7/php7.y:3749 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6691,13 +6697,13 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3745 + //line php7/php7.y:3756 { yyVAL.list = []node.Node{yyDollar[1].node} } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3750 + //line php7/php7.y:3761 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) @@ -6709,7 +6715,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3760 + //line php7/php7.y:3771 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) @@ -6718,7 +6724,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3767 + //line php7/php7.y:3778 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) @@ -6731,7 +6737,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3778 + //line php7/php7.y:3789 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[2].node, true) @@ -6743,7 +6749,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3788 + //line php7/php7.y:3799 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -6761,7 +6767,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3804 + //line php7/php7.y:3815 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -6778,13 +6784,13 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3822 + //line php7/php7.y:3833 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3824 + //line php7/php7.y:3835 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -6797,13 +6803,13 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3835 + //line php7/php7.y:3846 { yyVAL.list = []node.Node{yyDollar[1].node} } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3837 + //line php7/php7.y:3848 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -6816,7 +6822,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3851 + //line php7/php7.y:3862 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6830,7 +6836,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3863 + //line php7/php7.y:3874 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6848,7 +6854,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3879 + //line php7/php7.y:3890 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6868,7 +6874,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3897 + //line php7/php7.y:3908 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6881,7 +6887,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3908 + //line php7/php7.y:3919 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -6897,7 +6903,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3922 + //line php7/php7.y:3933 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -6917,13 +6923,13 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3940 + //line php7/php7.y:3951 { yyVAL.node = yyDollar[2].node } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3946 + //line php7/php7.y:3957 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6935,7 +6941,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3956 + //line php7/php7.y:3967 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -6952,7 +6958,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3971 + //line php7/php7.y:3982 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -6983,7 +6989,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4000 + //line php7/php7.y:4011 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(identifier) @@ -6997,7 +7003,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:4015 + //line php7/php7.y:4026 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -7014,7 +7020,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4030 + //line php7/php7.y:4041 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -7028,7 +7034,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4042 + //line php7/php7.y:4053 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -7040,7 +7046,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4052 + //line php7/php7.y:4063 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -7052,7 +7058,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4062 + //line php7/php7.y:4073 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -7066,7 +7072,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4074 + //line php7/php7.y:4085 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -7078,7 +7084,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4084 + //line php7/php7.y:4095 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -7090,13 +7096,13 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4097 + //line php7/php7.y:4108 { yyVAL.list = []node.Node{yyDollar[1].node} } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4099 + //line php7/php7.y:4110 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -7105,7 +7111,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4109 + //line php7/php7.y:4120 { yyVAL.node = yyDollar[1].node } diff --git a/php7/php7.y b/php7/php7.y index 60ee744..b310cce 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -263,12 +263,13 @@ import ( %type array_pair possible_array_pair %type isset_variable type return_type type_expr %type class_modifier +%type argument_list ctor_arguments %type member_modifier %type use_type %type foreach_variable -%type method_body switch_case_list trait_adaptations argument_list ctor_arguments +%type method_body switch_case_list trait_adaptations %type encaps_list backticks_expr namespace_name catch_name_list catch_list class_const_list %type const_list echo_expr_list for_exprs non_empty_for_exprs global_var_list @@ -482,7 +483,7 @@ top_statement: | T_USE use_declarations ';' { $$ = stmt.NewUseList(nil, $2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) @@ -493,7 +494,7 @@ top_statement: | T_USE use_type use_declarations ';' { $$ = stmt.NewUseList($2, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) @@ -829,7 +830,7 @@ statement: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5.endToken)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.SwitchToken) yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) @@ -852,7 +853,7 @@ statement: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ContinueToken) yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) @@ -860,10 +861,10 @@ statement: | T_RETURN optional_expr ';' { $$ = stmt.NewReturn($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ReturnToken) yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) @@ -871,10 +872,10 @@ statement: | T_GLOBAL global_var_list ';' { $$ = stmt.NewGlobal($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.GlobalToken) yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) @@ -882,10 +883,10 @@ statement: | T_STATIC static_var_list ';' { $$ = stmt.NewStatic($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) @@ -893,10 +894,10 @@ statement: | T_ECHO echo_expr_list ';' { $$ = stmt.NewEcho($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.EchoToken) yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) @@ -904,17 +905,17 @@ statement: | T_INLINE_HTML { $$ = stmt.NewInlineHtml($1.Value) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.InlineHTMLToken) } | expr ';' { $$ = stmt.NewExpression($1) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) @@ -924,10 +925,10 @@ statement: | T_UNSET '(' unset_variables possible_comma ')' ';' { $$ = stmt.NewUnset($3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.UnsetToken) yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) @@ -944,10 +945,10 @@ statement: } else { $$ = stmt.NewForeach($3, nil, $5.node, $7.node, $5.byRef) } - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7.node)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForeachToken) yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) @@ -961,10 +962,10 @@ statement: } else { $$ = stmt.NewForeach($3, $5, $7.node, $9.node, $7.byRef) } - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9.node)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForeachToken) yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) @@ -975,10 +976,10 @@ statement: | T_DECLARE '(' const_list ')' declare_statement { $$ = stmt.NewDeclare($3, $5) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DeclareToken) yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) @@ -987,7 +988,7 @@ statement: | ';' { $$ = stmt.NewNop() - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) @@ -1093,7 +1094,7 @@ finally_statement: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FinallyToken) yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) @@ -1164,7 +1165,7 @@ class_declaration_statement: // save position yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $9)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.ClassToken) yylex.(*Parser).comments.AddFromToken(name, $3, comment.StringToken) @@ -1257,7 +1258,7 @@ interface_declaration_statement: // save position yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.InterfaceToken) yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringToken) @@ -1388,7 +1389,7 @@ declare_statement: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) yylex.(*Parser).comments.AddFromToken($$, $3, comment.EnddeclareToken) @@ -1425,7 +1426,7 @@ case_list: // save position yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) - + // save comments yylex.(*Parser).comments.AddFromToken(_default, $2, comment.DefaultToken) yylex.(*Parser).comments.AddFromToken(_default, $3, comment.CaseSeparatorToken) @@ -1470,7 +1471,7 @@ if_stmt_without_else: yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) } | if_stmt_without_else T_ELSEIF '(' expr ')' statement - { + { _elseIf := stmt.NewElseIf($4, $6) $$ = $1.(*stmt.If).AddElseIf(_elseIf) @@ -1504,7 +1505,7 @@ if_stmt: alt_if_stmt_without_else: T_IF '(' expr ')' ':' inner_statement_list - { + { stmts := stmt.NewStmtList($6) $$ = stmt.NewAltIf($3, stmts, nil, nil) @@ -1543,7 +1544,7 @@ alt_if_stmt: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.EndifToken) yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) @@ -1692,7 +1693,7 @@ type: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayToken) } @@ -1702,7 +1703,7 @@ type: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.CallableToken) } @@ -1724,9 +1725,19 @@ return_type: argument_list: '(' ')' - { $$ = &nodesWithEndToken{[]node.Node{}, $2} } + { + $$ = node.NewArgumentList(nil) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + } | '(' non_empty_argument_list possible_comma ')' - { $$ = &nodesWithEndToken{$2, $4} } + { + $$ = node.NewArgumentList($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + } ; non_empty_argument_list: @@ -1833,7 +1844,7 @@ class_statement: variable_modifiers property_list ';' { $$ = stmt.NewPropertyList($1, $2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) @@ -1843,7 +1854,7 @@ class_statement: | method_modifiers T_CONST class_const_list ';' { $$ = stmt.NewClassConstList($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $4)) @@ -1854,7 +1865,7 @@ class_statement: | T_USE name_list trait_adaptations { $$ = stmt.NewTraitUse($2, $3.nodes) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3.endToken)) @@ -1865,7 +1876,7 @@ class_statement: { name := node.NewIdentifier($4.Value) $$ = stmt.NewClassMethod(name, $1, $3.value, $7, $9, $10.nodes, $5) - + // save position yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $10.endToken)) @@ -1882,7 +1893,7 @@ class_statement: ; name_list: - name + name { $$ = []node.Node{$1} } | name_list ',' name { @@ -1948,7 +1959,7 @@ trait_alias: // save position yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) yylex.(*Parser).comments.AddFromToken(alias, $3, comment.StringToken) @@ -1961,7 +1972,7 @@ trait_alias: // save position yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) yylex.(*Parser).comments.AddFromToken(alias, $3, comment.StringToken) @@ -1974,7 +1985,7 @@ trait_alias: // save position yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) yylex.(*Parser).comments.AddFromToken(alias, $4, comment.IdentifierToken) @@ -1985,7 +1996,7 @@ trait_alias: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) } @@ -2000,7 +2011,7 @@ trait_method_reference: // save position yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken(name, $1, comment.IdentifierToken) } @@ -2017,7 +2028,7 @@ absolute_trait_method_reference: // save position yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) yylex.(*Parser).comments.AddFromToken(target, $3, comment.IdentifierToken) @@ -2039,7 +2050,7 @@ variable_modifiers: // save position yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken(modifier, $1, comment.VarToken) } @@ -2066,7 +2077,7 @@ member_modifier: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.PublicToken) } @@ -2076,7 +2087,7 @@ member_modifier: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ProtectedToken) } @@ -2086,7 +2097,7 @@ member_modifier: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.PrivateToken) } @@ -2096,7 +2107,7 @@ member_modifier: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) } @@ -2106,7 +2117,7 @@ member_modifier: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.AbstractToken) } @@ -2116,7 +2127,7 @@ member_modifier: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FinalToken) } @@ -2250,7 +2261,7 @@ anonymous_class: T_CLASS ctor_arguments extends_from implements_list backup_doc_comment '{' class_statement_list '}' { if $2 != nil { - $$ = stmt.NewClass(nil, nil, $2.nodes, $3, $4, $7, $5) + $$ = stmt.NewClass(nil, nil, $2.(*node.ArgumentList), $3, $4, $7, $5) } else { $$ = stmt.NewClass(nil, nil, nil, $3, $4, $7, $5) } @@ -2275,8 +2286,8 @@ new_expr: T_NEW class_name_reference ctor_arguments { if $3 != nil { - $$ = expr.NewNew($2, $3.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3.endToken)) + $$ = expr.NewNew($2, $3.(*node.ArgumentList)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) } else { $$ = expr.NewNew($2, nil) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) @@ -2330,7 +2341,7 @@ expr_without_variable: | variable '=' expr { $$ = assign.NewAssign($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) @@ -2340,7 +2351,7 @@ expr_without_variable: | variable '=' '&' expr { $$ = assign.NewReference($1, $4) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) @@ -2351,17 +2362,17 @@ expr_without_variable: | T_CLONE expr { $$ = expr.NewClone($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.CloneToken) } | variable T_PLUS_EQUAL expr { $$ = assign.NewPlus($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) @@ -2371,7 +2382,7 @@ expr_without_variable: | variable T_MINUS_EQUAL expr { $$ = assign.NewMinus($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) @@ -2381,7 +2392,7 @@ expr_without_variable: | variable T_MUL_EQUAL expr { $$ = assign.NewMul($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) @@ -2391,7 +2402,7 @@ expr_without_variable: | variable T_POW_EQUAL expr { $$ = assign.NewPow($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) @@ -2401,7 +2412,7 @@ expr_without_variable: | variable T_DIV_EQUAL expr { $$ = assign.NewDiv($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) @@ -2411,7 +2422,7 @@ expr_without_variable: | variable T_CONCAT_EQUAL expr { $$ = assign.NewConcat($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) @@ -2421,7 +2432,7 @@ expr_without_variable: | variable T_MOD_EQUAL expr { $$ = assign.NewMod($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) @@ -2431,7 +2442,7 @@ expr_without_variable: | variable T_AND_EQUAL expr { $$ = assign.NewBitwiseAnd($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) @@ -2441,7 +2452,7 @@ expr_without_variable: | variable T_OR_EQUAL expr { $$ = assign.NewBitwiseOr($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) @@ -2451,7 +2462,7 @@ expr_without_variable: | variable T_XOR_EQUAL expr { $$ = assign.NewBitwiseXor($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) @@ -2461,7 +2472,7 @@ expr_without_variable: | variable T_SL_EQUAL expr { $$ = assign.NewShiftLeft($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) @@ -2471,7 +2482,7 @@ expr_without_variable: | variable T_SR_EQUAL expr { $$ = assign.NewShiftRight($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) @@ -2481,217 +2492,217 @@ expr_without_variable: | variable T_INC { $$ = expr.NewPostInc($1) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IncToken) } | T_INC variable { $$ = expr.NewPreInc($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncToken) } | variable T_DEC { $$ = expr.NewPostDec($1) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.DecToken) } | T_DEC variable { $$ = expr.NewPreDec($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DecToken) } | expr T_BOOLEAN_OR expr { $$ = binary.NewBooleanOr($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanOrToken) } | expr T_BOOLEAN_AND expr { $$ = binary.NewBooleanAnd($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanAndToken) } | expr T_LOGICAL_OR expr { $$ = binary.NewLogicalOr($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalOrToken) } | expr T_LOGICAL_AND expr { $$ = binary.NewLogicalAnd($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalAndToken) } | expr T_LOGICAL_XOR expr { $$ = binary.NewLogicalXor($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalXorToken) } | expr '|' expr { $$ = binary.NewBitwiseOr($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.VerticalBarToken) } | expr '&' expr { $$ = binary.NewBitwiseAnd($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) } | expr '^' expr { $$ = binary.NewBitwiseXor($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.CaretToken) } | expr '.' expr { $$ = binary.NewConcat($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.DotToken) } | expr '+' expr { $$ = binary.NewPlus($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PlusToken) } | expr '-' expr { $$ = binary.NewMinus($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.MinusToken) } | expr '*' expr { $$ = binary.NewMul($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsteriskToken) } | expr T_POW expr { $$ = binary.NewPow($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PowToken) } | expr '/' expr { $$ = binary.NewDiv($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlashToken) } | expr '%' expr { $$ = binary.NewMod($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PercentToken) } | expr T_SL expr { $$ = binary.NewShiftLeft($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlToken) } | expr T_SR expr { $$ = binary.NewShiftRight($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SrToken) } | '+' expr %prec T_INC { $$ = expr.NewUnaryPlus($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) @@ -2701,7 +2712,7 @@ expr_without_variable: | '-' expr %prec T_INC { $$ = expr.NewUnaryMinus($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) @@ -2711,7 +2722,7 @@ expr_without_variable: | '!' expr { $$ = expr.NewBooleanNot($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) @@ -2721,7 +2732,7 @@ expr_without_variable: | '~' expr { $$ = expr.NewBitwiseNot($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) @@ -2731,107 +2742,107 @@ expr_without_variable: | expr T_IS_IDENTICAL expr { $$ = binary.NewIdentical($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsIdenticalToken) } | expr T_IS_NOT_IDENTICAL expr { $$ = binary.NewNotIdentical($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotIdenticalToken) } | expr T_IS_EQUAL expr { $$ = binary.NewEqual($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsEqualToken) } | expr T_IS_NOT_EQUAL expr { $$ = binary.NewNotEqual($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotEqualToken) } | expr '<' expr { $$ = binary.NewSmaller($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.LessToken) } | expr T_IS_SMALLER_OR_EQUAL expr { $$ = binary.NewSmallerOrEqual($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsSmallerOrEqualToken) } | expr '>' expr { $$ = binary.NewGreater($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.GreaterToken) } | expr T_IS_GREATER_OR_EQUAL expr { $$ = binary.NewGreaterOrEqual($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsGreaterOrEqualToken) } | expr T_SPACESHIP expr { $$ = binary.NewSpaceship($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.SpaceshipToken) } | expr T_INSTANCEOF class_name_reference { $$ = expr.NewInstanceOf($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.InstanceofToken) } | '(' expr ')' { $$ = $2; - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) @@ -2841,10 +2852,10 @@ expr_without_variable: | expr '?' expr ':' expr { $$ = expr.NewTernary($1, $3, $5) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) yylex.(*Parser).comments.AddFromToken($$, $4, comment.ColonToken) @@ -2852,10 +2863,10 @@ expr_without_variable: | expr '?' ':' expr { $$ = expr.NewTernary($1, nil, $4) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) yylex.(*Parser).comments.AddFromToken($$, $3, comment.ColonToken) @@ -2863,10 +2874,10 @@ expr_without_variable: | expr T_COALESCE expr { $$ = binary.NewCoalesce($1, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.CoalesceToken) } @@ -2875,70 +2886,70 @@ expr_without_variable: | T_INT_CAST expr { $$ = cast.NewInt($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.IntCastToken) } | T_DOUBLE_CAST expr { $$ = cast.NewDouble($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoubleCastToken) } | T_STRING_CAST expr { $$ = cast.NewString($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringCastToken) } | T_ARRAY_CAST expr { $$ = cast.NewArray($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayCastToken) } | T_OBJECT_CAST expr { $$ = cast.NewObject($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ObjectCastToken) } | T_BOOL_CAST expr { $$ = cast.NewBool($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.BoolCastToken) } | T_UNSET_CAST expr { $$ = cast.NewUnset($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.UnsetCastToken) } @@ -2949,20 +2960,20 @@ expr_without_variable: } else { $$ = expr.NewExit($2) } - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExitToken) } | '@' expr { $$ = expr.NewErrorSuppress($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.AtToken) } @@ -2971,10 +2982,10 @@ expr_without_variable: | '`' backticks_expr '`' { $$ = expr.NewShellExec($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.BackquoteToken) yylex.(*Parser).comments.AddFromToken($$, $3, comment.BackquoteToken) @@ -2982,40 +2993,40 @@ expr_without_variable: | T_PRINT expr { $$ = expr.NewPrint($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.PrintToken) } | T_YIELD { $$ = expr.NewYield(nil, nil) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) } | T_YIELD expr { $$ = expr.NewYield(nil, $2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) } | T_YIELD expr T_DOUBLE_ARROW expr { $$ = expr.NewYield($2, $4) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) yylex.(*Parser).comments.AddFromToken($$, $3, comment.DoubleArrowToken) @@ -3023,17 +3034,17 @@ expr_without_variable: | T_YIELD_FROM expr { $$ = expr.NewYieldFrom($2) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldFromToken) } | T_FUNCTION returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars return_type '{' inner_statement_list '}' { $$ = expr.NewClosure($5, $7, $8, $10, false, $2.value, $3) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) @@ -3050,7 +3061,7 @@ expr_without_variable: | T_STATIC T_FUNCTION returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars return_type '{' inner_statement_list '}' { $$ = expr.NewClosure($6, $8, $9, $11, true, $3.value, $4) - + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $12)) @@ -3136,37 +3147,37 @@ lexical_var: function_call: name argument_list { - $$ = expr.NewFunctionCall($1, $2.nodes) + $$ = expr.NewFunctionCall($1, $2.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2.endToken)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) } | class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list { - $$ = expr.NewStaticCall($1, $3, $4.nodes) + $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list { - $$ = expr.NewStaticCall($1, $3, $4.nodes) + $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } | callable_expr argument_list { - $$ = expr.NewFunctionCall($1, $2.nodes) + $$ = expr.NewFunctionCall($1, $2.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2.endToken)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) } ; @@ -3222,7 +3233,7 @@ dereferencable_scalar: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayToken) yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) @@ -3234,7 +3245,7 @@ dereferencable_scalar: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenSquareBracket) yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseSquareBracket) @@ -3245,7 +3256,7 @@ dereferencable_scalar: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstantEncapsedStringToken) } @@ -3258,7 +3269,7 @@ scalar: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.LnumberToken) } @@ -3268,7 +3279,7 @@ scalar: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DnumberToken) } @@ -3278,7 +3289,7 @@ scalar: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.LineToken) } @@ -3288,7 +3299,7 @@ scalar: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FileToken) } @@ -3298,7 +3309,7 @@ scalar: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DirToken) } @@ -3308,7 +3319,7 @@ scalar: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.TraitCToken) } @@ -3318,7 +3329,7 @@ scalar: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.MethodCToken) } @@ -3328,7 +3339,7 @@ scalar: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FuncCToken) } @@ -3338,7 +3349,7 @@ scalar: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsCToken) } @@ -3348,7 +3359,7 @@ scalar: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassCToken) } @@ -3370,7 +3381,7 @@ scalar: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) } @@ -3380,7 +3391,7 @@ scalar: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoubleQuoteToken) } @@ -3390,7 +3401,7 @@ scalar: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) } @@ -3461,7 +3472,7 @@ dereferencable: | '(' expr ')' { $$ = $2; - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) @@ -3476,7 +3487,7 @@ callable_expr: | '(' expr ')' { $$ = $2; - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) @@ -3523,10 +3534,10 @@ callable_variable: } | dereferencable T_OBJECT_OPERATOR property_name argument_list { - $$ = expr.NewMethodCall($1, $3, $4.nodes) + $$ = expr.NewMethodCall($1, $3, $4.(*node.ArgumentList)) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.ObjectOperatorToken) @@ -3546,7 +3557,7 @@ variable: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.ObjectOperatorToken) } @@ -3561,7 +3572,7 @@ simple_variable: // save position yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) } @@ -3571,7 +3582,7 @@ simple_variable: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarToken) yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) @@ -3583,7 +3594,7 @@ simple_variable: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarToken) } @@ -3699,7 +3710,7 @@ property_name: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringToken) } @@ -3827,11 +3838,11 @@ encaps_list: // save position yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - + // save comments yylex.(*Parser).comments.AddFromToken(encapsed, $2, comment.EncapsedAndWhitespaceToken) } - | encaps_var + | encaps_var { $$ = []node.Node{$1} } | T_ENCAPSED_AND_WHITESPACE encaps_var { @@ -3840,7 +3851,7 @@ encaps_list: // save position yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken(encapsed, $1, comment.EncapsedAndWhitespaceToken) } @@ -3887,7 +3898,7 @@ encaps_var: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) yylex.(*Parser).comments.AddFromToken($$, $2, comment.ObjectOperatorToken) @@ -3899,7 +3910,7 @@ encaps_var: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) @@ -3948,7 +3959,7 @@ encaps_var_offset: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringToken) } @@ -3963,7 +3974,7 @@ encaps_var_offset: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.NumStringToken) } diff --git a/php7/php7_test.go b/php7/php7_test.go index 3b3c49c..0d0056a 100644 --- a/php7/php7_test.go +++ b/php7/php7_test.go @@ -402,18 +402,22 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Expr: &expr.FunctionCall{ Function: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, &stmt.Expression{ Expr: &expr.FunctionCall{ Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, @@ -421,9 +425,11 @@ func TestPhp7(t *testing.T) { Expr: &expr.MethodCall{ Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, Method: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, @@ -431,9 +437,11 @@ func TestPhp7(t *testing.T) { Expr: &expr.StaticCall{ Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, @@ -441,18 +449,22 @@ func TestPhp7(t *testing.T) { Expr: &expr.StaticCall{ Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, &stmt.Expression{ Expr: &expr.New{ Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - Arguments: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, @@ -460,9 +472,11 @@ func TestPhp7(t *testing.T) { Expr: &expr.New{ Class: &stmt.Class{ PhpDocComment: "/** anonymous class */", - Args: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, Stmts: []node.Node{}, }, @@ -730,9 +744,10 @@ func TestPhp7(t *testing.T) { Parts: []node.Node{ &scalar.EncapsedStringPart{Value: "test "}, &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Method: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{}, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Method: &node.Identifier{Value: "bar"}, + + ArgumentList: &node.ArgumentList{}, }, }, }, @@ -945,7 +960,8 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Expr: &expr.New{ Class: &stmt.Class{ - Args: []node.Node{}, + + ArgumentList: &node.ArgumentList{}, Extends: &name.Name{ Parts: []node.Node{ &name.NamePart{Value: "foo"}, @@ -2168,7 +2184,8 @@ func TestPhp7(t *testing.T) { &name.NamePart{Value: "foo"}, }, }, - Arguments: []node.Node{}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2178,7 +2195,8 @@ func TestPhp7(t *testing.T) { &name.NamePart{Value: "foo"}, }, }, - Arguments: []node.Node{}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2188,13 +2206,15 @@ func TestPhp7(t *testing.T) { &name.NamePart{Value: "foo"}, }, }, - Arguments: []node.Node{}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ Expr: &expr.FunctionCall{ - Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Arguments: []node.Node{}, + Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2325,9 +2345,10 @@ func TestPhp7(t *testing.T) { }, &stmt.Expression{ Expr: &expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Method: &node.Identifier{Value: "foo"}, - Arguments: []node.Node{}, + Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Method: &node.Identifier{Value: "foo"}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2337,7 +2358,8 @@ func TestPhp7(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Arguments: []node.Node{}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2347,7 +2369,8 @@ func TestPhp7(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Arguments: []node.Node{}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2357,16 +2380,20 @@ func TestPhp7(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Arguments: []node.Node{}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ Expr: &expr.New{ Class: &stmt.Class{ PhpDocComment: "", - Args: []node.Node{ - &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, Stmts: []node.Node{}, }, @@ -2488,8 +2515,9 @@ func TestPhp7(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{}, + Call: &node.Identifier{Value: "bar"}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2499,8 +2527,9 @@ func TestPhp7(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{}, + Call: &node.Identifier{Value: "bar"}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2510,8 +2539,9 @@ func TestPhp7(t *testing.T) { &name.NamePart{Value: "Foo"}, }, }, - Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{}, + Call: &node.Identifier{Value: "bar"}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -2931,7 +2961,8 @@ func TestPhp7(t *testing.T) { &name.NamePart{Value: "bar"}, }, }, - Arguments: []node.Node{}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Function{ @@ -3048,7 +3079,8 @@ func TestPhp7(t *testing.T) { Function: &expr.New{ Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, }, - Arguments: []node.Node{}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -3064,7 +3096,8 @@ func TestPhp7(t *testing.T) { }, Dim: &scalar.Lnumber{Value: "0"}, }, - Arguments: []node.Node{}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -3075,13 +3108,15 @@ func TestPhp7(t *testing.T) { }, Dim: &scalar.Lnumber{Value: "1"}, }, - Arguments: []node.Node{}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ Expr: &expr.FunctionCall{ - Function: &scalar.String{Value: "\"foo\""}, - Arguments: []node.Node{}, + Function: &scalar.String{Value: "\"foo\""}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -3097,22 +3132,25 @@ func TestPhp7(t *testing.T) { }, Dim: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, }, - Arguments: []node.Node{}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ Expr: &expr.Variable{ VarName: &expr.FunctionCall{ - Function: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, - Arguments: []node.Node{}, + Function: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}}, + + ArgumentList: &node.ArgumentList{}, }, }, }, &stmt.Expression{ Expr: &expr.StaticCall{ - Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, - Arguments: []node.Node{}, + Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, + Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ @@ -3122,7 +3160,8 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, Dim: &scalar.Lnumber{Value: "0"}, }, - Arguments: []node.Node{}, + + ArgumentList: &node.ArgumentList{}, }, }, &stmt.Expression{ diff --git a/printer/printer.go b/printer/printer.go index 231c855..b4ed6a8 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1097,7 +1097,7 @@ func (p *Printer) printExprFunctionCall(n node.Node) { p.Print(nn.Function) io.WriteString(p.w, "(") - p.joinPrint(", ", nn.Arguments) + p.joinPrint(", ", nn.ArgumentList.Arguments) io.WriteString(p.w, ")") } @@ -1146,7 +1146,7 @@ func (p *Printer) printExprMethodCall(n node.Node) { io.WriteString(p.w, "->") p.Print(nn.Method) io.WriteString(p.w, "(") - p.joinPrint(", ", nn.Arguments) + p.joinPrint(", ", nn.ArgumentList.Arguments) io.WriteString(p.w, ")") } @@ -1156,9 +1156,9 @@ func (p *Printer) printExprNew(n node.Node) { io.WriteString(p.w, "new ") p.Print(nn.Class) - if nn.Arguments != nil { + if nn.ArgumentList != nil { io.WriteString(p.w, "(") - p.joinPrint(", ", nn.Arguments) + p.joinPrint(", ", nn.ArgumentList.Arguments) io.WriteString(p.w, ")") } } @@ -1254,7 +1254,7 @@ func (p *Printer) printExprStaticCall(n node.Node) { io.WriteString(p.w, "::") p.Print(nn.Call) io.WriteString(p.w, "(") - p.joinPrint(", ", nn.Arguments) + p.joinPrint(", ", nn.ArgumentList.Arguments) io.WriteString(p.w, ")") } @@ -1536,9 +1536,9 @@ func (p *Printer) printStmtClass(n node.Node) { p.Print(nn.ClassName) } - if nn.Args != nil { + if nn.ArgumentList != nil { io.WriteString(p.w, "(") - p.joinPrint(", ", nn.Args) + p.joinPrint(", ", nn.ArgumentList.Arguments) io.WriteString(p.w, ")") } diff --git a/printer/printer_test.go b/printer/printer_test.go index 38d3c54..4e32212 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -1522,17 +1522,19 @@ func TestPrintFunctionCall(t *testing.T) { p := printer.NewPrinter(o, " ") p.Print(&expr.FunctionCall{ Function: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Arguments: []node.Node{ - &node.Argument{ - IsReference: true, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - &node.Argument{ - Variadic: true, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - }, - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + IsReference: true, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + &node.Argument{ + Variadic: true, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + }, }, }, }) @@ -1648,12 +1650,14 @@ func TestPrintMethodCall(t *testing.T) { p.Print(&expr.MethodCall{ Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, Method: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{ - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, }, }, }) @@ -1672,12 +1676,14 @@ func TestPrintNew(t *testing.T) { p := printer.NewPrinter(o, " ") p.Print(&expr.New{ Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Arguments: []node.Node{ - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, }, }, }) @@ -1901,12 +1907,14 @@ func TestPrintStaticCall(t *testing.T) { p.Print(&expr.StaticCall{ Class: &node.Identifier{Value: "Foo"}, Call: &node.Identifier{Value: "bar"}, - Arguments: []node.Node{ - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, }, }, }) @@ -2509,12 +2517,14 @@ func TestPrintStmtAnonymousClass(t *testing.T) { Stmts: []node.Node{ &stmt.Class{ Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, - Args: []node.Node{ - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - }, - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + ArgumentList: &node.ArgumentList{ + Arguments: []node.Node{ + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + &node.Argument{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + }, }, }, Extends: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, diff --git a/visitor/namespace_resolver_test.go b/visitor/namespace_resolver_test.go index 12b1f13..b84a0c4 100644 --- a/visitor/namespace_resolver_test.go +++ b/visitor/namespace_resolver_test.go @@ -43,9 +43,9 @@ func TestResolveStaticCall(t *testing.T) { }, }, &expr.StaticCall{ - Class: nameBC, - Call: &node.Identifier{Value: "foo"}, - Arguments: []node.Node{}, + Class: nameBC, + Call: &node.Identifier{Value: "foo"}, + ArgumentList: &node.ArgumentList{}, }, }, } @@ -134,8 +134,8 @@ func TestResolveNew(t *testing.T) { }, }, &expr.New{ - Class: nameBC, - Arguments: []node.Node{}, + Class: nameBC, + ArgumentList: &node.ArgumentList{}, }, }, } @@ -242,8 +242,8 @@ func TestResolveFunctionCall(t *testing.T) { }, }, &expr.FunctionCall{ - Function: nameB, - Arguments: []node.Node{}, + Function: nameB, + ArgumentList: &node.ArgumentList{}, }, }, } @@ -323,12 +323,12 @@ func TestResolveGroupUse(t *testing.T) { Constant: nameC, }, &expr.FunctionCall{ - Function: nameF, - Arguments: []node.Node{}, + Function: nameF, + ArgumentList: &node.ArgumentList{}, }, &expr.FunctionCall{ - Function: nameE, - Arguments: []node.Node{}, + Function: nameE, + ArgumentList: &node.ArgumentList{}, }, }, } @@ -658,9 +658,9 @@ func TestResolveNamespaces(t *testing.T) { }, }, &expr.StaticCall{ - Class: nameFG, - Call: &node.Identifier{Value: "foo"}, - Arguments: []node.Node{}, + Class: nameFG, + Call: &node.Identifier{Value: "foo"}, + ArgumentList: &node.ArgumentList{}, }, &stmt.Namespace{ Stmts: []node.Node{}, @@ -678,12 +678,12 @@ func TestResolveNamespaces(t *testing.T) { &expr.StaticCall{ Class: relativeNameCE, Call: &node.Identifier{Value: "foo"}, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, &expr.StaticCall{ Class: nameCF, Call: &node.Identifier{Value: "foo"}, - Arguments: []node.Node{}, + ArgumentList: &node.ArgumentList{}, }, }, }, @@ -708,9 +708,9 @@ func TestResolveStaticCallDinamicClassName(t *testing.T) { ast := &stmt.StmtList{ Stmts: []node.Node{ &expr.StaticCall{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Call: &node.Identifier{Value: "foo"}, - Arguments: []node.Node{}, + Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Call: &node.Identifier{Value: "foo"}, + ArgumentList: &node.ArgumentList{}, }, }, } From f8d9d6d7c2a3f08653d1639cdebca20bf5eb711c Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 29 Apr 2018 22:34:24 +0300 Subject: [PATCH 14/25] create TraitAdaptationList node --- node/stmt/n_trait_adaptation_list.go | 42 + node/stmt/n_trait_use.go | 18 +- node/stmt/t_trait_use_test.go | 80 +- node/stmt/t_visitor_test.go | 21 +- php5/php5.go | 1284 +++++++++++++------------- php5/php5.y | 27 +- php5/php5_test.go | 77 +- php7/php7.go | 1058 ++++++++++----------- php7/php7.y | 47 +- php7/php7_test.go | 89 +- printer/printer.go | 5 +- printer/printer_test.go | 14 +- visitor/namespace_resolver.go | 2 +- visitor/namespace_resolver_test.go | 54 +- 14 files changed, 1492 insertions(+), 1326 deletions(-) create mode 100644 node/stmt/n_trait_adaptation_list.go diff --git a/node/stmt/n_trait_adaptation_list.go b/node/stmt/n_trait_adaptation_list.go new file mode 100644 index 0000000..d2a4b73 --- /dev/null +++ b/node/stmt/n_trait_adaptation_list.go @@ -0,0 +1,42 @@ +package stmt + +import ( + "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/walker" +) + +// TraitAdaptationList node +type TraitAdaptationList struct { + Adaptations []node.Node +} + +// NewTraitAdaptationList node constructor +func NewTraitAdaptationList(Adaptations []node.Node) *TraitAdaptationList { + return &TraitAdaptationList{ + Adaptations, + } +} + +// Attributes returns node attributes as map +func (n *TraitAdaptationList) Attributes() map[string]interface{} { + return nil +} + +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true +func (n *TraitAdaptationList) Walk(v walker.Visitor) { + if v.EnterNode(n) == false { + return + } + + if n.Adaptations != nil { + vv := v.GetChildrenVisitor("Adaptations") + for _, nn := range n.Adaptations { + if nn != nil { + nn.Walk(vv) + } + } + } + + v.LeaveNode(n) +} diff --git a/node/stmt/n_trait_use.go b/node/stmt/n_trait_use.go index b5b0b87..d39dbec 100644 --- a/node/stmt/n_trait_use.go +++ b/node/stmt/n_trait_use.go @@ -7,15 +7,15 @@ import ( // TraitUse node type TraitUse struct { - Traits []node.Node - Adaptations []node.Node + Traits []node.Node + TraitAdaptationList *TraitAdaptationList } // NewTraitUse node constructor -func NewTraitUse(Traits []node.Node, Adaptations []node.Node) *TraitUse { +func NewTraitUse(Traits []node.Node, InnerAdaptationList *TraitAdaptationList) *TraitUse { return &TraitUse{ Traits, - Adaptations, + InnerAdaptationList, } } @@ -40,13 +40,9 @@ func (n *TraitUse) Walk(v walker.Visitor) { } } - if n.Adaptations != nil { - vv := v.GetChildrenVisitor("Adaptations") - for _, nn := range n.Adaptations { - if nn != nil { - nn.Walk(vv) - } - } + if n.TraitAdaptationList != nil { + vv := v.GetChildrenVisitor("TraitAdaptationList") + n.TraitAdaptationList.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/t_trait_use_test.go b/node/stmt/t_trait_use_test.go index e6b3b10..42e8a28 100644 --- a/node/stmt/t_trait_use_test.go +++ b/node/stmt/t_trait_use_test.go @@ -2,9 +2,10 @@ package stmt_test import ( "bytes" - "github.com/z7zmey/php-parser/node/name" "testing" + "github.com/z7zmey/php-parser/node/name" + "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/stmt" "github.com/z7zmey/php-parser/php5" @@ -106,6 +107,7 @@ func TestTraitsUseEmptyAdaptations(t *testing.T) { }, }, }, + TraitAdaptationList: &stmt.TraitAdaptationList{}, }, }, }, @@ -145,12 +147,14 @@ func TestTraitsUseModifier(t *testing.T) { }, }, }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Method: &node.Identifier{Value: "one"}, + TraitAdaptationList: &stmt.TraitAdaptationList{ + Adaptations: []node.Node{ + &stmt.TraitUseAlias{ + Ref: &stmt.TraitMethodRef{ + Method: &node.Identifier{Value: "one"}, + }, + Modifier: &node.Identifier{Value: "public"}, }, - Modifier: &node.Identifier{Value: "public"}, }, }, }, @@ -192,13 +196,15 @@ func TestTraitsUseAliasModifier(t *testing.T) { }, }, }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Method: &node.Identifier{Value: "one"}, + TraitAdaptationList: &stmt.TraitAdaptationList{ + Adaptations: []node.Node{ + &stmt.TraitUseAlias{ + Ref: &stmt.TraitMethodRef{ + Method: &node.Identifier{Value: "one"}, + }, + Modifier: &node.Identifier{Value: "public"}, + Alias: &node.Identifier{Value: "two"}, }, - Modifier: &node.Identifier{Value: "public"}, - Alias: &node.Identifier{Value: "two"}, }, }, }, @@ -240,39 +246,41 @@ func TestTraitsUseAdaptions(t *testing.T) { }, }, }, - Adaptations: []node.Node{ - &stmt.TraitUsePrecedence{ - Ref: &stmt.TraitMethodRef{ - Trait: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + TraitAdaptationList: &stmt.TraitAdaptationList{ + Adaptations: []node.Node{ + &stmt.TraitUsePrecedence{ + Ref: &stmt.TraitMethodRef{ + Trait: &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Bar"}, + }, }, + Method: &node.Identifier{Value: "one"}, }, - Method: &node.Identifier{Value: "one"}, - }, - Insteadof: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + Insteadof: []node.Node{ + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Baz"}, + }, }, - }, - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Quux"}, + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Quux"}, + }, }, }, }, - }, - &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Trait: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &stmt.TraitUseAlias{ + Ref: &stmt.TraitMethodRef{ + Trait: &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Baz"}, + }, }, + Method: &node.Identifier{Value: "one"}, }, - Method: &node.Identifier{Value: "one"}, + Alias: &node.Identifier{Value: "two"}, }, - Alias: &node.Identifier{Value: "two"}, }, }, }, diff --git a/node/stmt/t_visitor_test.go b/node/stmt/t_visitor_test.go index 0ec5c3c..d0cc7e1 100644 --- a/node/stmt/t_visitor_test.go +++ b/node/stmt/t_visitor_test.go @@ -92,10 +92,10 @@ var nodesToTest = []struct { PhpDocComment: "/** */", ClassName: &node.Identifier{}, Modifiers: []node.Node{&stmt.Expression{}}, - ArgumentList: &node.ArgumentList{}, - Extends: &node.Identifier{}, - Implements: []node.Node{&stmt.Expression{}}, - Stmts: []node.Node{&stmt.Expression{}}, + ArgumentList: &node.ArgumentList{}, + Extends: &node.Identifier{}, + Implements: []node.Node{&stmt.Expression{}}, + Stmts: []node.Node{&stmt.Expression{}}, }, []string{"ClassName", "Modifiers", "ArgumentList", "Extends", "Implements", "Stmts"}, map[string]interface{}{"PhpDocComment": "/** */"}, @@ -408,10 +408,10 @@ var nodesToTest = []struct { }, { &stmt.TraitUse{ - Traits: []node.Node{&stmt.Expression{}}, - Adaptations: []node.Node{&stmt.Expression{}}, + Traits: []node.Node{&stmt.Expression{}}, + TraitAdaptationList: &stmt.TraitAdaptationList{}, }, - []string{"Traits", "Adaptations"}, + []string{"Traits", "TraitAdaptationList"}, map[string]interface{}{}, }, { @@ -479,6 +479,13 @@ var nodesToTest = []struct { []string{"Stmts"}, map[string]interface{}{}, }, + { + &stmt.TraitAdaptationList{ + Adaptations: []node.Node{&stmt.TraitUsePrecedence{}}, + }, + []string{"Adaptations"}, + map[string]interface{}{}, + }, } type visitorMock struct { diff --git a/php5/php5.go b/php5/php5.go index 7e0c848..169557a 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -344,7 +344,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:3873 +//line php5/php5.y:3890 type foreachVariable struct { node node.Node @@ -712,18 +712,18 @@ var yyAct = [...]int{ 531, 922, 481, 259, 283, 908, 449, 395, 256, 39, 446, 324, 521, 936, 203, 285, 260, 261, 469, 260, 261, 232, 202, 199, 136, 879, 909, 531, 260, 261, - 944, 519, 521, 335, 231, 521, 873, 829, 521, 938, - 572, 962, 572, 970, 39, 1008, 39, 812, 703, 704, - 706, 703, 704, 343, 39, 747, 39, 39, 753, 863, - 521, 445, 608, 260, 261, 572, 970, 260, 261, 956, - 982, 589, 958, 39, 590, 961, 591, 39, 39, 521, - 684, 572, 255, 839, 993, 994, 572, 995, 964, 997, - 963, 902, 483, 403, 914, 895, 916, 979, 838, 448, - 835, 575, 39, 572, 1011, 531, 924, 566, 926, 927, - 1012, 531, 531, 1005, 572, 1015, 992, 1004, 724, 919, - 39, 232, 919, 232, 394, 558, 389, 164, 341, 697, - 538, 943, 928, 290, 231, 947, 231, 460, 948, 531, - 161, 157, 318, 314, 39, 127, 528, 607, 996, 969, + 944, 519, 521, 335, 231, 521, 873, 829, 521, 1008, + 572, 962, 572, 970, 39, 343, 39, 812, 703, 704, + 706, 703, 704, 747, 39, 753, 39, 39, 863, 445, + 521, 608, 589, 260, 261, 572, 970, 260, 261, 956, + 982, 590, 958, 39, 591, 961, 684, 39, 39, 521, + 255, 572, 839, 994, 993, 964, 572, 995, 963, 997, + 902, 483, 403, 895, 914, 838, 916, 979, 835, 448, + 575, 566, 39, 572, 1011, 531, 924, 1005, 926, 927, + 1012, 531, 531, 1004, 572, 1015, 992, 724, 394, 919, + 39, 232, 919, 232, 389, 558, 164, 341, 697, 538, + 928, 943, 290, 460, 231, 947, 231, 161, 948, 531, + 157, 318, 314, 127, 39, 938, 528, 607, 996, 969, 39, 968, 945, 967, 966, 837, 836, 834, 401, 40, 568, 15, 14, 822, 972, 719, 801, 694, 11, 249, 75, 232, 76, 116, 266, 64, 89, 598, 90, 520, @@ -1638,41 +1638,41 @@ var yyPgo = [...]int{ 73, 68, 61, 1068, 1067, 1066, 35, 1065, 1063, 4, 1062, 1061, 1060, 17, 1059, 1058, 1057, 1056, 1055, 51, 5, 1054, 1053, 1051, 1049, 1048, 2, 1047, 631, 1046, - 18, 22, 39, 0, 1045, 1043, 1042, 117, 1041, 1040, - 553, 1037, 1033, 42, 8, 1032, 9, 1030, 1029, 1028, - 14, 49, 1027, 1026, 1024, 1018, 1017, 1013, 3, 1007, - 16, 1001, 1000, 998, 995, 993, 28, 992, 991, 990, - 988, 985, 983, 982, 21, 980, 976, 974, 25, 971, - 23, 12, 962, 40, 961, 959, 958, 955, 41, 6, - 19, 953, 945, 939, 13, 937, 933, 930, 15, 853, + 18, 22, 1045, 39, 0, 1043, 1042, 1041, 117, 1040, + 1037, 553, 1033, 1032, 42, 8, 1030, 9, 1029, 1028, + 1027, 14, 49, 1026, 1024, 1018, 1017, 1013, 1007, 3, + 1001, 16, 1000, 998, 995, 993, 992, 28, 991, 990, + 988, 985, 983, 982, 980, 21, 976, 974, 971, 25, + 962, 23, 12, 961, 40, 959, 958, 955, 953, 41, + 6, 19, 945, 939, 13, 937, 933, 930, 15, 853, 7, 20, } var yyR1 = [...]int{ - 0, 149, 82, 82, 83, 83, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 84, 84, - 4, 4, 4, 4, 85, 85, 5, 5, 5, 5, - 86, 86, 6, 6, 6, 6, 53, 53, 87, 87, + 0, 149, 83, 83, 84, 84, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 85, 85, + 4, 4, 4, 4, 86, 86, 5, 5, 5, 5, + 87, 87, 6, 6, 6, 6, 53, 53, 88, 88, 24, 24, 24, 24, 24, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 105, 105, 58, 58, 106, - 106, 107, 107, 59, 103, 103, 56, 51, 52, 144, + 26, 26, 26, 26, 26, 106, 106, 58, 58, 107, + 107, 108, 108, 59, 104, 104, 56, 51, 52, 144, 144, 145, 145, 60, 61, 61, 64, 64, 64, 64, - 65, 65, 2, 115, 115, 111, 111, 116, 116, 140, - 140, 139, 139, 139, 147, 147, 148, 148, 57, 57, - 104, 104, 141, 141, 141, 141, 101, 101, 101, 150, - 150, 146, 146, 97, 97, 98, 98, 54, 54, 55, - 55, 108, 108, 109, 109, 63, 63, 62, 62, 62, - 62, 81, 81, 81, 117, 117, 69, 69, 69, 69, - 88, 88, 27, 27, 27, 89, 89, 89, 89, 110, - 110, 66, 66, 66, 66, 68, 118, 118, 143, 143, - 119, 119, 120, 120, 70, 70, 71, 121, 121, 74, - 74, 73, 72, 72, 75, 75, 142, 142, 112, 112, - 113, 113, 122, 122, 76, 76, 76, 76, 76, 76, - 114, 114, 114, 114, 67, 67, 102, 102, 100, 100, - 99, 99, 128, 128, 126, 126, 127, 127, 127, 129, - 129, 42, 15, 15, 15, 15, 15, 15, 15, 15, + 65, 65, 2, 116, 116, 112, 112, 117, 117, 141, + 141, 140, 140, 140, 147, 147, 148, 148, 57, 57, + 105, 105, 142, 142, 142, 142, 102, 102, 102, 150, + 150, 146, 146, 98, 98, 99, 99, 54, 54, 55, + 55, 109, 109, 110, 110, 63, 63, 62, 62, 62, + 62, 81, 81, 81, 118, 118, 69, 69, 69, 69, + 89, 89, 27, 27, 27, 90, 90, 90, 90, 111, + 111, 66, 66, 66, 66, 68, 119, 119, 82, 82, + 120, 120, 121, 121, 70, 70, 71, 122, 122, 74, + 74, 73, 72, 72, 75, 75, 143, 143, 113, 113, + 114, 114, 123, 123, 76, 76, 76, 76, 76, 76, + 115, 115, 115, 115, 67, 67, 103, 103, 101, 101, + 100, 100, 129, 129, 127, 127, 128, 128, 128, 130, + 130, 42, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, @@ -1680,27 +1680,27 @@ var yyR1 = [...]int{ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 50, 50, 50, 50, - 47, 47, 47, 47, 46, 46, 1, 96, 96, 95, - 95, 95, 95, 23, 23, 23, 23, 23, 23, 23, + 47, 47, 47, 47, 46, 46, 1, 97, 97, 96, + 96, 96, 96, 23, 23, 23, 23, 23, 23, 23, 23, 11, 11, 11, 11, 45, 45, 45, 43, 43, - 41, 41, 136, 136, 135, 49, 49, 49, 123, 123, - 123, 80, 80, 7, 7, 7, 7, 7, 7, 7, + 41, 41, 137, 137, 136, 49, 49, 49, 124, 124, + 124, 80, 80, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 28, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 35, 35, 35, 35, 29, 29, 29, 29, 29, 29, - 29, 124, 124, 151, 151, 125, 125, 125, 125, 14, - 14, 48, 48, 16, 17, 18, 19, 19, 137, 137, - 130, 132, 132, 77, 131, 131, 131, 40, 40, 44, + 29, 125, 125, 151, 151, 126, 126, 126, 126, 14, + 14, 48, 48, 16, 17, 18, 19, 19, 138, 138, + 131, 133, 133, 77, 132, 132, 132, 40, 40, 44, 44, 12, 22, 22, 20, 20, 20, 21, 21, 21, - 10, 10, 10, 9, 9, 13, 13, 133, 133, 134, - 134, 134, 39, 39, 138, 138, 94, 94, 38, 38, - 38, 93, 93, 92, 92, 92, 92, 92, 92, 92, - 92, 90, 90, 90, 90, 33, 33, 33, 33, 33, + 10, 10, 10, 9, 9, 13, 13, 134, 134, 135, + 135, 135, 39, 39, 139, 139, 95, 95, 38, 38, + 38, 94, 94, 93, 93, 93, 93, 93, 93, 93, + 93, 91, 91, 91, 91, 33, 33, 33, 33, 33, 33, 34, 34, 34, 37, 37, 37, 37, 37, 37, - 37, 37, 91, 91, 36, 36, 30, 30, 31, 32, + 37, 37, 92, 92, 36, 36, 30, 30, 31, 32, } var yyR2 = [...]int{ @@ -1759,7 +1759,7 @@ var yyR2 = [...]int{ } var yyChk = [...]int{ - -1000, -149, -82, -3, 2, -25, -51, -52, 51, 79, + -1000, -149, -83, -3, 2, -25, -51, -52, 51, 79, 44, -53, -26, 10, -60, -61, 38, 142, 7, 21, 20, 23, 30, 34, 35, 39, -50, 46, 98, 19, 14, -14, 48, 25, 27, 144, 40, 43, 36, -1, @@ -1769,99 +1769,99 @@ var yyChk = [...]int{ 112, 113, 6, 156, -29, -47, -46, 141, 96, -20, 91, 49, 50, 4, 5, 84, 85, 86, 11, -35, -32, -7, 140, 74, 62, 18, 60, 148, -21, -22, - -23, -30, -83, 82, -11, 8, 9, 66, 67, 81, - 63, 64, 65, 80, -10, -138, -44, -12, -40, -9, - 157, 12, 146, -83, 142, 82, 10, -84, 37, 38, - -4, -83, 82, 144, 158, 145, 10, -87, -48, 146, + -23, -30, -84, 82, -11, 8, 9, 66, 67, 81, + 63, 64, 65, 80, -10, -139, -44, -12, -40, -9, + 157, 12, 146, -84, 142, 82, 10, -85, 37, 38, + -4, -84, 82, 144, 158, 145, 10, -88, -48, 146, -48, -25, -1, 79, 146, -48, 144, -14, 97, 98, - 144, -14, 144, -15, -19, -14, 144, -88, -27, 12, - 157, -89, -1, 12, -102, -14, 144, 129, 130, 87, + 144, -14, 144, -15, -19, -14, 144, -89, -27, 12, + 157, -90, -1, 12, -103, -14, 144, 129, 130, 87, 89, 88, 159, 151, 161, 167, 153, 152, 162, 131, 163, 164, 132, 133, 134, 135, 136, 137, 165, 138, 166, 139, 90, 150, 146, 146, 146, 142, -14, 10, -144, 151, 10, 10, -15, -19, -14, 52, 52, 160, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 146, -14, 104, 105, -18, -19, -83, 79, + 127, 128, 146, -14, 104, 105, -18, -19, -84, 79, 82, -11, -12, 98, -18, -14, -14, -14, -14, -42, -14, -50, -14, -14, -14, -14, -14, -14, -14, -49, - 146, -48, -14, 148, 148, -123, 17, -90, -33, 12, - 76, 77, -14, 57, -43, -11, -41, -83, 79, 82, - -21, -10, -138, -12, 146, 146, -14, -14, 146, -14, - -14, 148, -90, 17, 17, 75, -90, 148, 146, -93, - -92, -14, 151, 148, 148, 82, -81, 146, -83, 78, + 146, -48, -14, 148, 148, -124, 17, -91, -33, 12, + 76, 77, -14, 57, -43, -11, -41, -84, 79, 82, + -21, -10, -139, -12, 146, 146, -14, -14, 146, -14, + -14, 148, -91, 17, 17, 75, -91, 148, 146, -94, + -93, -14, 151, 148, 148, 82, -81, 146, -84, 78, 148, 142, -10, 157, 78, -81, 142, 147, 144, 142, - -82, -83, 144, 158, -85, -5, -83, 82, -86, -6, - -83, 82, 29, -83, 10, 160, -24, 143, 2, -25, + -83, -84, 144, 158, -86, -5, -84, 82, -87, -6, + -84, 82, 29, -84, 10, 160, -24, 143, 2, -25, -51, -52, 51, -25, 145, -146, -25, 145, 21, -144, - -100, -99, -14, -141, 142, 145, 144, 144, 144, 144, + -101, -100, -14, -142, 142, 145, 144, 144, 144, 144, 144, 158, -16, 142, -19, 144, 158, -144, 160, 144, 158, -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, -43, -14, 145, -103, - -56, -19, -19, -15, -104, 10, -87, 144, 144, 10, - 146, -65, 55, -115, 55, 58, -14, 151, -14, -14, + -14, -14, -14, -14, -14, -14, -43, -14, 145, -104, + -56, -19, -19, -15, -105, 10, -88, 144, 144, 10, + 146, -65, 55, -116, 55, 58, -14, 151, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -94, -38, -19, 59, 82, -83, 78, 78, 147, 147, + -95, -38, -19, 59, 82, -84, 78, 78, 147, 147, 147, 147, -13, -14, -13, 141, -33, -33, 17, 148, - 57, -14, 11, -19, -133, -134, -40, -39, -10, -138, - 10, 142, -80, -81, 78, 82, -83, 57, -10, 78, - -91, -36, -19, -15, -19, -15, -14, -13, 140, 75, - 75, -13, -93, 149, -151, 158, 58, -17, -19, -13, - -13, 10, 147, -117, -50, -69, -15, -19, 151, 83, + 57, -14, 11, -19, -134, -135, -40, -39, -10, -139, + 10, 142, -80, -81, 78, 82, -84, 57, -10, 78, + -92, -36, -19, -15, -19, -15, -14, -13, 140, 75, + 75, -13, -94, 149, -151, 158, 58, -17, -19, -13, + -13, 10, 147, -118, -50, -69, -15, -19, 151, 83, -81, -39, -40, 10, 52, -13, -14, -39, -40, 10, - -14, 144, -82, 143, -81, -4, 144, 158, 29, -83, - 144, 158, 29, -83, 10, 29, 160, -28, -78, -7, - -31, -83, 79, 82, 60, 148, -8, 62, -79, 18, - 74, -11, 154, 155, 153, 152, 146, 146, -97, -87, - -87, -48, 144, 158, -101, 144, -101, 144, -27, -14, + -14, 144, -83, 143, -81, -4, 144, 158, 29, -84, + 144, 158, 29, -84, 10, 29, 160, -28, -78, -7, + -31, -84, 79, 82, 60, 148, -8, 62, -79, 18, + 74, -11, 154, 155, 153, 152, 146, 146, -98, -88, + -88, -48, 144, 158, -102, 144, -102, 144, -27, -14, 12, 146, -28, -14, 145, -14, 147, 158, 29, 29, - 147, 158, 160, 143, 146, -108, -109, -63, -62, 60, - 61, -45, -83, 79, 82, -111, 56, -45, 142, -116, - -45, -15, -19, -19, 91, 147, 158, 146, -83, -129, - -127, -126, -128, 148, -130, 57, 149, 149, -34, 10, - 13, 12, 10, 143, 148, 143, -131, -77, -132, -81, - 148, 142, -10, -14, -40, -83, -133, -40, 147, 158, + 147, 158, 160, 143, 146, -109, -110, -63, -62, 60, + 61, -45, -84, 79, 82, -112, 56, -45, 142, -117, + -45, -15, -19, -19, 91, 147, 158, 146, -84, -130, + -128, -127, -129, 148, -131, 57, 149, 149, -34, 10, + 13, 12, 10, 143, 148, 143, -132, -77, -133, -81, + 148, 142, -10, -14, -40, -84, -134, -40, 147, 158, 147, 147, 147, 149, 149, 147, -14, 151, -14, 151, 149, 149, 147, 158, 147, -17, -14, -81, -81, 149, 143, -81, -81, 143, 143, -5, 10, 29, -6, 10, 29, 10, -28, 148, 153, 152, 162, 131, 163, 164, 159, 151, 161, 132, 133, 167, 88, 89, 87, 130, 129, 134, 135, 136, 137, 165, 166, 138, 139, 150, - 82, -83, 146, -124, -125, -78, 17, 78, -78, -78, - -78, -78, -78, 147, -54, 93, 94, -98, 22, 144, - -100, -14, 143, 32, 33, -101, 31, -101, 143, 160, - -108, -14, 144, -56, -139, -19, 151, 59, -139, -57, - -25, 145, 10, -28, -105, 41, -108, 147, 158, -144, - 82, -83, 142, -116, -110, 158, -43, 160, -38, -94, - 148, -128, -130, -13, -133, 149, -14, -137, 148, 148, - -13, -14, 143, -136, -36, 58, -17, -17, -69, 10, + 82, -84, 146, -125, -126, -78, 17, 78, -78, -78, + -78, -78, -78, 147, -54, 93, 94, -99, 22, 144, + -101, -14, 143, 32, 33, -102, 31, -102, 143, 160, + -109, -14, 144, -56, -140, -19, 151, 59, -140, -57, + -25, 145, 10, -28, -106, 41, -109, 147, 158, -144, + 82, -84, 142, -117, -111, 158, -43, 160, -38, -95, + 148, -129, -131, -13, -134, 149, -14, -138, 148, 148, + -13, -14, 143, -137, -36, 58, -17, -17, -69, 10, 10, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, 145, -78, -83, - -124, 149, -151, 158, 58, 10, 52, 147, 144, -48, + -78, -78, -78, -78, -78, -78, -78, 145, -78, -84, + -125, 149, -151, 158, 58, 10, 52, 147, 144, -48, -25, -55, 93, 94, 144, 144, -14, -150, 145, 144, - 143, 144, 31, -28, 147, -140, 58, -19, 146, -140, - -87, 160, -58, 42, 146, 147, -96, 44, -63, -145, - 83, -83, -110, 143, -66, -112, -67, -68, -113, -122, + 143, 144, 31, -28, 147, -141, 58, -19, 146, -141, + -88, 160, -58, 42, 146, 147, -97, 44, -63, -145, + 83, -84, -111, 143, -66, -113, -67, -68, -114, -123, 47, 38, 44, -76, 103, 102, 101, 98, 99, 100, - -45, -80, -14, 147, -13, 149, -131, 149, -130, -13, - -13, 149, 143, -135, 57, -14, 151, 149, -78, 145, - 147, -78, -78, -25, 95, -48, 145, -100, -150, -87, - 144, -96, 147, -139, -94, 147, 28, -28, 142, -45, - 142, 142, 146, 12, 143, -114, 12, 144, 158, -1, - -76, 10, -118, -45, 149, 143, 149, 149, -133, -17, - -78, 58, 144, 145, -87, 147, -87, 142, -148, -25, - 145, 147, -148, 144, -87, 12, -87, -87, -95, 12, - 151, 160, 144, 158, 160, 10, -144, 160, -143, 158, - 144, 142, -78, -87, -147, -25, 145, -87, -87, 143, + -45, -80, -14, 147, -13, 149, -132, 149, -131, -13, + -13, 149, 143, -136, 57, -14, 151, 149, -78, 145, + 147, -78, -78, -25, 95, -48, 145, -101, -150, -88, + 144, -97, 147, -140, -95, 147, 28, -28, 142, -45, + 142, 142, 146, 12, 143, -115, 12, 144, 158, -1, + -76, 10, -119, -45, 149, 143, 149, 149, -134, -17, + -78, 58, 144, 145, -88, 147, -88, 142, -148, -25, + 145, 147, -148, 144, -88, 12, -88, -88, -96, 12, + 151, 160, 144, 158, 160, 10, -144, 160, -82, 158, + 144, 142, -78, -88, -147, -25, 145, -88, -88, 143, 147, 143, 143, 147, 158, 12, -28, 12, -28, 160, - 10, -28, -45, -119, -120, -70, -71, -72, -73, -74, - -45, 10, -87, 143, 26, 142, 12, 151, 160, -28, + 10, -28, -45, -120, -121, -70, -71, -72, -73, -74, + -45, 10, -88, 143, 26, 142, 12, 151, 160, -28, 146, 143, -70, 144, 144, 45, 29, 78, 24, 144, - -87, 12, -28, -108, -121, -45, -75, -76, 10, 144, - 143, 147, 158, 10, -106, -107, -59, 41, -142, 144, - 142, -45, -59, 146, -87, -45, 143, 12, 147, 142, - -87, 143, + -88, 12, -28, -109, -122, -45, -75, -76, 10, 144, + 143, 147, 158, 10, -107, -108, -59, 41, -143, 144, + 142, -45, -59, 146, -88, -45, 143, 12, 147, 142, + -88, 143, } var yyDef = [...]int{ @@ -2345,14 +2345,14 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:270 + //line php5/php5.y:271 { yylex.(*Parser).rootNode = stmt.NewStmtList(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) } case 2: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:278 + //line php5/php5.y:279 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2360,13 +2360,13 @@ yydefault: } case 3: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:283 + //line php5/php5.y:284 { yyVAL.list = []node.Node{} } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:288 + //line php5/php5.y:289 { namePart := name.NewNamePart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2375,7 +2375,7 @@ yydefault: } case 5: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:295 + //line php5/php5.y:296 { namePart := name.NewNamePart(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2384,32 +2384,32 @@ yydefault: } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:305 + //line php5/php5.y:306 { // error yyVAL.node = nil } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:310 + //line php5/php5.y:311 { yyVAL.node = yyDollar[1].node } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:312 + //line php5/php5.y:313 { yyVAL.node = yyDollar[1].node } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:314 + //line php5/php5.y:315 { yyVAL.node = yyDollar[1].node } case 10: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:316 + //line php5/php5.y:317 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2417,7 +2417,7 @@ yydefault: } case 11: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:322 + //line php5/php5.y:323 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2429,7 +2429,7 @@ yydefault: } case 12: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:332 + //line php5/php5.y:333 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2441,7 +2441,7 @@ yydefault: } case 13: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:342 + //line php5/php5.y:343 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2449,7 +2449,7 @@ yydefault: } case 14: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:348 + //line php5/php5.y:349 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2457,7 +2457,7 @@ yydefault: } case 15: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:354 + //line php5/php5.y:355 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2469,7 +2469,7 @@ yydefault: } case 16: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:364 + //line php5/php5.y:365 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2481,25 +2481,25 @@ yydefault: } case 17: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:374 + //line php5/php5.y:375 { yyVAL.node = yyDollar[1].node } case 18: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:379 + //line php5/php5.y:380 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:381 + //line php5/php5.y:382 { yyVAL.list = []node.Node{yyDollar[1].node} } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:386 + //line php5/php5.y:387 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2511,7 +2511,7 @@ yydefault: } case 21: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:396 + //line php5/php5.y:397 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2526,7 +2526,7 @@ yydefault: } case 22: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:409 + //line php5/php5.y:410 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2538,7 +2538,7 @@ yydefault: } case 23: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:419 + //line php5/php5.y:420 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2553,19 +2553,19 @@ yydefault: } case 24: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:435 + //line php5/php5.y:436 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:437 + //line php5/php5.y:438 { yyVAL.list = []node.Node{yyDollar[1].node} } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:442 + //line php5/php5.y:443 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2577,7 +2577,7 @@ yydefault: } case 27: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:452 + //line php5/php5.y:453 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2592,7 +2592,7 @@ yydefault: } case 28: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:465 + //line php5/php5.y:466 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2604,7 +2604,7 @@ yydefault: } case 29: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:475 + //line php5/php5.y:476 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2619,19 +2619,19 @@ yydefault: } case 30: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:491 + //line php5/php5.y:492 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:493 + //line php5/php5.y:494 { yyVAL.list = []node.Node{yyDollar[1].node} } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:498 + //line php5/php5.y:499 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2643,7 +2643,7 @@ yydefault: } case 33: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:508 + //line php5/php5.y:509 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2658,7 +2658,7 @@ yydefault: } case 34: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:521 + //line php5/php5.y:522 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2670,7 +2670,7 @@ yydefault: } case 35: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:531 + //line php5/php5.y:532 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2685,7 +2685,7 @@ yydefault: } case 36: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:547 + //line php5/php5.y:548 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2703,7 +2703,7 @@ yydefault: } case 37: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:563 + //line php5/php5.y:564 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2721,7 +2721,7 @@ yydefault: } case 38: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:582 + //line php5/php5.y:583 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2729,38 +2729,38 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:588 + //line php5/php5.y:589 { yyVAL.list = []node.Node{} } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:594 + //line php5/php5.y:595 { // error yyVAL.node = nil } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:599 + //line php5/php5.y:600 { yyVAL.node = yyDollar[1].node } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:601 + //line php5/php5.y:602 { yyVAL.node = yyDollar[1].node } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:603 + //line php5/php5.y:604 { yyVAL.node = yyDollar[1].node } case 44: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:605 + //line php5/php5.y:606 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2768,13 +2768,13 @@ yydefault: } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:615 + //line php5/php5.y:616 { yyVAL.node = yyDollar[1].node } case 46: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:617 + //line php5/php5.y:618 { label := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2786,7 +2786,7 @@ yydefault: } case 47: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:630 + //line php5/php5.y:631 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2794,7 +2794,7 @@ yydefault: } case 48: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:636 + //line php5/php5.y:637 { yyVAL.node = stmt.NewIf(yyDollar[2].node, yyDollar[3].node, yyDollar[4].list, yyDollar[5].node) @@ -2810,7 +2810,7 @@ yydefault: } case 49: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:650 + //line php5/php5.y:651 { stmts := stmt.NewStmtList(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) @@ -2821,7 +2821,7 @@ yydefault: } case 50: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:659 + //line php5/php5.y:660 { if yyDollar[3].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltWhile(yyDollar[2].node, yyDollar[3].altSyntaxNode.node) @@ -2833,7 +2833,7 @@ yydefault: } case 51: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:669 + //line php5/php5.y:670 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2841,7 +2841,7 @@ yydefault: } case 52: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:675 + //line php5/php5.y:676 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltFor(yyDollar[3].list, yyDollar[5].list, yyDollar[7].list, yyDollar[9].altSyntaxNode.node) @@ -2853,7 +2853,7 @@ yydefault: } case 53: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:685 + //line php5/php5.y:686 { if yyDollar[3].nodesWithEndToken.endToken.Value == ";" { yyVAL.node = stmt.NewAltSwitch(yyDollar[2].node, yyDollar[3].nodesWithEndToken.nodes) @@ -2865,7 +2865,7 @@ yydefault: } case 54: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:695 + //line php5/php5.y:696 { yyVAL.node = stmt.NewBreak(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2873,7 +2873,7 @@ yydefault: } case 55: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:701 + //line php5/php5.y:702 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2881,7 +2881,7 @@ yydefault: } case 56: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:707 + //line php5/php5.y:708 { yyVAL.node = stmt.NewContinue(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2889,7 +2889,7 @@ yydefault: } case 57: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:713 + //line php5/php5.y:714 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2897,7 +2897,7 @@ yydefault: } case 58: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:719 + //line php5/php5.y:720 { yyVAL.node = stmt.NewReturn(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2905,7 +2905,7 @@ yydefault: } case 59: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:725 + //line php5/php5.y:726 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2913,7 +2913,7 @@ yydefault: } case 60: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:731 + //line php5/php5.y:732 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2921,7 +2921,7 @@ yydefault: } case 61: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:737 + //line php5/php5.y:738 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2929,7 +2929,7 @@ yydefault: } case 62: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:743 + //line php5/php5.y:744 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2937,7 +2937,7 @@ yydefault: } case 63: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:749 + //line php5/php5.y:750 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2945,7 +2945,7 @@ yydefault: } case 64: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:755 + //line php5/php5.y:756 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2953,7 +2953,7 @@ yydefault: } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:761 + //line php5/php5.y:762 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2961,7 +2961,7 @@ yydefault: } case 66: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:767 + //line php5/php5.y:768 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2969,7 +2969,7 @@ yydefault: } case 67: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:773 + //line php5/php5.y:774 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2977,7 +2977,7 @@ yydefault: } case 68: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:779 + //line php5/php5.y:780 { if yyDollar[6].foreachVariable.node == nil { if yyDollar[8].altSyntaxNode.isAlt { @@ -2997,7 +2997,7 @@ yydefault: } case 69: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:797 + //line php5/php5.y:798 { if yyDollar[6].foreachVariable.node == nil { if yyDollar[8].altSyntaxNode.isAlt { @@ -3017,7 +3017,7 @@ yydefault: } case 70: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:815 + //line php5/php5.y:816 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) @@ -3025,7 +3025,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:821 + //line php5/php5.y:822 { yyVAL.node = stmt.NewNop() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3033,7 +3033,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:827 + //line php5/php5.y:828 { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3047,7 +3047,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:839 + //line php5/php5.y:840 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -3055,7 +3055,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:845 + //line php5/php5.y:846 { label := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3067,13 +3067,13 @@ yydefault: } case 75: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:858 + //line php5/php5.y:859 { yyVAL.list = []node.Node{} } case 76: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:860 + //line php5/php5.y:861 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3091,13 +3091,13 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:878 + //line php5/php5.y:879 { yyVAL.node = nil } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:880 + //line php5/php5.y:881 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3105,31 +3105,31 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:889 + //line php5/php5.y:890 { yyVAL.list = yyDollar[1].list } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:891 + //line php5/php5.y:892 { yyVAL.list = []node.Node{} } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:896 + //line php5/php5.y:897 { yyVAL.list = []node.Node{yyDollar[1].node} } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:898 + //line php5/php5.y:899 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:903 + //line php5/php5.y:904 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3145,61 +3145,61 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:920 + //line php5/php5.y:921 { yyVAL.list = []node.Node{yyDollar[1].node} } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:922 + //line php5/php5.y:923 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:927 + //line php5/php5.y:928 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:932 + //line php5/php5.y:933 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:937 + //line php5/php5.y:938 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:942 + //line php5/php5.y:943 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:944 + //line php5/php5.y:945 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:949 + //line php5/php5.y:950 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:951 + //line php5/php5.y:952 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:956 + //line php5/php5.y:957 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3211,7 +3211,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:969 + //line php5/php5.y:970 { switch n := yyDollar[1].node.(type) { case *stmt.Class: @@ -3234,7 +3234,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:990 + //line php5/php5.y:991 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3246,7 +3246,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1004 + //line php5/php5.y:1005 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3254,7 +3254,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1010 + //line php5/php5.y:1011 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3266,7 +3266,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1020 + //line php5/php5.y:1021 { yyVAL.node = stmt.NewTrait(nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3274,7 +3274,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1026 + //line php5/php5.y:1027 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3286,85 +3286,85 @@ yydefault: } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1039 + //line php5/php5.y:1040 { yyVAL.node = nil } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1041 + //line php5/php5.y:1042 { yyVAL.node = yyDollar[2].node } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1046 + //line php5/php5.y:1047 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1051 + //line php5/php5.y:1052 { yyVAL.list = nil } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1053 + //line php5/php5.y:1054 { yyVAL.list = yyDollar[2].list } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1058 + //line php5/php5.y:1059 { yyVAL.list = nil } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1060 + //line php5/php5.y:1061 { yyVAL.list = yyDollar[2].list } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1065 + //line php5/php5.y:1066 { yyVAL.list = []node.Node{yyDollar[1].node} } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1067 + //line php5/php5.y:1068 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1072 + //line php5/php5.y:1073 { yyVAL.foreachVariable = foreachVariable{nil, false} } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1074 + //line php5/php5.y:1075 { yyVAL.foreachVariable = yyDollar[2].foreachVariable } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1079 + //line php5/php5.y:1080 { yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1081 + //line php5/php5.y:1082 { yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1083 + //line php5/php5.y:1084 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3373,39 +3373,39 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1093 + //line php5/php5.y:1094 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1095 + //line php5/php5.y:1096 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1104 + //line php5/php5.y:1105 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1106 + //line php5/php5.y:1107 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1115 + //line php5/php5.y:1116 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1117 + //line php5/php5.y:1118 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3413,7 +3413,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1127 + //line php5/php5.y:1128 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3427,7 +3427,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1139 + //line php5/php5.y:1140 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3441,37 +3441,37 @@ yydefault: } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1155 + //line php5/php5.y:1156 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1157 + //line php5/php5.y:1158 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[4].token} } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1159 + //line php5/php5.y:1160 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[4].token} } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1161 + //line php5/php5.y:1162 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[5].token} } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1167 + //line php5/php5.y:1168 { yyVAL.list = []node.Node{} } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1169 + //line php5/php5.y:1170 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) @@ -3480,7 +3480,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1176 + //line php5/php5.y:1177 { _default := stmt.NewDefault(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) @@ -3489,26 +3489,26 @@ yydefault: } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1193 + //line php5/php5.y:1194 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1195 + //line php5/php5.y:1196 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1205 + //line php5/php5.y:1206 { yyVAL.list = nil } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1207 + //line php5/php5.y:1208 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) @@ -3518,13 +3518,13 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1219 + //line php5/php5.y:1220 { yyVAL.list = nil } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1221 + //line php5/php5.y:1222 { stmts := stmt.NewStmtList(yyDollar[5].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[5].list)) @@ -3537,13 +3537,13 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1236 + //line php5/php5.y:1237 { yyVAL.node = nil } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1238 + //line php5/php5.y:1239 { yyVAL.node = stmt.NewElse(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3551,13 +3551,13 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1248 + //line php5/php5.y:1249 { yyVAL.node = nil } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1250 + //line php5/php5.y:1251 { stmts := stmt.NewStmtList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) @@ -3568,31 +3568,31 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1263 + //line php5/php5.y:1264 { yyVAL.list = yyDollar[1].list } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1265 + //line php5/php5.y:1266 { yyVAL.list = nil } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1270 + //line php5/php5.y:1271 { yyVAL.list = []node.Node{yyDollar[1].node} } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1272 + //line php5/php5.y:1273 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1277 + //line php5/php5.y:1278 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3620,7 +3620,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1303 + //line php5/php5.y:1304 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3648,13 +3648,13 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1333 + //line php5/php5.y:1334 { yyVAL.node = nil } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1335 + //line php5/php5.y:1336 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3662,7 +3662,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1341 + //line php5/php5.y:1342 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3670,13 +3670,13 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1347 + //line php5/php5.y:1348 { yyVAL.node = yyDollar[1].node } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1353 + //line php5/php5.y:1354 { yyVAL.node = node.NewArgumentList(nil) @@ -3685,7 +3685,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1360 + //line php5/php5.y:1361 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -3694,7 +3694,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1367 + //line php5/php5.y:1368 { arg := node.NewArgument(yyDollar[2].node, false, false) yyVAL.node = node.NewArgumentList([]node.Node{arg}) @@ -3705,19 +3705,19 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1380 + //line php5/php5.y:1381 { yyVAL.list = []node.Node{yyDollar[1].node} } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1382 + //line php5/php5.y:1383 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1387 + //line php5/php5.y:1388 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3725,7 +3725,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1393 + //line php5/php5.y:1394 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3733,7 +3733,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1399 + //line php5/php5.y:1400 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -3741,7 +3741,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1405 + //line php5/php5.y:1406 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3749,19 +3749,19 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1414 + //line php5/php5.y:1415 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1416 + //line php5/php5.y:1417 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1422 + //line php5/php5.y:1423 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3773,7 +3773,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1432 + //line php5/php5.y:1433 { yyVAL.node = expr.NewVariable(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3781,7 +3781,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1438 + //line php5/php5.y:1439 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3789,7 +3789,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1448 + //line php5/php5.y:1449 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3808,7 +3808,7 @@ yydefault: } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1465 + //line php5/php5.y:1466 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3827,7 +3827,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1482 + //line php5/php5.y:1483 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3846,7 +3846,7 @@ yydefault: } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1499 + //line php5/php5.y:1500 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3865,19 +3865,19 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1521 + //line php5/php5.y:1522 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1523 + //line php5/php5.y:1524 { yyVAL.list = []node.Node{} } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1529 + //line php5/php5.y:1530 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) @@ -3885,19 +3885,19 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1535 + //line php5/php5.y:1536 { yyVAL.node = yyDollar[1].node } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1537 + //line php5/php5.y:1538 { yyVAL.node = yyDollar[1].node } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1539 + //line php5/php5.y:1540 { name := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3909,75 +3909,87 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1552 + //line php5/php5.y:1553 { - yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].nodesWithEndToken.nodes) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].nodesWithEndToken.endToken)) + var adaptationList *stmt.TraitAdaptationList + switch n := yyDollar[3].node.(type) { + case *stmt.TraitAdaptationList: + adaptationList = n + default: + adaptationList = nil + } + + yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, adaptationList) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1561 + //line php5/php5.y:1570 { yyVAL.list = []node.Node{yyDollar[1].node} } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1563 + //line php5/php5.y:1572 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1568 + //line php5/php5.y:1577 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} + yyVAL.node = stmt.NewNop() + + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1570 + //line php5/php5.y:1583 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} + yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) + + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1575 + //line php5/php5.y:1592 { yyVAL.list = nil } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1577 + //line php5/php5.y:1594 { yyVAL.list = yyDollar[1].list } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1582 + //line php5/php5.y:1599 { yyVAL.list = []node.Node{yyDollar[1].node} } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1584 + //line php5/php5.y:1601 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1589 + //line php5/php5.y:1606 { yyVAL.node = yyDollar[1].node } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1591 + //line php5/php5.y:1608 { yyVAL.node = yyDollar[1].node } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1596 + //line php5/php5.y:1613 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) @@ -3985,19 +3997,19 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1605 + //line php5/php5.y:1622 { yyVAL.list = []node.Node{yyDollar[1].node} } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1607 + //line php5/php5.y:1624 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1612 + //line php5/php5.y:1629 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4009,13 +4021,13 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1622 + //line php5/php5.y:1639 { yyVAL.node = yyDollar[1].node } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1627 + //line php5/php5.y:1644 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4027,7 +4039,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1640 + //line php5/php5.y:1657 { alias := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -4039,7 +4051,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1650 + //line php5/php5.y:1667 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4047,37 +4059,37 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1659 + //line php5/php5.y:1676 { yyVAL.node = nil } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1661 + //line php5/php5.y:1678 { yyVAL.node = yyDollar[1].node } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1666 + //line php5/php5.y:1683 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1668 + //line php5/php5.y:1685 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1673 + //line php5/php5.y:1690 { yyVAL.list = yyDollar[1].list } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1675 + //line php5/php5.y:1692 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4087,31 +4099,31 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1686 + //line php5/php5.y:1703 { yyVAL.list = nil } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1688 + //line php5/php5.y:1705 { yyVAL.list = yyDollar[1].list } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1693 + //line php5/php5.y:1710 { yyVAL.list = []node.Node{yyDollar[1].node} } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1695 + //line php5/php5.y:1712 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 204: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1700 + //line php5/php5.y:1717 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4119,7 +4131,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1706 + //line php5/php5.y:1723 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4127,7 +4139,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1712 + //line php5/php5.y:1729 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4135,7 +4147,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1718 + //line php5/php5.y:1735 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4143,7 +4155,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1724 + //line php5/php5.y:1741 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4151,7 +4163,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1730 + //line php5/php5.y:1747 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4159,7 +4171,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1739 + //line php5/php5.y:1756 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4177,7 +4189,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1755 + //line php5/php5.y:1772 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4195,7 +4207,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1771 + //line php5/php5.y:1788 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4213,7 +4225,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1787 + //line php5/php5.y:1804 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4231,7 +4243,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1806 + //line php5/php5.y:1823 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4248,7 +4260,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1821 + //line php5/php5.y:1838 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -4264,55 +4276,55 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1838 + //line php5/php5.y:1855 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1840 + //line php5/php5.y:1857 { yyVAL.list = []node.Node{yyDollar[1].node} } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1846 + //line php5/php5.y:1863 { yyVAL.list = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1848 + //line php5/php5.y:1865 { yyVAL.list = yyDollar[1].list } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1853 + //line php5/php5.y:1870 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1855 + //line php5/php5.y:1872 { yyVAL.list = []node.Node{yyDollar[1].node} } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1860 + //line php5/php5.y:1877 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1862 + //line php5/php5.y:1879 { yyVAL.list = yyDollar[1].list } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1867 + //line php5/php5.y:1884 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -4321,7 +4333,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1874 + //line php5/php5.y:1891 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -4330,37 +4342,37 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1884 + //line php5/php5.y:1901 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1886 + //line php5/php5.y:1903 { yyVAL.list = yyDollar[1].list } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1888 + //line php5/php5.y:1905 { yyVAL.list = yyDollar[1].list } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1893 + //line php5/php5.y:1910 { yyVAL.list = nil } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1895 + //line php5/php5.y:1912 { yyVAL.list = yyDollar[1].list } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1900 + //line php5/php5.y:1917 { if yyDollar[3].node != nil { @@ -4375,7 +4387,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1916 + //line php5/php5.y:1933 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -4387,7 +4399,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1926 + //line php5/php5.y:1943 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4395,7 +4407,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1932 + //line php5/php5.y:1949 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4403,7 +4415,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1938 + //line php5/php5.y:1955 { var _new *expr.New @@ -4422,7 +4434,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1955 + //line php5/php5.y:1972 { yyVAL.node = expr.NewClone(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4430,7 +4442,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1961 + //line php5/php5.y:1978 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4438,7 +4450,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1967 + //line php5/php5.y:1984 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4446,7 +4458,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1973 + //line php5/php5.y:1990 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4454,7 +4466,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1979 + //line php5/php5.y:1996 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4462,7 +4474,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1985 + //line php5/php5.y:2002 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4470,7 +4482,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1991 + //line php5/php5.y:2008 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4478,7 +4490,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1997 + //line php5/php5.y:2014 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4486,7 +4498,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2003 + //line php5/php5.y:2020 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4494,7 +4506,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2009 + //line php5/php5.y:2026 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4502,7 +4514,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2015 + //line php5/php5.y:2032 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4510,7 +4522,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2021 + //line php5/php5.y:2038 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4518,7 +4530,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2027 + //line php5/php5.y:2044 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4526,7 +4538,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2033 + //line php5/php5.y:2050 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4534,7 +4546,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2039 + //line php5/php5.y:2056 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4542,7 +4554,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2045 + //line php5/php5.y:2062 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4550,7 +4562,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2051 + //line php5/php5.y:2068 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4558,7 +4570,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2057 + //line php5/php5.y:2074 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4566,7 +4578,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2063 + //line php5/php5.y:2080 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4574,7 +4586,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2069 + //line php5/php5.y:2086 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4582,7 +4594,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2075 + //line php5/php5.y:2092 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4590,7 +4602,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2081 + //line php5/php5.y:2098 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4598,7 +4610,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2087 + //line php5/php5.y:2104 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4606,7 +4618,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2093 + //line php5/php5.y:2110 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4614,7 +4626,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2099 + //line php5/php5.y:2116 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4622,7 +4634,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2105 + //line php5/php5.y:2122 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4630,7 +4642,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2111 + //line php5/php5.y:2128 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4638,7 +4650,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2117 + //line php5/php5.y:2134 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4646,7 +4658,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2123 + //line php5/php5.y:2140 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4654,7 +4666,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2129 + //line php5/php5.y:2146 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4662,7 +4674,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2135 + //line php5/php5.y:2152 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4670,7 +4682,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2141 + //line php5/php5.y:2158 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4678,7 +4690,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2147 + //line php5/php5.y:2164 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4686,7 +4698,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2153 + //line php5/php5.y:2170 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4694,7 +4706,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2159 + //line php5/php5.y:2176 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4702,7 +4714,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2165 + //line php5/php5.y:2182 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4710,7 +4722,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2171 + //line php5/php5.y:2188 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4718,7 +4730,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2177 + //line php5/php5.y:2194 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4726,7 +4738,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2183 + //line php5/php5.y:2200 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4734,7 +4746,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2189 + //line php5/php5.y:2206 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4742,7 +4754,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2195 + //line php5/php5.y:2212 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4750,7 +4762,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2201 + //line php5/php5.y:2218 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4758,7 +4770,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2207 + //line php5/php5.y:2224 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4766,7 +4778,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2213 + //line php5/php5.y:2230 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4774,7 +4786,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2219 + //line php5/php5.y:2236 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4782,7 +4794,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2225 + //line php5/php5.y:2242 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4790,7 +4802,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2231 + //line php5/php5.y:2248 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4798,19 +4810,19 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2237 + //line php5/php5.y:2254 { yyVAL.node = yyDollar[1].node } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2239 + //line php5/php5.y:2256 { yyVAL.node = yyDollar[1].node } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2241 + //line php5/php5.y:2258 { yyVAL.node = yyDollar[2].node @@ -4838,7 +4850,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2267 + //line php5/php5.y:2284 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -4846,7 +4858,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2273 + //line php5/php5.y:2290 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4854,13 +4866,13 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2279 + //line php5/php5.y:2296 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2281 + //line php5/php5.y:2298 { yyVAL.node = cast.NewInt(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4868,7 +4880,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2287 + //line php5/php5.y:2304 { yyVAL.node = cast.NewDouble(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4876,7 +4888,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2293 + //line php5/php5.y:2310 { yyVAL.node = cast.NewString(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4884,7 +4896,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2299 + //line php5/php5.y:2316 { yyVAL.node = cast.NewArray(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4892,7 +4904,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2305 + //line php5/php5.y:2322 { yyVAL.node = cast.NewObject(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4900,7 +4912,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2311 + //line php5/php5.y:2328 { yyVAL.node = cast.NewBool(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4908,7 +4920,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2317 + //line php5/php5.y:2334 { yyVAL.node = cast.NewUnset(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4916,7 +4928,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2323 + //line php5/php5.y:2340 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -4928,7 +4940,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2333 + //line php5/php5.y:2350 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4936,25 +4948,25 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2339 + //line php5/php5.y:2356 { yyVAL.node = yyDollar[1].node } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2341 + //line php5/php5.y:2358 { yyVAL.node = yyDollar[1].node } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2343 + //line php5/php5.y:2360 { yyVAL.node = yyDollar[1].node } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2345 + //line php5/php5.y:2362 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -4962,7 +4974,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2351 + //line php5/php5.y:2368 { yyVAL.node = expr.NewPrint(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4970,7 +4982,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2357 + //line php5/php5.y:2374 { yyVAL.node = expr.NewYield(nil, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4978,7 +4990,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:2363 + //line php5/php5.y:2380 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].list, nil, yyDollar[8].list, false, yyDollar[2].boolWithToken.value, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) @@ -4987,7 +4999,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:2370 + //line php5/php5.y:2387 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, nil, yyDollar[9].list, true, yyDollar[3].boolWithToken.value, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) @@ -4996,7 +5008,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2380 + //line php5/php5.y:2397 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5004,7 +5016,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2386 + //line php5/php5.y:2403 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5012,7 +5024,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2392 + //line php5/php5.y:2409 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5020,7 +5032,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2398 + //line php5/php5.y:2415 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5028,7 +5040,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2407 + //line php5/php5.y:2424 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5036,7 +5048,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2413 + //line php5/php5.y:2430 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5044,7 +5056,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2419 + //line php5/php5.y:2436 { str := scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(str, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5056,7 +5068,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2429 + //line php5/php5.y:2446 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5064,7 +5076,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2438 + //line php5/php5.y:2455 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5072,7 +5084,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2444 + //line php5/php5.y:2461 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5080,25 +5092,25 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2453 + //line php5/php5.y:2470 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2458 + //line php5/php5.y:2475 { yyVAL.list = []node.Node{} } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2460 + //line php5/php5.y:2477 { yyVAL.list = yyDollar[3].list } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2465 + //line php5/php5.y:2482 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5116,7 +5128,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2481 + //line php5/php5.y:2498 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -5134,7 +5146,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2497 + //line php5/php5.y:2514 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5152,7 +5164,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2513 + //line php5/php5.y:2530 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5170,7 +5182,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2532 + //line php5/php5.y:2549 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5182,7 +5194,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2542 + //line php5/php5.y:2559 { funcName := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5194,7 +5206,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2552 + //line php5/php5.y:2569 { funcName := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5206,7 +5218,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2562 + //line php5/php5.y:2579 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5214,7 +5226,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2568 + //line php5/php5.y:2585 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5222,7 +5234,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2574 + //line php5/php5.y:2591 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5230,7 +5242,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2580 + //line php5/php5.y:2597 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5238,7 +5250,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2586 + //line php5/php5.y:2603 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) @@ -5246,7 +5258,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2595 + //line php5/php5.y:2612 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5254,7 +5266,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2601 + //line php5/php5.y:2618 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5262,7 +5274,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2607 + //line php5/php5.y:2624 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5270,7 +5282,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2613 + //line php5/php5.y:2630 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5278,7 +5290,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2622 + //line php5/php5.y:2639 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5286,7 +5298,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2628 + //line php5/php5.y:2645 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5294,7 +5306,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2634 + //line php5/php5.y:2651 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5302,19 +5314,19 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2643 + //line php5/php5.y:2660 { yyVAL.node = yyDollar[1].node } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2645 + //line php5/php5.y:2662 { yyVAL.node = yyDollar[1].node } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2650 + //line php5/php5.y:2667 { yyVAL.node = yyDollar[1].node @@ -5352,79 +5364,79 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2686 + //line php5/php5.y:2703 { yyVAL.node = yyDollar[1].node } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2692 + //line php5/php5.y:2709 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2694 + //line php5/php5.y:2711 { yyVAL.list = []node.Node{} } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2700 + //line php5/php5.y:2717 { yyVAL.list = yyDollar[2].list } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2705 + //line php5/php5.y:2722 { yyVAL.node = nil } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2707 + //line php5/php5.y:2724 { yyVAL.node = nil } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2709 + //line php5/php5.y:2726 { yyVAL.node = yyDollar[1].node } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2714 + //line php5/php5.y:2731 { yyVAL.list = []node.Node{} } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2716 + //line php5/php5.y:2733 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2718 + //line php5/php5.y:2735 { yyVAL.list = yyDollar[1].list } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2723 + //line php5/php5.y:2740 { yyVAL.node = nil } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2725 + //line php5/php5.y:2742 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2730 + //line php5/php5.y:2747 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5432,7 +5444,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2736 + //line php5/php5.y:2753 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5440,7 +5452,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2742 + //line php5/php5.y:2759 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5448,7 +5460,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2748 + //line php5/php5.y:2765 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5456,7 +5468,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2754 + //line php5/php5.y:2771 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5464,7 +5476,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2760 + //line php5/php5.y:2777 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5472,7 +5484,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2766 + //line php5/php5.y:2783 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5480,7 +5492,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2772 + //line php5/php5.y:2789 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5488,7 +5500,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2778 + //line php5/php5.y:2795 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5496,7 +5508,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2784 + //line php5/php5.y:2801 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5504,7 +5516,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2790 + //line php5/php5.y:2807 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5516,7 +5528,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2800 + //line php5/php5.y:2817 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -5524,7 +5536,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2809 + //line php5/php5.y:2826 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5536,25 +5548,25 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2822 + //line php5/php5.y:2839 { yyVAL.node = yyDollar[1].node } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2827 + //line php5/php5.y:2844 { yyVAL.node = yyDollar[1].node } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2829 + //line php5/php5.y:2846 { yyVAL.node = yyDollar[1].node } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2831 + //line php5/php5.y:2848 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5566,7 +5578,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2841 + //line php5/php5.y:2858 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5578,7 +5590,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2851 + //line php5/php5.y:2868 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5590,7 +5602,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2861 + //line php5/php5.y:2878 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5598,7 +5610,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2867 + //line php5/php5.y:2884 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5606,13 +5618,13 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2873 + //line php5/php5.y:2890 { yyVAL.node = yyDollar[1].node } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2875 + //line php5/php5.y:2892 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5620,13 +5632,13 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2881 + //line php5/php5.y:2898 { yyVAL.node = yyDollar[1].node } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2886 + //line php5/php5.y:2903 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5634,7 +5646,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2892 + //line php5/php5.y:2909 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5642,7 +5654,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2898 + //line php5/php5.y:2915 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5650,7 +5662,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2904 + //line php5/php5.y:2921 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5658,7 +5670,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2910 + //line php5/php5.y:2927 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5666,7 +5678,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2916 + //line php5/php5.y:2933 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5674,7 +5686,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2922 + //line php5/php5.y:2939 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5682,7 +5694,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2928 + //line php5/php5.y:2945 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5690,7 +5702,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2934 + //line php5/php5.y:2951 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5698,7 +5710,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2940 + //line php5/php5.y:2957 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5706,7 +5718,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2946 + //line php5/php5.y:2963 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5714,7 +5726,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2952 + //line php5/php5.y:2969 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5722,7 +5734,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2958 + //line php5/php5.y:2975 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5730,7 +5742,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2964 + //line php5/php5.y:2981 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5738,7 +5750,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2970 + //line php5/php5.y:2987 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5746,7 +5758,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2976 + //line php5/php5.y:2993 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5754,7 +5766,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2982 + //line php5/php5.y:2999 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5762,7 +5774,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2988 + //line php5/php5.y:3005 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5770,7 +5782,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2994 + //line php5/php5.y:3011 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5778,7 +5790,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3000 + //line php5/php5.y:3017 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5786,7 +5798,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3006 + //line php5/php5.y:3023 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5794,7 +5806,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3012 + //line php5/php5.y:3029 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5802,7 +5814,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3018 + //line php5/php5.y:3035 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5810,7 +5822,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3024 + //line php5/php5.y:3041 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5818,7 +5830,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3030 + //line php5/php5.y:3047 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5826,7 +5838,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3036 + //line php5/php5.y:3053 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5834,7 +5846,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3042 + //line php5/php5.y:3059 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5842,7 +5854,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3048 + //line php5/php5.y:3065 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5850,7 +5862,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3054 + //line php5/php5.y:3071 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5858,7 +5870,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3060 + //line php5/php5.y:3077 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -5866,7 +5878,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3066 + //line php5/php5.y:3083 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5874,7 +5886,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3072 + //line php5/php5.y:3089 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5882,19 +5894,19 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3078 + //line php5/php5.y:3095 { yyVAL.node = yyDollar[2].node } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3083 + //line php5/php5.y:3100 { yyVAL.node = yyDollar[1].node } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3085 + //line php5/php5.y:3102 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5906,7 +5918,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3095 + //line php5/php5.y:3112 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5918,7 +5930,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3105 + //line php5/php5.y:3122 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5930,7 +5942,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3118 + //line php5/php5.y:3135 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5942,25 +5954,25 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3128 + //line php5/php5.y:3145 { yyVAL.node = yyDollar[1].node } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3130 + //line php5/php5.y:3147 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3132 + //line php5/php5.y:3149 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3134 + //line php5/php5.y:3151 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5968,7 +5980,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3140 + //line php5/php5.y:3157 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5976,7 +5988,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3146 + //line php5/php5.y:3163 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5984,19 +5996,19 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3155 + //line php5/php5.y:3172 { yyVAL.list = nil } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3157 + //line php5/php5.y:3174 { yyVAL.list = yyDollar[1].list } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3167 + //line php5/php5.y:3184 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -6006,7 +6018,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3175 + //line php5/php5.y:3192 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6016,7 +6028,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3183 + //line php5/php5.y:3200 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6026,7 +6038,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3191 + //line php5/php5.y:3208 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6036,49 +6048,49 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3202 + //line php5/php5.y:3219 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3204 + //line php5/php5.y:3221 { yyVAL.node = yyDollar[1].node } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3209 + //line php5/php5.y:3226 { yyVAL.node = yyDollar[2].node } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3211 + //line php5/php5.y:3228 { yyVAL.node = yyDollar[2].node } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3217 + //line php5/php5.y:3234 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3223 + //line php5/php5.y:3240 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3228 + //line php5/php5.y:3245 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3233 + //line php5/php5.y:3250 { yyVAL.node = yyDollar[1].node @@ -6133,25 +6145,25 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3286 + //line php5/php5.y:3303 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3291 + //line php5/php5.y:3308 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3293 + //line php5/php5.y:3310 { yyVAL.list = []node.Node{} } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3299 + //line php5/php5.y:3316 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -6162,7 +6174,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3311 + //line php5/php5.y:3328 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6171,7 +6183,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3318 + //line php5/php5.y:3335 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6180,38 +6192,38 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3328 + //line php5/php5.y:3345 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3336 + //line php5/php5.y:3353 { yyVAL.list = []node.Node{yyDollar[1].node} } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3338 + //line php5/php5.y:3355 { yyVAL.list = yyDollar[1].list } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3340 + //line php5/php5.y:3357 { yyVAL.list = nil } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3345 + //line php5/php5.y:3362 { yyVAL.node = yyDollar[1].node } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3347 + //line php5/php5.y:3364 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6223,7 +6235,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3360 + //line php5/php5.y:3377 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6231,7 +6243,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3366 + //line php5/php5.y:3383 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6239,13 +6251,13 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3376 + //line php5/php5.y:3393 { yyVAL.node = yyDollar[1].node } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3381 + //line php5/php5.y:3398 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6253,7 +6265,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3387 + //line php5/php5.y:3404 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6261,31 +6273,31 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3395 + //line php5/php5.y:3412 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3396 + //line php5/php5.y:3413 { yyVAL.node = yyDollar[1].node } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3397 + //line php5/php5.y:3414 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3403 + //line php5/php5.y:3420 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3405 + //line php5/php5.y:3422 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6297,13 +6309,13 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3415 + //line php5/php5.y:3432 { yyVAL.node = yyDollar[1].node } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3420 + //line php5/php5.y:3437 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6311,7 +6323,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3426 + //line php5/php5.y:3443 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6319,13 +6331,13 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3432 + //line php5/php5.y:3449 { yyVAL.node = yyDollar[1].node } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3438 + //line php5/php5.y:3455 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6337,7 +6349,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3448 + //line php5/php5.y:3465 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6345,25 +6357,25 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3457 + //line php5/php5.y:3474 { yyVAL.node = nil } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3459 + //line php5/php5.y:3476 { yyVAL.node = yyDollar[1].node } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3465 + //line php5/php5.y:3482 { yyVAL.list = yyDollar[1].list } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3467 + //line php5/php5.y:3484 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6372,7 +6384,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3477 + //line php5/php5.y:3494 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6381,7 +6393,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3484 + //line php5/php5.y:3501 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6390,7 +6402,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3491 + //line php5/php5.y:3508 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6399,7 +6411,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3501 + //line php5/php5.y:3518 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6407,13 +6419,13 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3507 + //line php5/php5.y:3524 { yyVAL.node = yyDollar[2].node } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3512 + //line php5/php5.y:3529 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6423,7 +6435,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3520 + //line php5/php5.y:3537 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6437,13 +6449,13 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3535 + //line php5/php5.y:3552 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3537 + //line php5/php5.y:3554 { if yyDollar[1].node == nil { yyVAL.list = []node.Node{} @@ -6453,7 +6465,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3549 + //line php5/php5.y:3566 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6461,7 +6473,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3555 + //line php5/php5.y:3572 { item := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6473,25 +6485,25 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3565 + //line php5/php5.y:3582 { yyVAL.node = nil } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3571 + //line php5/php5.y:3588 { yyVAL.list = []node.Node{} } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3573 + //line php5/php5.y:3590 { yyVAL.list = yyDollar[1].list } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3578 + //line php5/php5.y:3595 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -6501,7 +6513,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3586 + //line php5/php5.y:3603 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6511,7 +6523,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3594 + //line php5/php5.y:3611 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6521,7 +6533,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3602 + //line php5/php5.y:3619 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6531,7 +6543,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3610 + //line php5/php5.y:3627 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[6].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) @@ -6541,7 +6553,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3618 + //line php5/php5.y:3635 { arrayItem := expr.NewArrayItem(nil, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) @@ -6551,7 +6563,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3626 + //line php5/php5.y:3643 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -6561,7 +6573,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3634 + //line php5/php5.y:3651 { arrayItem := expr.NewArrayItem(nil, yyDollar[2].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6571,13 +6583,13 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3645 + //line php5/php5.y:3662 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3647 + //line php5/php5.y:3664 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6586,13 +6598,13 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3654 + //line php5/php5.y:3671 { yyVAL.list = []node.Node{yyDollar[1].node} } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3656 + //line php5/php5.y:3673 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6601,7 +6613,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3666 + //line php5/php5.y:3683 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6613,7 +6625,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3676 + //line php5/php5.y:3693 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6628,7 +6640,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3689 + //line php5/php5.y:3706 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6646,7 +6658,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3705 + //line php5/php5.y:3722 { yyVAL.node = yyDollar[2].node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6654,7 +6666,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3711 + //line php5/php5.y:3728 { identifier := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6669,13 +6681,13 @@ yydefault: } case 500: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3725 + //line php5/php5.y:3742 { yyVAL.node = yyDollar[2].node } case 501: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3730 + //line php5/php5.y:3747 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6683,7 +6695,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3736 + //line php5/php5.y:3753 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -6697,7 +6709,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3748 + //line php5/php5.y:3765 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6709,7 +6721,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3761 + //line php5/php5.y:3778 { yyVAL.node = expr.NewIsset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6717,7 +6729,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3767 + //line php5/php5.y:3784 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6725,7 +6737,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3773 + //line php5/php5.y:3790 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6733,7 +6745,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3779 + //line php5/php5.y:3796 { yyVAL.node = expr.NewInclude(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6741,7 +6753,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3785 + //line php5/php5.y:3802 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6749,7 +6761,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3791 + //line php5/php5.y:3808 { yyVAL.node = expr.NewEval(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6757,7 +6769,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3797 + //line php5/php5.y:3814 { yyVAL.node = expr.NewRequire(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6765,7 +6777,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3803 + //line php5/php5.y:3820 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6773,31 +6785,31 @@ yydefault: } case 512: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3812 + //line php5/php5.y:3829 { yyVAL.list = []node.Node{yyDollar[1].node} } case 513: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3814 + //line php5/php5.y:3831 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 514: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3819 + //line php5/php5.y:3836 { yyVAL.node = yyDollar[1].node } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3821 + //line php5/php5.y:3838 { yyVAL.node = yyDollar[1].node } case 516: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3826 + //line php5/php5.y:3843 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6809,7 +6821,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3836 + //line php5/php5.y:3853 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6821,7 +6833,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3849 + //line php5/php5.y:3866 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6833,7 +6845,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3862 + //line php5/php5.y:3879 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) diff --git a/php5/php5.y b/php5/php5.y index fe82192..4561c55 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -243,6 +243,7 @@ import ( %type trait_method_reference_fully_qualified trait_method_reference trait_modifiers member_modifier method %type static_scalar_value static_operation %type ctor_arguments function_call_parameter_list +%type trait_adaptations %type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations %type inner_statement_list global_var_list static_var_list encaps_list isset_variables non_empty_array_pair_list @@ -259,7 +260,7 @@ import ( %type simple_indirect_reference %type foreach_variable foreach_optional_arg -%type switch_case_list method_body trait_adaptations +%type switch_case_list method_body %type is_reference is_variadic %type while_statement for_statement foreach_statement @@ -1550,8 +1551,16 @@ class_statement: trait_use_statement: T_USE trait_list trait_adaptations { - $$ = stmt.NewTraitUse($2, $3.nodes) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3.endToken)) + var adaptationList *stmt.TraitAdaptationList + switch n := $3.(type) { + case *stmt.TraitAdaptationList: + adaptationList = n + default: + adaptationList = nil + } + + $$ = stmt.NewTraitUse($2, adaptationList) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) yylex.(*Parser).comments.AddComments($$, $1.Comments()) } ; @@ -1565,9 +1574,17 @@ trait_list: trait_adaptations: ';' - { $$ = &nodesWithEndToken{nil, $1} } + { + $$ = stmt.NewNop() + + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + } | '{' trait_adaptation_list '}' - { $$ = &nodesWithEndToken{$2, $3} } + { + $$ = stmt.NewTraitAdaptationList($2) + + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + } ; trait_adaptation_list: diff --git a/php5/php5_test.go b/php5/php5_test.go index 093aa6a..6150359 100644 --- a/php5/php5_test.go +++ b/php5/php5_test.go @@ -1455,6 +1455,7 @@ func TestPhp5(t *testing.T) { }, }, }, + TraitAdaptationList: &stmt.TraitAdaptationList{}, }, }, }, @@ -1475,12 +1476,14 @@ func TestPhp5(t *testing.T) { }, }, }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Method: &node.Identifier{Value: "one"}, + TraitAdaptationList: &stmt.TraitAdaptationList{ + Adaptations: []node.Node{ + &stmt.TraitUseAlias{ + Ref: &stmt.TraitMethodRef{ + Method: &node.Identifier{Value: "one"}, + }, + Modifier: &node.Identifier{Value: "public"}, }, - Modifier: &node.Identifier{Value: "public"}, }, }, }, @@ -1503,13 +1506,15 @@ func TestPhp5(t *testing.T) { }, }, }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Method: &node.Identifier{Value: "one"}, + TraitAdaptationList: &stmt.TraitAdaptationList{ + Adaptations: []node.Node{ + &stmt.TraitUseAlias{ + Ref: &stmt.TraitMethodRef{ + Method: &node.Identifier{Value: "one"}, + }, + Modifier: &node.Identifier{Value: "public"}, + Alias: &node.Identifier{Value: "two"}, }, - Modifier: &node.Identifier{Value: "public"}, - Alias: &node.Identifier{Value: "two"}, }, }, }, @@ -1532,39 +1537,41 @@ func TestPhp5(t *testing.T) { }, }, }, - Adaptations: []node.Node{ - &stmt.TraitUsePrecedence{ - Ref: &stmt.TraitMethodRef{ - Trait: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + TraitAdaptationList: &stmt.TraitAdaptationList{ + Adaptations: []node.Node{ + &stmt.TraitUsePrecedence{ + Ref: &stmt.TraitMethodRef{ + Trait: &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Bar"}, + }, }, + Method: &node.Identifier{Value: "one"}, }, - Method: &node.Identifier{Value: "one"}, - }, - Insteadof: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + Insteadof: []node.Node{ + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Baz"}, + }, }, - }, - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Quux"}, + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Quux"}, + }, }, }, }, - }, - &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Trait: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &stmt.TraitUseAlias{ + Ref: &stmt.TraitMethodRef{ + Trait: &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Baz"}, + }, }, + Method: &node.Identifier{Value: "one"}, }, - Method: &node.Identifier{Value: "one"}, + Alias: &node.Identifier{Value: "two"}, }, - Alias: &node.Identifier{Value: "two"}, }, }, }, diff --git a/php7/php7.go b/php7/php7.go index 32ba4b3..e5ffa3a 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -345,7 +345,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:4125 +//line php7/php7.y:4160 type foreachVariable struct { node node.Node @@ -644,8 +644,8 @@ var yyAct = [...]int{ 527, 256, 257, 531, 738, 106, 222, 740, 818, 805, 526, 256, 257, 521, 860, 824, 367, 873, 827, 145, 806, 792, 817, 232, 823, 142, 719, 323, 149, 255, - 836, 834, 660, 822, 278, 255, 251, 840, 830, 645, - 422, 255, 928, 849, 224, 43, 282, 42, 16, 15, + 836, 834, 660, 822, 278, 255, 251, 645, 830, 928, + 422, 255, 840, 849, 224, 43, 282, 42, 16, 15, 851, 843, 599, 267, 546, 49, 546, 848, 745, 746, 747, 744, 743, 742, 853, 48, 867, 108, 671, 255, 50, 846, 858, 871, 252, 83, 880, 866, 839, 884, @@ -1453,7 +1453,7 @@ var yyPgo = [...]int{ 855, 853, 5, 852, 83, 40, 845, 138, 43, 840, 837, 835, 825, 823, 119, 822, 819, 818, 817, 12, 815, 814, 44, 42, 32, 2, 15, 629, 41, 74, - 8, 686, 20, 812, 809, 807, 536, 806, 121, 803, + 812, 8, 686, 20, 809, 807, 536, 806, 121, 803, 802, 800, 71, 798, 33, 797, 795, 30, 37, 791, 789, 28, 787, 786, 545, 784, 18, 783, 776, 26, 773, 63, 1, 4, 768, 17, 767, 39, 765, 763, @@ -1471,7 +1471,7 @@ var yyR1 = [...]int{ 5, 5, 5, 5, 5, 5, 6, 6, 111, 111, 88, 88, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 81, 81, 16, 16, 18, 18, 7, 7, 98, 98, + 82, 82, 16, 16, 18, 18, 7, 7, 98, 98, 97, 97, 104, 104, 17, 17, 20, 20, 19, 19, 92, 92, 112, 112, 22, 22, 22, 22, 22, 22, 22, 11, 11, 11, 11, 11, 11, 11, 11, 11, @@ -1479,16 +1479,16 @@ var yyR1 = [...]int{ 11, 11, 11, 11, 11, 90, 90, 89, 89, 26, 26, 103, 103, 27, 12, 1, 1, 2, 2, 13, 13, 122, 122, 77, 77, 14, 15, 29, 29, 116, - 116, 117, 117, 82, 82, 82, 82, 125, 125, 126, - 126, 25, 25, 84, 84, 84, 84, 101, 101, 101, + 116, 117, 117, 83, 83, 83, 83, 125, 125, 126, + 126, 25, 25, 85, 85, 85, 85, 101, 101, 101, 8, 8, 124, 124, 68, 68, 66, 66, 70, 70, 67, 67, 113, 113, 114, 114, 30, 30, 31, 31, 76, 76, 74, 74, 74, 75, 75, 78, 78, 110, 110, 32, 32, 96, 96, 34, 100, 100, 35, 35, - 115, 115, 36, 36, 36, 36, 121, 121, 85, 85, - 85, 102, 102, 37, 37, 38, 39, 39, 39, 39, - 41, 41, 40, 83, 83, 119, 119, 118, 118, 120, - 120, 80, 80, 80, 80, 80, 80, 99, 99, 42, + 115, 115, 36, 36, 36, 36, 121, 121, 80, 80, + 80, 102, 102, 37, 37, 38, 39, 39, 39, 39, + 41, 41, 40, 84, 84, 119, 119, 118, 118, 120, + 120, 81, 81, 81, 81, 81, 81, 99, 99, 42, 42, 91, 91, 69, 21, 93, 93, 43, 94, 94, 95, 95, 45, 44, 44, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, @@ -1576,7 +1576,7 @@ var yyChk = [...]int{ -58, -53, -46, -56, -57, 91, 49, 50, 4, 5, 84, 85, 86, 8, 9, 66, 67, 81, 63, 64, 65, 80, 62, 74, 140, 12, 157, -10, -60, 60, - 18, -88, 82, 146, 82, -88, 142, 10, -18, -81, + 18, -88, 82, 146, 82, -88, 142, 10, -18, -82, -104, -88, 82, 37, 38, -19, -20, -92, -21, 10, -112, 146, -11, 37, 79, 146, 146, -24, -23, 98, -24, -24, -96, -34, -48, -100, 37, -35, 12, -93, @@ -1628,9 +1628,9 @@ var yyChk = [...]int{ 10, 13, 152, 12, 10, 143, 143, 148, 143, -23, 149, -78, -23, -78, -48, -24, -23, -55, -48, -29, -7, 158, 147, 147, 143, -7, 158, -23, 147, 143, - 142, 82, -98, -17, -20, -81, 142, -123, 147, -124, - -11, 145, -23, -94, -23, -84, 142, 145, 146, -23, - 147, -27, -82, -28, 151, 59, 148, -25, -11, 145, + 142, 82, -98, -17, -20, -82, 142, -123, 147, -124, + -11, 145, -23, -94, -23, -85, 142, 145, 146, -23, + 147, -27, -83, -28, 151, 59, 148, -25, -11, 145, -90, 146, -113, -114, -30, -31, -76, -74, 150, 60, 61, -10, -117, -123, -121, -115, 142, 158, 147, 147, 95, -11, 145, 143, 160, -23, -28, 146, 147, 149, @@ -1639,25 +1639,25 @@ var yyChk = [...]int{ 144, -101, 144, -101, 144, -113, 144, 147, 58, -28, 146, -109, -112, -26, 41, 42, -113, 147, 158, -1, 151, -74, -123, 142, 143, -36, -119, -118, 44, -120, - 47, -80, 103, 102, 101, 98, 99, 100, -115, -10, + 47, -81, 103, 102, 101, 98, 99, 100, -115, -10, -11, 145, 144, -112, -23, -109, 149, -123, -7, 158, -97, 143, -17, -7, 22, 144, -94, 143, 32, 33, - -101, 31, -101, 147, -126, -11, 145, -82, -28, -109, + -101, 31, -101, 147, -126, -11, 145, -83, -28, -109, 149, 28, 146, 142, 147, -106, 44, -30, -2, 83, - 142, -115, -99, -42, 12, 38, 37, -121, -80, 143, + 142, -115, -99, -42, 12, 38, 37, -121, -81, 143, -112, 147, 143, 142, 143, -20, -7, 143, 144, 147, -23, -8, 145, 144, 143, 144, 31, -106, -112, 147, 147, 144, -89, -10, -112, -75, 145, -75, 146, 12, -115, 143, 144, 158, -123, 160, -91, -69, -6, -3, - -85, 144, 142, -115, 143, -125, -11, 145, -8, -112, + -80, 144, 142, -115, 143, -125, -11, 145, -8, -112, 144, -75, 26, -126, 12, 159, 143, 142, -76, 142, -105, -52, 12, 151, 160, 143, -42, -23, 144, 158, 160, -6, 143, -102, -37, -38, -39, -40, -41, -10, -6, 79, 10, 143, -112, -112, 142, 144, 147, -10, -112, -112, 147, 158, 12, -23, -123, -69, -23, -123, 143, -37, 144, 144, 45, 29, 78, 24, -112, 142, - 143, 143, -52, -123, 146, -121, 10, -4, -80, -6, - 144, 143, -112, -113, -6, 143, 147, -75, -83, 144, + 143, 143, -52, -123, 146, -121, 10, -4, -81, -6, + 144, 143, -112, -113, -6, 143, 147, -75, -84, 144, 142, -112, 143, } var yyDef = [...]int{ @@ -2133,7 +2133,7 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:294 + //line php7/php7.y:295 { yylex.(*Parser).rootNode = stmt.NewStmtList(yyDollar[1].list) @@ -2142,463 +2142,463 @@ yydefault: } case 2: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 3: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 5: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 10: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 11: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 12: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 13: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 14: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 15: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 16: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 17: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 18: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 21: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 22: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 23: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 24: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 27: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 28: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 29: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 30: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 33: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 34: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 35: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 36: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 37: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 38: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 39: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 44: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 46: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 47: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 48: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 49: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 50: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 51: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 52: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 53: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 54: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 55: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 56: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 57: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 58: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 59: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 60: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 61: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 62: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 63: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 64: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 66: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 67: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 68: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 69: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 70: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 72: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 73: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 74: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 75: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 76: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 77: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:322 + //line php7/php7.y:323 { yyVAL.token = yyDollar[1].token } case 78: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:327 + //line php7/php7.y:328 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2606,13 +2606,13 @@ yydefault: } case 79: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:333 + //line php7/php7.y:334 { yyVAL.list = []node.Node{} } case 80: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:338 + //line php7/php7.y:339 { namePart := name.NewNamePart(yyDollar[1].token.Value) yyVAL.list = []node.Node{namePart} @@ -2625,7 +2625,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:349 + //line php7/php7.y:350 { namePart := name.NewNamePart(yyDollar[3].token.Value) yyVAL.list = append(yyDollar[1].list, namePart) @@ -2639,7 +2639,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:364 + //line php7/php7.y:365 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -2648,7 +2648,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:371 + //line php7/php7.y:372 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -2661,7 +2661,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:382 + //line php7/php7.y:383 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -2673,44 +2673,44 @@ yydefault: } case 85: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:395 + //line php7/php7.y:396 { // error yyVAL.node = nil } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:400 + //line php7/php7.y:401 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:402 + //line php7/php7.y:403 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:404 + //line php7/php7.y:405 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:406 + //line php7/php7.y:407 { yyVAL.node = yyDollar[1].node } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:408 + //line php7/php7.y:409 { yyVAL.node = yyDollar[1].node } case 91: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:410 + //line php7/php7.y:411 { yyVAL.node = stmt.NewHaltCompiler() @@ -2725,7 +2725,7 @@ yydefault: } case 92: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:423 + //line php7/php7.y:424 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2740,7 +2740,7 @@ yydefault: } case 93: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:436 + //line php7/php7.y:437 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2756,7 +2756,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:450 + //line php7/php7.y:451 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2770,7 +2770,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:462 + //line php7/php7.y:463 { yyVAL.node = yyDollar[2].node @@ -2783,7 +2783,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:473 + //line php7/php7.y:474 { yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) @@ -2796,7 +2796,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:484 + //line php7/php7.y:485 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2809,7 +2809,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:495 + //line php7/php7.y:496 { yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) @@ -2822,7 +2822,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:506 + //line php7/php7.y:507 { yyVAL.node = stmt.NewConstList(yyDollar[2].list) @@ -2835,7 +2835,7 @@ yydefault: } case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:520 + //line php7/php7.y:521 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2847,7 +2847,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:530 + //line php7/php7.y:531 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2859,7 +2859,7 @@ yydefault: } case 102: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:543 + //line php7/php7.y:544 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2878,7 +2878,7 @@ yydefault: } case 103: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:560 + //line php7/php7.y:561 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2898,7 +2898,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:581 + //line php7/php7.y:582 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2917,7 +2917,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:598 + //line php7/php7.y:599 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2937,19 +2937,19 @@ yydefault: } case 106: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:619 + //line php7/php7.y:620 { yyVAL.token = nil } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:621 + //line php7/php7.y:622 { yyVAL.token = yyDollar[1].token } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:626 + //line php7/php7.y:627 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2958,13 +2958,13 @@ yydefault: } case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:633 + //line php7/php7.y:634 { yyVAL.list = []node.Node{yyDollar[1].node} } case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:638 + //line php7/php7.y:639 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2973,13 +2973,13 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:645 + //line php7/php7.y:646 { yyVAL.list = []node.Node{yyDollar[1].node} } case 112: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:650 + //line php7/php7.y:651 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2988,25 +2988,25 @@ yydefault: } case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:657 + //line php7/php7.y:658 { yyVAL.list = []node.Node{yyDollar[1].node} } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:662 + //line php7/php7.y:663 { yyVAL.node = yyDollar[1].node } case 115: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:664 + //line php7/php7.y:665 { yyVAL.node = yyDollar[2].node.(*stmt.Use).SetUseType(yyDollar[1].node) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:669 + //line php7/php7.y:670 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -3017,7 +3017,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:678 + //line php7/php7.y:679 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -3034,13 +3034,13 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:696 + //line php7/php7.y:697 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:698 + //line php7/php7.y:699 { yyVAL.node = yyDollar[2].node @@ -3049,7 +3049,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:708 + //line php7/php7.y:709 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3058,13 +3058,13 @@ yydefault: } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:715 + //line php7/php7.y:716 { yyVAL.list = []node.Node{yyDollar[1].node} } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:720 + //line php7/php7.y:721 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3072,50 +3072,50 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:726 + //line php7/php7.y:727 { yyVAL.list = []node.Node{} } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:731 + //line php7/php7.y:732 { // error yyVAL.node = nil } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:736 + //line php7/php7.y:737 { yyVAL.node = yyDollar[1].node } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:738 + //line php7/php7.y:739 { yyVAL.node = yyDollar[1].node } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:740 + //line php7/php7.y:741 { yyVAL.node = yyDollar[1].node } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:742 + //line php7/php7.y:743 { yyVAL.node = yyDollar[1].node } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:744 + //line php7/php7.y:745 { yyVAL.node = yyDollar[1].node } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:746 + //line php7/php7.y:747 { yyVAL.node = stmt.NewHaltCompiler() @@ -3130,7 +3130,7 @@ yydefault: } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:761 + //line php7/php7.y:762 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3143,19 +3143,19 @@ yydefault: } case 132: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:772 + //line php7/php7.y:773 { yyVAL.node = yyDollar[1].node } case 133: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:774 + //line php7/php7.y:775 { yyVAL.node = yyDollar[1].node } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:776 + //line php7/php7.y:777 { if yyDollar[5].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltWhile(yyDollar[3].node, yyDollar[5].altSyntaxNode.node) @@ -3173,7 +3173,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:792 + //line php7/php7.y:793 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) @@ -3189,7 +3189,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:806 + //line php7/php7.y:807 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltFor(yyDollar[3].list, yyDollar[5].list, yyDollar[7].list, yyDollar[9].altSyntaxNode.node) @@ -3209,7 +3209,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:824 + //line php7/php7.y:825 { if yyDollar[5].nodesWithEndToken.endToken.Value == ";" { yyVAL.node = stmt.NewAltSwitch(yyDollar[3].node, yyDollar[5].nodesWithEndToken.nodes) @@ -3227,7 +3227,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:840 + //line php7/php7.y:841 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3240,7 +3240,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:851 + //line php7/php7.y:852 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3253,7 +3253,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:862 + //line php7/php7.y:863 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3266,7 +3266,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:873 + //line php7/php7.y:874 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3279,7 +3279,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:884 + //line php7/php7.y:885 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3292,7 +3292,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:895 + //line php7/php7.y:896 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3305,7 +3305,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:906 + //line php7/php7.y:907 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3317,7 +3317,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:916 + //line php7/php7.y:917 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3329,7 +3329,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:926 + //line php7/php7.y:927 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3347,7 +3347,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:942 + //line php7/php7.y:943 { if yyDollar[7].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, nil, yyDollar[5].foreachVariable.node, yyDollar[7].altSyntaxNode.node, yyDollar[5].foreachVariable.byRef) @@ -3366,7 +3366,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:959 + //line php7/php7.y:960 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, yyDollar[5].node, yyDollar[7].foreachVariable.node, yyDollar[9].altSyntaxNode.node, yyDollar[7].foreachVariable.byRef) @@ -3386,7 +3386,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:977 + //line php7/php7.y:978 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) @@ -3400,7 +3400,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:989 + //line php7/php7.y:990 { yyVAL.node = stmt.NewNop() @@ -3412,7 +3412,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:999 + //line php7/php7.y:1000 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3429,7 +3429,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1014 + //line php7/php7.y:1015 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3442,7 +3442,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1025 + //line php7/php7.y:1026 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3458,7 +3458,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1039 + //line php7/php7.y:1040 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -3473,13 +3473,13 @@ yydefault: } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1054 + //line php7/php7.y:1055 { yyVAL.list = []node.Node{} } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1056 + //line php7/php7.y:1057 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[5].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -3501,13 +3501,13 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1078 + //line php7/php7.y:1079 { yyVAL.list = []node.Node{yyDollar[1].node} } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1080 + //line php7/php7.y:1081 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3516,13 +3516,13 @@ yydefault: } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1090 + //line php7/php7.y:1091 { yyVAL.node = nil } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1092 + //line php7/php7.y:1093 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3536,13 +3536,13 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1107 + //line php7/php7.y:1108 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1109 + //line php7/php7.y:1110 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3551,13 +3551,13 @@ yydefault: } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1119 + //line php7/php7.y:1120 { yyVAL.node = yyDollar[1].node } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1124 + //line php7/php7.y:1125 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].boolWithToken.value, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) @@ -3579,31 +3579,31 @@ yydefault: } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1147 + //line php7/php7.y:1148 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1149 + //line php7/php7.y:1150 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1154 + //line php7/php7.y:1155 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1156 + //line php7/php7.y:1157 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1161 + //line php7/php7.y:1162 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].node, yyDollar[5].list, yyDollar[8].list, yyDollar[6].str) @@ -3626,7 +3626,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1182 + //line php7/php7.y:1183 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) @@ -3649,19 +3649,19 @@ yydefault: } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1206 + //line php7/php7.y:1207 { yyVAL.list = []node.Node{yyDollar[1].node} } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1208 + //line php7/php7.y:1209 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1213 + //line php7/php7.y:1214 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3673,7 +3673,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1223 + //line php7/php7.y:1224 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3685,7 +3685,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1236 + //line php7/php7.y:1237 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3702,7 +3702,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1254 + //line php7/php7.y:1255 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].list, yyDollar[6].list, yyDollar[4].str) @@ -3722,13 +3722,13 @@ yydefault: } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1275 + //line php7/php7.y:1276 { yyVAL.node = nil } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1277 + //line php7/php7.y:1278 { yyVAL.node = yyDollar[2].node @@ -3737,13 +3737,13 @@ yydefault: } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1287 + //line php7/php7.y:1288 { yyVAL.list = nil } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1289 + //line php7/php7.y:1290 { yyVAL.list = yyDollar[2].list @@ -3752,13 +3752,13 @@ yydefault: } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1299 + //line php7/php7.y:1300 { yyVAL.list = nil } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1301 + //line php7/php7.y:1302 { yyVAL.list = yyDollar[2].list @@ -3767,13 +3767,13 @@ yydefault: } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1311 + //line php7/php7.y:1312 { yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1313 + //line php7/php7.y:1314 { yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} @@ -3785,7 +3785,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1323 + //line php7/php7.y:1324 { list := expr.NewList(yyDollar[3].list) yyVAL.foreachVariable = foreachVariable{list, false} @@ -3800,7 +3800,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1336 + //line php7/php7.y:1337 { list := expr.NewShortList(yyDollar[2].list) yyVAL.foreachVariable = foreachVariable{list, false} @@ -3814,13 +3814,13 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1351 + //line php7/php7.y:1352 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1353 + //line php7/php7.y:1354 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} @@ -3834,13 +3834,13 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1368 + //line php7/php7.y:1369 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1370 + //line php7/php7.y:1371 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} @@ -3854,13 +3854,13 @@ yydefault: } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1385 + //line php7/php7.y:1386 { yyVAL.node = yyDollar[1].node } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1387 + //line php7/php7.y:1388 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3874,37 +3874,37 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1401 + //line php7/php7.y:1402 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1402 + //line php7/php7.y:1403 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[4].token} } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1403 + //line php7/php7.y:1404 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[4].token} } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1404 + //line php7/php7.y:1405 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[5].token} } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1409 + //line php7/php7.y:1410 { yyVAL.list = []node.Node{} } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1411 + //line php7/php7.y:1412 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -3918,7 +3918,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1423 + //line php7/php7.y:1424 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -3932,25 +3932,25 @@ yydefault: } case 200: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1438 + //line php7/php7.y:1439 { yyVAL.token = yyDollar[1].token } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1440 + //line php7/php7.y:1441 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1445 + //line php7/php7.y:1446 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1447 + //line php7/php7.y:1448 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} @@ -3964,7 +3964,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1462 + //line php7/php7.y:1463 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -3978,7 +3978,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1474 + //line php7/php7.y:1475 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -3994,13 +3994,13 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1491 + //line php7/php7.y:1492 { yyVAL.node = yyDollar[1].node } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1493 + //line php7/php7.y:1494 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4014,7 +4014,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1508 + //line php7/php7.y:1509 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4031,7 +4031,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1523 + //line php7/php7.y:1524 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4049,7 +4049,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1542 + //line php7/php7.y:1543 { yyVAL.node = yyDollar[1].node @@ -4062,7 +4062,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1553 + //line php7/php7.y:1554 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4081,25 +4081,25 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1573 + //line php7/php7.y:1574 { yyVAL.list = yyDollar[1].list } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1575 + //line php7/php7.y:1576 { yyVAL.list = nil } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1580 + //line php7/php7.y:1581 { yyVAL.list = []node.Node{yyDollar[1].node} } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1582 + //line php7/php7.y:1583 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4108,7 +4108,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1592 + //line php7/php7.y:1593 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4147,7 +4147,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1629 + //line php7/php7.y:1630 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4186,25 +4186,25 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1669 + //line php7/php7.y:1670 { yyVAL.node = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1671 + //line php7/php7.y:1672 { yyVAL.node = yyDollar[1].node } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1676 + //line php7/php7.y:1677 { yyVAL.node = yyDollar[1].node } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1678 + //line php7/php7.y:1679 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4216,7 +4216,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1691 + //line php7/php7.y:1692 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4228,7 +4228,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1701 + //line php7/php7.y:1702 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4240,19 +4240,19 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1711 + //line php7/php7.y:1712 { yyVAL.node = yyDollar[1].node } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1716 + //line php7/php7.y:1717 { yyVAL.node = nil } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1718 + //line php7/php7.y:1719 { yyVAL.node = yyDollar[2].node @@ -4261,7 +4261,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1728 + //line php7/php7.y:1729 { yyVAL.node = node.NewArgumentList(nil) @@ -4270,7 +4270,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1735 + //line php7/php7.y:1736 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4279,13 +4279,13 @@ yydefault: } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1745 + //line php7/php7.y:1746 { yyVAL.list = []node.Node{yyDollar[1].node} } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1747 + //line php7/php7.y:1748 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4294,7 +4294,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1757 + //line php7/php7.y:1758 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4303,7 +4303,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1764 + //line php7/php7.y:1765 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4315,7 +4315,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1777 + //line php7/php7.y:1778 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4324,19 +4324,19 @@ yydefault: } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1784 + //line php7/php7.y:1785 { yyVAL.list = []node.Node{yyDollar[1].node} } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1789 + //line php7/php7.y:1790 { yyVAL.node = yyDollar[1].node } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1794 + //line php7/php7.y:1795 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4345,13 +4345,13 @@ yydefault: } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1801 + //line php7/php7.y:1802 { yyVAL.list = []node.Node{yyDollar[1].node} } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1806 + //line php7/php7.y:1807 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4367,7 +4367,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1820 + //line php7/php7.y:1821 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4384,19 +4384,19 @@ yydefault: } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1838 + //line php7/php7.y:1839 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1840 + //line php7/php7.y:1841 { yyVAL.list = []node.Node{} } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1845 + //line php7/php7.y:1846 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4408,7 +4408,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1855 + //line php7/php7.y:1856 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4421,19 +4421,29 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1866 + //line php7/php7.y:1867 { - yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, yyDollar[3].nodesWithEndToken.nodes) + var adaptationList *stmt.TraitAdaptationList + + switch n := yyDollar[3].node.(type) { + case *stmt.TraitAdaptationList: + adaptationList = n + default: + adaptationList = nil + yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, yyDollar[3].node) + } + + yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, adaptationList) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].nodesWithEndToken.endToken)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:1876 + //line php7/php7.y:1887 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].boolWithToken.value, yyDollar[7].list, yyDollar[9].node, yyDollar[10].nodesWithEndToken.nodes, yyDollar[5].str) @@ -4453,13 +4463,13 @@ yydefault: } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1897 + //line php7/php7.y:1908 { yyVAL.list = []node.Node{yyDollar[1].node} } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1899 + //line php7/php7.y:1910 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4468,37 +4478,55 @@ yydefault: } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1909 + //line php7/php7.y:1920 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} + yyVAL.node = stmt.NewNop() + + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) + } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1911 + //line php7/php7.y:1930 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[2].token} + yyVAL.node = stmt.NewTraitAdaptationList(nil) + + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CloseCurlyBracesToken) } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1913 + //line php7/php7.y:1940 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} + yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) + + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1918 + //line php7/php7.y:1953 { yyVAL.list = []node.Node{yyDollar[1].node} } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1920 + //line php7/php7.y:1955 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1925 + //line php7/php7.y:1960 { yyVAL.node = yyDollar[1].node @@ -4507,7 +4535,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1932 + //line php7/php7.y:1967 { yyVAL.node = yyDollar[1].node @@ -4516,7 +4544,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1942 + //line php7/php7.y:1977 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4528,7 +4556,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1955 + //line php7/php7.y:1990 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4543,7 +4571,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1968 + //line php7/php7.y:2003 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4558,7 +4586,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1981 + //line php7/php7.y:2016 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -4573,7 +4601,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1994 + //line php7/php7.y:2029 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -4585,7 +4613,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2007 + //line php7/php7.y:2042 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -4599,13 +4627,13 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2019 + //line php7/php7.y:2054 { yyVAL.node = yyDollar[1].node } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2024 + //line php7/php7.y:2059 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -4620,25 +4648,25 @@ yydefault: } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2039 + //line php7/php7.y:2074 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2040 + //line php7/php7.y:2075 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2045 + //line php7/php7.y:2080 { yyVAL.list = yyDollar[1].list } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2047 + //line php7/php7.y:2082 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -4651,31 +4679,31 @@ yydefault: } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2061 + //line php7/php7.y:2096 { yyVAL.list = nil } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2063 + //line php7/php7.y:2098 { yyVAL.list = yyDollar[1].list } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2068 + //line php7/php7.y:2103 { yyVAL.list = []node.Node{yyDollar[1].node} } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2070 + //line php7/php7.y:2105 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2075 + //line php7/php7.y:2110 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4687,7 +4715,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2085 + //line php7/php7.y:2120 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4699,7 +4727,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2095 + //line php7/php7.y:2130 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4711,7 +4739,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2105 + //line php7/php7.y:2140 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4723,7 +4751,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2115 + //line php7/php7.y:2150 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4735,7 +4763,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2125 + //line php7/php7.y:2160 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4747,7 +4775,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2138 + //line php7/php7.y:2173 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4756,13 +4784,13 @@ yydefault: } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2145 + //line php7/php7.y:2180 { yyVAL.list = []node.Node{yyDollar[1].node} } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2150 + //line php7/php7.y:2185 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4778,7 +4806,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2164 + //line php7/php7.y:2199 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4795,7 +4823,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2182 + //line php7/php7.y:2217 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4804,13 +4832,13 @@ yydefault: } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2189 + //line php7/php7.y:2224 { yyVAL.list = []node.Node{yyDollar[1].node} } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2194 + //line php7/php7.y:2229 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4825,7 +4853,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2210 + //line php7/php7.y:2245 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4840,7 +4868,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2226 + //line php7/php7.y:2261 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4849,31 +4877,31 @@ yydefault: } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2233 + //line php7/php7.y:2268 { yyVAL.list = []node.Node{yyDollar[1].node} } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2238 + //line php7/php7.y:2273 { yyVAL.node = yyDollar[1].node } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2243 + //line php7/php7.y:2278 { yyVAL.list = nil } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2245 + //line php7/php7.y:2280 { yyVAL.list = yyDollar[1].list } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2250 + //line php7/php7.y:2285 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4882,13 +4910,13 @@ yydefault: } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2257 + //line php7/php7.y:2292 { yyVAL.list = []node.Node{yyDollar[1].node} } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:2262 + //line php7/php7.y:2297 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) @@ -4912,7 +4940,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2287 + //line php7/php7.y:2322 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -4927,7 +4955,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2300 + //line php7/php7.y:2335 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -4939,7 +4967,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2313 + //line php7/php7.y:2348 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -4956,7 +4984,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:2328 + //line php7/php7.y:2363 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -4972,7 +5000,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2342 + //line php7/php7.y:2377 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -4984,7 +5012,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2352 + //line php7/php7.y:2387 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -4997,7 +5025,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2363 + //line php7/php7.y:2398 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5009,7 +5037,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2373 + //line php7/php7.y:2408 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5021,7 +5049,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2383 + //line php7/php7.y:2418 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5033,7 +5061,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2393 + //line php7/php7.y:2428 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5045,7 +5073,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2403 + //line php7/php7.y:2438 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5057,7 +5085,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2413 + //line php7/php7.y:2448 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5069,7 +5097,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2423 + //line php7/php7.y:2458 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5081,7 +5109,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2433 + //line php7/php7.y:2468 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5093,7 +5121,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2443 + //line php7/php7.y:2478 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5105,7 +5133,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2453 + //line php7/php7.y:2488 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5117,7 +5145,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2463 + //line php7/php7.y:2498 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5129,7 +5157,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2473 + //line php7/php7.y:2508 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5141,7 +5169,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2483 + //line php7/php7.y:2518 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5153,7 +5181,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2493 + //line php7/php7.y:2528 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5165,7 +5193,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2503 + //line php7/php7.y:2538 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5177,7 +5205,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2513 + //line php7/php7.y:2548 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5189,7 +5217,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2523 + //line php7/php7.y:2558 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5201,7 +5229,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2533 + //line php7/php7.y:2568 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5213,7 +5241,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2543 + //line php7/php7.y:2578 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5225,7 +5253,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2553 + //line php7/php7.y:2588 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5237,7 +5265,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2563 + //line php7/php7.y:2598 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5249,7 +5277,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2573 + //line php7/php7.y:2608 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5261,7 +5289,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2583 + //line php7/php7.y:2618 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5273,7 +5301,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2593 + //line php7/php7.y:2628 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5285,7 +5313,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2603 + //line php7/php7.y:2638 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5297,7 +5325,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2613 + //line php7/php7.y:2648 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5309,7 +5337,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2623 + //line php7/php7.y:2658 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5321,7 +5349,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2633 + //line php7/php7.y:2668 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5333,7 +5361,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2643 + //line php7/php7.y:2678 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5345,7 +5373,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2653 + //line php7/php7.y:2688 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5357,7 +5385,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2663 + //line php7/php7.y:2698 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5369,7 +5397,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2673 + //line php7/php7.y:2708 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5381,7 +5409,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2683 + //line php7/php7.y:2718 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5393,7 +5421,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2693 + //line php7/php7.y:2728 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5405,7 +5433,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2703 + //line php7/php7.y:2738 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -5417,7 +5445,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2713 + //line php7/php7.y:2748 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -5429,7 +5457,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2723 + //line php7/php7.y:2758 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -5441,7 +5469,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2733 + //line php7/php7.y:2768 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -5453,7 +5481,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2743 + //line php7/php7.y:2778 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5465,7 +5493,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2753 + //line php7/php7.y:2788 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5477,7 +5505,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2763 + //line php7/php7.y:2798 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -5489,7 +5517,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2773 + //line php7/php7.y:2808 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -5501,7 +5529,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2783 + //line php7/php7.y:2818 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -5513,7 +5541,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2793 + //line php7/php7.y:2828 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5525,7 +5553,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2803 + //line php7/php7.y:2838 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -5537,7 +5565,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2813 + //line php7/php7.y:2848 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5549,7 +5577,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2823 + //line php7/php7.y:2858 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -5561,7 +5589,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2833 + //line php7/php7.y:2868 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -5573,7 +5601,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2843 + //line php7/php7.y:2878 { yyVAL.node = yyDollar[2].node @@ -5583,13 +5611,13 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2851 + //line php7/php7.y:2886 { yyVAL.node = yyDollar[1].node } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:2853 + //line php7/php7.y:2888 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -5602,7 +5630,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2864 + //line php7/php7.y:2899 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -5615,7 +5643,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2875 + //line php7/php7.y:2910 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -5627,13 +5655,13 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2885 + //line php7/php7.y:2920 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2887 + //line php7/php7.y:2922 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -5645,7 +5673,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2897 + //line php7/php7.y:2932 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -5657,7 +5685,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2907 + //line php7/php7.y:2942 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -5669,7 +5697,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2917 + //line php7/php7.y:2952 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -5681,7 +5709,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2927 + //line php7/php7.y:2962 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -5693,7 +5721,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2937 + //line php7/php7.y:2972 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -5705,7 +5733,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2947 + //line php7/php7.y:2982 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -5717,7 +5745,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2957 + //line php7/php7.y:2992 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -5733,7 +5761,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2971 + //line php7/php7.y:3006 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -5745,13 +5773,13 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2981 + //line php7/php7.y:3016 { yyVAL.node = yyDollar[1].node } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2983 + //line php7/php7.y:3018 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -5764,7 +5792,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2994 + //line php7/php7.y:3029 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -5776,7 +5804,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3004 + //line php7/php7.y:3039 { yyVAL.node = expr.NewYield(nil, nil) @@ -5788,7 +5816,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3014 + //line php7/php7.y:3049 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -5800,7 +5828,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3024 + //line php7/php7.y:3059 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -5813,7 +5841,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3035 + //line php7/php7.y:3070 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -5825,7 +5853,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3045 + //line php7/php7.y:3080 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].boolWithToken.value, yyDollar[3].str) @@ -5844,7 +5872,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:3062 + //line php7/php7.y:3097 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].list, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].boolWithToken.value, yyDollar[4].str) @@ -5864,38 +5892,38 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3083 + //line php7/php7.y:3118 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3091 + //line php7/php7.y:3126 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3093 + //line php7/php7.y:3128 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3098 + //line php7/php7.y:3133 { yyVAL.list = []node.Node{} } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3100 + //line php7/php7.y:3135 { yyVAL.list = yyDollar[3].list } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3105 + //line php7/php7.y:3140 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5904,13 +5932,13 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3112 + //line php7/php7.y:3147 { yyVAL.list = []node.Node{yyDollar[1].node} } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3117 + //line php7/php7.y:3152 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -5926,7 +5954,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3131 + //line php7/php7.y:3166 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -5943,7 +5971,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3149 + //line php7/php7.y:3184 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -5952,7 +5980,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3156 + //line php7/php7.y:3191 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -5964,7 +5992,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3166 + //line php7/php7.y:3201 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -5976,7 +6004,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3176 + //line php7/php7.y:3211 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -5985,7 +6013,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3186 + //line php7/php7.y:3221 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -5997,67 +6025,67 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3196 + //line php7/php7.y:3231 { yyVAL.node = yyDollar[1].node } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3201 + //line php7/php7.y:3236 { yyVAL.node = yyDollar[1].node } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3203 + //line php7/php7.y:3238 { yyVAL.node = yyDollar[1].node } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3208 + //line php7/php7.y:3243 { yyVAL.node = nil } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3210 + //line php7/php7.y:3245 { yyVAL.node = yyDollar[2].node } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3215 + //line php7/php7.y:3250 { yyVAL.list = []node.Node{} } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3217 + //line php7/php7.y:3252 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3219 + //line php7/php7.y:3254 { yyVAL.list = yyDollar[1].list } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3224 + //line php7/php7.y:3259 { yyVAL.node = nil } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3226 + //line php7/php7.y:3261 { yyVAL.node = yyDollar[1].node } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3231 + //line php7/php7.y:3266 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6071,7 +6099,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3243 + //line php7/php7.y:3278 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6084,7 +6112,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3254 + //line php7/php7.y:3289 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6096,7 +6124,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3267 + //line php7/php7.y:3302 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6108,7 +6136,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3277 + //line php7/php7.y:3312 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6120,7 +6148,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3287 + //line php7/php7.y:3322 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6132,7 +6160,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3297 + //line php7/php7.y:3332 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6144,7 +6172,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3307 + //line php7/php7.y:3342 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6156,7 +6184,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3317 + //line php7/php7.y:3352 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6168,7 +6196,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3327 + //line php7/php7.y:3362 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6180,7 +6208,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3337 + //line php7/php7.y:3372 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6192,7 +6220,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3347 + //line php7/php7.y:3382 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6204,7 +6232,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3357 + //line php7/php7.y:3392 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6216,7 +6244,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3367 + //line php7/php7.y:3402 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -6230,7 +6258,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3379 + //line php7/php7.y:3414 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -6242,7 +6270,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3389 + //line php7/php7.y:3424 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -6254,7 +6282,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3399 + //line php7/php7.y:3434 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -6266,19 +6294,19 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3409 + //line php7/php7.y:3444 { yyVAL.node = yyDollar[1].node } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3411 + //line php7/php7.y:3446 { yyVAL.node = yyDollar[1].node } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3416 + //line php7/php7.y:3451 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -6287,7 +6315,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3423 + //line php7/php7.y:3458 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6302,7 +6330,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3436 + //line php7/php7.y:3471 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6317,43 +6345,43 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3452 + //line php7/php7.y:3487 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3454 + //line php7/php7.y:3489 { yyVAL.node = yyDollar[1].node } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3459 + //line php7/php7.y:3494 { yyVAL.node = nil } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3461 + //line php7/php7.y:3496 { yyVAL.node = yyDollar[1].node } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3466 + //line php7/php7.y:3501 { yyVAL.node = yyDollar[1].node } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3471 + //line php7/php7.y:3506 { yyVAL.node = yyDollar[1].node } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3473 + //line php7/php7.y:3508 { yyVAL.node = yyDollar[2].node @@ -6363,19 +6391,19 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3481 + //line php7/php7.y:3516 { yyVAL.node = yyDollar[1].node } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3486 + //line php7/php7.y:3521 { yyVAL.node = yyDollar[1].node } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3488 + //line php7/php7.y:3523 { yyVAL.node = yyDollar[2].node @@ -6385,19 +6413,19 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3496 + //line php7/php7.y:3531 { yyVAL.node = yyDollar[1].node } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3501 + //line php7/php7.y:3536 { yyVAL.node = yyDollar[1].node } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3503 + //line php7/php7.y:3538 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6410,7 +6438,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3514 + //line php7/php7.y:3549 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6423,7 +6451,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3525 + //line php7/php7.y:3560 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6436,7 +6464,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3536 + //line php7/php7.y:3571 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6448,25 +6476,25 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3546 + //line php7/php7.y:3581 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3551 + //line php7/php7.y:3586 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3553 + //line php7/php7.y:3588 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3555 + //line php7/php7.y:3590 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6478,7 +6506,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3568 + //line php7/php7.y:3603 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6492,7 +6520,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3580 + //line php7/php7.y:3615 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -6506,7 +6534,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3592 + //line php7/php7.y:3627 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6518,7 +6546,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3605 + //line php7/php7.y:3640 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6530,7 +6558,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3615 + //line php7/php7.y:3650 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6542,13 +6570,13 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3628 + //line php7/php7.y:3663 { yyVAL.node = yyDollar[1].node } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3630 + //line php7/php7.y:3665 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6561,7 +6589,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3641 + //line php7/php7.y:3676 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6574,7 +6602,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3652 + //line php7/php7.y:3687 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6586,7 +6614,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3662 + //line php7/php7.y:3697 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6598,7 +6626,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3672 + //line php7/php7.y:3707 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6610,7 +6638,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3685 + //line php7/php7.y:3720 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6622,7 +6650,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3695 + //line php7/php7.y:3730 { yyVAL.node = yyDollar[2].node @@ -6632,13 +6660,13 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3703 + //line php7/php7.y:3738 { yyVAL.node = yyDollar[1].node } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3708 + //line php7/php7.y:3743 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6650,7 +6678,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3718 + //line php7/php7.y:3753 { yyVAL.node = yyDollar[2].node @@ -6660,13 +6688,13 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3726 + //line php7/php7.y:3761 { yyVAL.node = yyDollar[1].node } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3731 + //line php7/php7.y:3766 { if yyDollar[1].list[len(yyDollar[1].list)-1] == nil { yyVAL.list = yyDollar[1].list[:len(yyDollar[1].list)-1] @@ -6676,19 +6704,19 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3742 + //line php7/php7.y:3777 { yyVAL.node = nil } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3744 + //line php7/php7.y:3779 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3749 + //line php7/php7.y:3784 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6697,13 +6725,13 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3756 + //line php7/php7.y:3791 { yyVAL.list = []node.Node{yyDollar[1].node} } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3761 + //line php7/php7.y:3796 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) @@ -6715,7 +6743,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3771 + //line php7/php7.y:3806 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) @@ -6724,7 +6752,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3778 + //line php7/php7.y:3813 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) @@ -6737,7 +6765,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3789 + //line php7/php7.y:3824 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[2].node, true) @@ -6749,7 +6777,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3799 + //line php7/php7.y:3834 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -6767,7 +6795,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3815 + //line php7/php7.y:3850 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -6784,13 +6812,13 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3833 + //line php7/php7.y:3868 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3835 + //line php7/php7.y:3870 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -6803,13 +6831,13 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3846 + //line php7/php7.y:3881 { yyVAL.list = []node.Node{yyDollar[1].node} } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3848 + //line php7/php7.y:3883 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -6822,7 +6850,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3862 + //line php7/php7.y:3897 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6836,7 +6864,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3874 + //line php7/php7.y:3909 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6854,7 +6882,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3890 + //line php7/php7.y:3925 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6874,7 +6902,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3908 + //line php7/php7.y:3943 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6887,7 +6915,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3919 + //line php7/php7.y:3954 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -6903,7 +6931,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3933 + //line php7/php7.y:3968 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -6923,13 +6951,13 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3951 + //line php7/php7.y:3986 { yyVAL.node = yyDollar[2].node } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3957 + //line php7/php7.y:3992 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6941,7 +6969,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3967 + //line php7/php7.y:4002 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -6958,7 +6986,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3982 + //line php7/php7.y:4017 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -6989,7 +7017,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4011 + //line php7/php7.y:4046 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(identifier) @@ -7003,7 +7031,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:4026 + //line php7/php7.y:4061 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -7020,7 +7048,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4041 + //line php7/php7.y:4076 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -7034,7 +7062,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4053 + //line php7/php7.y:4088 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -7046,7 +7074,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4063 + //line php7/php7.y:4098 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -7058,7 +7086,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4073 + //line php7/php7.y:4108 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -7072,7 +7100,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4085 + //line php7/php7.y:4120 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -7084,7 +7112,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4095 + //line php7/php7.y:4130 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -7096,13 +7124,13 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4108 + //line php7/php7.y:4143 { yyVAL.list = []node.Node{yyDollar[1].node} } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4110 + //line php7/php7.y:4145 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -7111,7 +7139,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4120 + //line php7/php7.y:4155 { yyVAL.node = yyDollar[1].node } diff --git a/php7/php7.y b/php7/php7.y index b310cce..6e3285f 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -264,12 +264,13 @@ import ( %type isset_variable type return_type type_expr %type class_modifier %type argument_list ctor_arguments +%type trait_adaptations %type member_modifier %type use_type %type foreach_variable -%type method_body switch_case_list trait_adaptations +%type method_body switch_case_list %type encaps_list backticks_expr namespace_name catch_name_list catch_list class_const_list %type const_list echo_expr_list for_exprs non_empty_for_exprs global_var_list @@ -1864,10 +1865,20 @@ class_statement: } | T_USE name_list trait_adaptations { - $$ = stmt.NewTraitUse($2, $3.nodes) + var adaptationList *stmt.TraitAdaptationList + + switch n := $3.(type) { + case *stmt.TraitAdaptationList: + adaptationList = n + default: + adaptationList = nil + yylex.(*Parser).comments.AddFromChildNode($$, $3) + } + + $$ = stmt.NewTraitUse($2, adaptationList) // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3.endToken)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) @@ -1906,11 +1917,35 @@ name_list: trait_adaptations: ';' - { $$ = &nodesWithEndToken{nil, $1} } + { + $$ = stmt.NewNop() + + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) + + } | '{' '}' - { $$ = &nodesWithEndToken{nil, $2} } + { + $$ = stmt.NewTraitAdaptationList(nil) + + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.CloseCurlyBracesToken) + } | '{' trait_adaptation_list '}' - { $$ = &nodesWithEndToken{$2, $3} } + { + $$ = stmt.NewTraitAdaptationList($2) + + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) + } ; trait_adaptation_list: diff --git a/php7/php7_test.go b/php7/php7_test.go index 0d0056a..fd1214e 100644 --- a/php7/php7_test.go +++ b/php7/php7_test.go @@ -1482,6 +1482,7 @@ func TestPhp7(t *testing.T) { }, }, }, + TraitAdaptationList: &stmt.TraitAdaptationList{}, }, }, }, @@ -1502,12 +1503,14 @@ func TestPhp7(t *testing.T) { }, }, }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Method: &node.Identifier{Value: "one"}, + TraitAdaptationList: &stmt.TraitAdaptationList{ + Adaptations: []node.Node{ + &stmt.TraitUseAlias{ + Ref: &stmt.TraitMethodRef{ + Method: &node.Identifier{Value: "one"}, + }, + Alias: &node.Identifier{Value: "include"}, }, - Alias: &node.Identifier{Value: "include"}, }, }, }, @@ -1530,12 +1533,14 @@ func TestPhp7(t *testing.T) { }, }, }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Method: &node.Identifier{Value: "one"}, + TraitAdaptationList: &stmt.TraitAdaptationList{ + Adaptations: []node.Node{ + &stmt.TraitUseAlias{ + Ref: &stmt.TraitMethodRef{ + Method: &node.Identifier{Value: "one"}, + }, + Modifier: &node.Identifier{Value: "public"}, }, - Modifier: &node.Identifier{Value: "public"}, }, }, }, @@ -1558,13 +1563,15 @@ func TestPhp7(t *testing.T) { }, }, }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Method: &node.Identifier{Value: "one"}, + TraitAdaptationList: &stmt.TraitAdaptationList{ + Adaptations: []node.Node{ + &stmt.TraitUseAlias{ + Ref: &stmt.TraitMethodRef{ + Method: &node.Identifier{Value: "one"}, + }, + Modifier: &node.Identifier{Value: "public"}, + Alias: &node.Identifier{Value: "two"}, }, - Modifier: &node.Identifier{Value: "public"}, - Alias: &node.Identifier{Value: "two"}, }, }, }, @@ -1587,39 +1594,41 @@ func TestPhp7(t *testing.T) { }, }, }, - Adaptations: []node.Node{ - &stmt.TraitUsePrecedence{ - Ref: &stmt.TraitMethodRef{ - Trait: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + TraitAdaptationList: &stmt.TraitAdaptationList{ + Adaptations: []node.Node{ + &stmt.TraitUsePrecedence{ + Ref: &stmt.TraitMethodRef{ + Trait: &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Bar"}, + }, }, + Method: &node.Identifier{Value: "one"}, }, - Method: &node.Identifier{Value: "one"}, - }, - Insteadof: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + Insteadof: []node.Node{ + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Baz"}, + }, }, - }, - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Quux"}, + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Quux"}, + }, }, }, }, - }, - &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Trait: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &stmt.TraitUseAlias{ + Ref: &stmt.TraitMethodRef{ + Trait: &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Baz"}, + }, }, + Method: &node.Identifier{Value: "one"}, }, - Method: &node.Identifier{Value: "one"}, + Alias: &node.Identifier{Value: "two"}, }, - Alias: &node.Identifier{Value: "two"}, }, }, }, diff --git a/printer/printer.go b/printer/printer.go index b4ed6a8..3970430 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -2066,9 +2066,10 @@ func (p *Printer) printStmtTraitUse(n node.Node) { io.WriteString(p.w, "use ") p.joinPrint(", ", nn.Traits) - if nn.Adaptations != nil { + if nn.TraitAdaptationList != nil { + adaptations := nn.TraitAdaptationList.Adaptations io.WriteString(p.w, " {\n") - p.printNodes(nn.Adaptations) + p.printNodes(adaptations) io.WriteString(p.w, "\n") p.printIndent() io.WriteString(p.w, "}") diff --git a/printer/printer_test.go b/printer/printer_test.go index 4e32212..4a46f79 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -3789,13 +3789,15 @@ func TestPrintStmtTraitAdaptations(t *testing.T) { &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Trait: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Method: &node.Identifier{Value: "a"}, + TraitAdaptationList: &stmt.TraitAdaptationList{ + Adaptations: []node.Node{ + &stmt.TraitUseAlias{ + Ref: &stmt.TraitMethodRef{ + Trait: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, + Method: &node.Identifier{Value: "a"}, + }, + Alias: &node.Identifier{Value: "b"}, }, - Alias: &node.Identifier{Value: "b"}, }, }, }, diff --git a/visitor/namespace_resolver.go b/visitor/namespace_resolver.go index 18c3df5..056aff1 100644 --- a/visitor/namespace_resolver.go +++ b/visitor/namespace_resolver.go @@ -152,7 +152,7 @@ func (nsr *NamespaceResolver) EnterNode(w walker.Walkable) bool { nsr.ResolveName(t, "") } - for _, a := range n.Adaptations { + for _, a := range n.TraitAdaptationList.Adaptations { switch aa := a.(type) { case *stmt.TraitUsePrecedence: refTrait := aa.Ref.(*stmt.TraitMethodRef).Trait diff --git a/visitor/namespace_resolver_test.go b/visitor/namespace_resolver_test.go index b84a0c4..e9cbe65 100644 --- a/visitor/namespace_resolver_test.go +++ b/visitor/namespace_resolver_test.go @@ -43,8 +43,8 @@ func TestResolveStaticCall(t *testing.T) { }, }, &expr.StaticCall{ - Class: nameBC, - Call: &node.Identifier{Value: "foo"}, + Class: nameBC, + Call: &node.Identifier{Value: "foo"}, ArgumentList: &node.ArgumentList{}, }, }, @@ -134,7 +134,7 @@ func TestResolveNew(t *testing.T) { }, }, &expr.New{ - Class: nameBC, + Class: nameBC, ArgumentList: &node.ArgumentList{}, }, }, @@ -242,7 +242,7 @@ func TestResolveFunctionCall(t *testing.T) { }, }, &expr.FunctionCall{ - Function: nameB, + Function: nameB, ArgumentList: &node.ArgumentList{}, }, }, @@ -323,11 +323,11 @@ func TestResolveGroupUse(t *testing.T) { Constant: nameC, }, &expr.FunctionCall{ - Function: nameF, + Function: nameF, ArgumentList: &node.ArgumentList{}, }, &expr.FunctionCall{ - Function: nameE, + Function: nameE, ArgumentList: &node.ArgumentList{}, }, }, @@ -368,20 +368,22 @@ func TestResolveTraitUse(t *testing.T) { nameB, relativeNameB, }, - Adaptations: []node.Node{ - &stmt.TraitUsePrecedence{ - Ref: &stmt.TraitMethodRef{ - Trait: fullyQualifiedNameB, - Method: &node.Identifier{Value: "foo"}, + TraitAdaptationList: &stmt.TraitAdaptationList{ + Adaptations: []node.Node{ + &stmt.TraitUsePrecedence{ + Ref: &stmt.TraitMethodRef{ + Trait: fullyQualifiedNameB, + Method: &node.Identifier{Value: "foo"}, + }, + Insteadof: []node.Node{fullyQualifiedNameBC}, }, - Insteadof: []node.Node{fullyQualifiedNameBC}, - }, - &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Trait: relativeNameBC, - Method: &node.Identifier{Value: "foo"}, + &stmt.TraitUseAlias{ + Ref: &stmt.TraitMethodRef{ + Trait: relativeNameBC, + Method: &node.Identifier{Value: "foo"}, + }, + Alias: &node.Identifier{Value: "bar"}, }, - Alias: &node.Identifier{Value: "bar"}, }, }, }, @@ -658,8 +660,8 @@ func TestResolveNamespaces(t *testing.T) { }, }, &expr.StaticCall{ - Class: nameFG, - Call: &node.Identifier{Value: "foo"}, + Class: nameFG, + Call: &node.Identifier{Value: "foo"}, ArgumentList: &node.ArgumentList{}, }, &stmt.Namespace{ @@ -676,13 +678,13 @@ func TestResolveNamespaces(t *testing.T) { }, }, &expr.StaticCall{ - Class: relativeNameCE, - Call: &node.Identifier{Value: "foo"}, + Class: relativeNameCE, + Call: &node.Identifier{Value: "foo"}, ArgumentList: &node.ArgumentList{}, }, &expr.StaticCall{ - Class: nameCF, - Call: &node.Identifier{Value: "foo"}, + Class: nameCF, + Call: &node.Identifier{Value: "foo"}, ArgumentList: &node.ArgumentList{}, }, }, @@ -708,8 +710,8 @@ func TestResolveStaticCallDinamicClassName(t *testing.T) { ast := &stmt.StmtList{ Stmts: []node.Node{ &expr.StaticCall{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Call: &node.Identifier{Value: "foo"}, + Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Call: &node.Identifier{Value: "foo"}, ArgumentList: &node.ArgumentList{}, }, }, From d1b0cebf9a87e54c93f6686d54c9c04a7d296f2b Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 29 Apr 2018 23:10:56 +0300 Subject: [PATCH 15/25] create CaseList node --- node/stmt/n_alt_switch.go | 18 +- node/stmt/n_case_list.go | 42 + node/stmt/n_switch.go | 18 +- node/stmt/t_switch_case_default_test.go | 86 +- node/stmt/t_visitor_test.go | 19 +- php5/php5.go | 1301 ++++++++++++----------- php5/php5.y | 52 +- php5/php5_test.go | 94 +- php7/php7.go | 1076 ++++++++++--------- php7/php7.y | 79 +- php7/php7_test.go | 94 +- printer/printer.go | 4 +- printer/printer_test.go | 44 +- 13 files changed, 1578 insertions(+), 1349 deletions(-) create mode 100644 node/stmt/n_case_list.go diff --git a/node/stmt/n_alt_switch.go b/node/stmt/n_alt_switch.go index 4c7587f..ef28404 100644 --- a/node/stmt/n_alt_switch.go +++ b/node/stmt/n_alt_switch.go @@ -7,15 +7,15 @@ import ( // AltSwitch node type AltSwitch struct { - Cond node.Node - Cases []node.Node + Cond node.Node + CaseList *CaseList } // NewAltSwitch node constructor -func NewAltSwitch(Cond node.Node, Cases []node.Node) *AltSwitch { +func NewAltSwitch(Cond node.Node, CaseList *CaseList) *AltSwitch { return &AltSwitch{ Cond, - Cases, + CaseList, } } @@ -36,13 +36,9 @@ func (n *AltSwitch) Walk(v walker.Visitor) { n.Cond.Walk(vv) } - if n.Cases != nil { - vv := v.GetChildrenVisitor("Cases") - for _, nn := range n.Cases { - if nn != nil { - nn.Walk(vv) - } - } + if n.CaseList != nil { + vv := v.GetChildrenVisitor("CaseList") + n.CaseList.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/n_case_list.go b/node/stmt/n_case_list.go new file mode 100644 index 0000000..ac43d6a --- /dev/null +++ b/node/stmt/n_case_list.go @@ -0,0 +1,42 @@ +package stmt + +import ( + "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/walker" +) + +// CaseList node +type CaseList struct { + Cases []node.Node +} + +// NewCaseList node constructor +func NewCaseList(Cases []node.Node) *CaseList { + return &CaseList{ + Cases, + } +} + +// Attributes returns node attributes as map +func (n *CaseList) Attributes() map[string]interface{} { + return nil +} + +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true +func (n *CaseList) Walk(v walker.Visitor) { + if v.EnterNode(n) == false { + return + } + + if n.Cases != nil { + vv := v.GetChildrenVisitor("Cases") + for _, nn := range n.Cases { + if nn != nil { + nn.Walk(vv) + } + } + } + + v.LeaveNode(n) +} diff --git a/node/stmt/n_switch.go b/node/stmt/n_switch.go index 2882257..f99963e 100644 --- a/node/stmt/n_switch.go +++ b/node/stmt/n_switch.go @@ -7,15 +7,15 @@ import ( // Switch node type Switch struct { - Cond node.Node - Cases []node.Node + Cond node.Node + CaseList *CaseList } // NewSwitch node constructor -func NewSwitch(Cond node.Node, Cases []node.Node) *Switch { +func NewSwitch(Cond node.Node, CaseList *CaseList) *Switch { return &Switch{ Cond, - Cases, + CaseList, } } @@ -36,13 +36,9 @@ func (n *Switch) Walk(v walker.Visitor) { n.Cond.Walk(vv) } - if n.Cases != nil { - vv := v.GetChildrenVisitor("Cases") - for _, nn := range n.Cases { - if nn != nil { - nn.Walk(vv) - } - } + if n.CaseList != nil { + vv := v.GetChildrenVisitor("CaseList") + n.CaseList.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/t_switch_case_default_test.go b/node/stmt/t_switch_case_default_test.go index d227694..733ce5d 100644 --- a/node/stmt/t_switch_case_default_test.go +++ b/node/stmt/t_switch_case_default_test.go @@ -25,17 +25,19 @@ func TestAltSwitch(t *testing.T) { Stmts: []node.Node{ &stmt.AltSwitch{ Cond: &scalar.Lnumber{Value: "1"}, - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmts: []node.Node{}, - }, - &stmt.Default{ - Stmts: []node.Node{}, - }, - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, - Stmts: []node.Node{}, + CaseList: &stmt.CaseList{ + Cases: []node.Node{ + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "1"}, + Stmts: []node.Node{}, + }, + &stmt.Default{ + Stmts: []node.Node{}, + }, + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "2"}, + Stmts: []node.Node{}, + }, }, }, }, @@ -65,14 +67,16 @@ func TestAltSwitchSemicolon(t *testing.T) { Stmts: []node.Node{ &stmt.AltSwitch{ Cond: &scalar.Lnumber{Value: "1"}, - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmts: []node.Node{}, - }, - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, - Stmts: []node.Node{}, + CaseList: &stmt.CaseList{ + Cases: []node.Node{ + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "1"}, + Stmts: []node.Node{}, + }, + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "2"}, + Stmts: []node.Node{}, + }, }, }, }, @@ -102,17 +106,19 @@ func TestSwitch(t *testing.T) { Stmts: []node.Node{ &stmt.Switch{ Cond: &scalar.Lnumber{Value: "1"}, - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmts: []node.Node{ - &stmt.Break{}, + CaseList: &stmt.CaseList{ + Cases: []node.Node{ + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "1"}, + Stmts: []node.Node{ + &stmt.Break{}, + }, }, - }, - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, - Stmts: []node.Node{ - &stmt.Break{}, + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "2"}, + Stmts: []node.Node{ + &stmt.Break{}, + }, }, }, }, @@ -143,17 +149,19 @@ func TestSwitchSemicolon(t *testing.T) { Stmts: []node.Node{ &stmt.Switch{ Cond: &scalar.Lnumber{Value: "1"}, - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmts: []node.Node{ - &stmt.Break{}, + CaseList: &stmt.CaseList{ + Cases: []node.Node{ + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "1"}, + Stmts: []node.Node{ + &stmt.Break{}, + }, }, - }, - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, - Stmts: []node.Node{ - &stmt.Break{}, + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "2"}, + Stmts: []node.Node{ + &stmt.Break{}, + }, }, }, }, diff --git a/node/stmt/t_visitor_test.go b/node/stmt/t_visitor_test.go index d0cc7e1..b7f1a26 100644 --- a/node/stmt/t_visitor_test.go +++ b/node/stmt/t_visitor_test.go @@ -360,18 +360,18 @@ var nodesToTest = []struct { }, { &stmt.Switch{ - Cond: &expr.Variable{}, - Cases: []node.Node{&stmt.Expression{}}, + Cond: &expr.Variable{}, + CaseList: &stmt.CaseList{}, }, - []string{"Cond", "Cases"}, + []string{"Cond", "CaseList"}, map[string]interface{}{}, }, { &stmt.AltSwitch{ - Cond: &expr.Variable{}, - Cases: []node.Node{&stmt.Expression{}}, + Cond: &expr.Variable{}, + CaseList: &stmt.CaseList{Cases: []node.Node{}}, }, - []string{"Cond", "Cases"}, + []string{"Cond", "CaseList"}, map[string]interface{}{}, }, { @@ -479,6 +479,13 @@ var nodesToTest = []struct { []string{"Stmts"}, map[string]interface{}{}, }, + { + &stmt.CaseList{ + Cases: []node.Node{&stmt.Expression{}}, + }, + []string{"Cases"}, + map[string]interface{}{}, + }, { &stmt.TraitAdaptationList{ Adaptations: []node.Node{&stmt.TraitUsePrecedence{}}, diff --git a/php5/php5.go b/php5/php5.go index 169557a..dc43a42 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -344,7 +344,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:3890 +//line php5/php5.y:3922 type foreachVariable struct { node node.Node @@ -713,17 +713,17 @@ var yyAct = [...]int{ 446, 324, 521, 936, 203, 285, 260, 261, 469, 260, 261, 232, 202, 199, 136, 879, 909, 531, 260, 261, 944, 519, 521, 335, 231, 521, 873, 829, 521, 1008, - 572, 962, 572, 970, 39, 343, 39, 812, 703, 704, - 706, 703, 704, 747, 39, 753, 39, 39, 863, 445, - 521, 608, 589, 260, 261, 572, 970, 260, 261, 956, - 982, 590, 958, 39, 591, 961, 684, 39, 39, 521, - 255, 572, 839, 994, 993, 964, 572, 995, 963, 997, - 902, 483, 403, 895, 914, 838, 916, 979, 835, 448, - 575, 566, 39, 572, 1011, 531, 924, 1005, 926, 927, - 1012, 531, 531, 1004, 572, 1015, 992, 724, 394, 919, - 39, 232, 919, 232, 389, 558, 164, 341, 697, 538, - 928, 943, 290, 460, 231, 947, 231, 161, 948, 531, - 157, 318, 314, 127, 39, 938, 528, 607, 996, 969, + 572, 962, 572, 970, 39, 747, 39, 812, 703, 704, + 706, 703, 704, 753, 39, 863, 39, 39, 445, 608, + 521, 589, 590, 260, 261, 572, 970, 260, 261, 956, + 982, 591, 958, 39, 684, 961, 255, 39, 39, 521, + 839, 572, 994, 964, 993, 963, 572, 995, 902, 997, + 483, 403, 895, 838, 914, 835, 916, 979, 575, 448, + 566, 1005, 39, 572, 1011, 531, 924, 1004, 926, 927, + 1012, 531, 531, 724, 572, 1015, 992, 394, 389, 919, + 39, 232, 919, 232, 164, 558, 341, 697, 538, 928, + 290, 943, 460, 161, 231, 947, 231, 157, 948, 531, + 318, 314, 127, 343, 39, 938, 528, 607, 996, 969, 39, 968, 945, 967, 966, 837, 836, 834, 401, 40, 568, 15, 14, 822, 972, 719, 801, 694, 11, 249, 75, 232, 76, 116, 266, 64, 89, 598, 90, 520, @@ -1638,41 +1638,41 @@ var yyPgo = [...]int{ 73, 68, 61, 1068, 1067, 1066, 35, 1065, 1063, 4, 1062, 1061, 1060, 17, 1059, 1058, 1057, 1056, 1055, 51, 5, 1054, 1053, 1051, 1049, 1048, 2, 1047, 631, 1046, - 18, 22, 1045, 39, 0, 1043, 1042, 1041, 117, 1040, - 1037, 553, 1033, 1032, 42, 8, 1030, 9, 1029, 1028, - 1027, 14, 49, 1026, 1024, 1018, 1017, 1013, 1007, 3, - 1001, 16, 1000, 998, 995, 993, 992, 28, 991, 990, - 988, 985, 983, 982, 980, 21, 976, 974, 971, 25, - 962, 23, 12, 961, 40, 959, 958, 955, 953, 41, - 6, 19, 945, 939, 13, 937, 933, 930, 15, 853, + 18, 22, 1045, 1043, 39, 0, 1042, 1041, 1040, 117, + 1037, 1033, 553, 1032, 1030, 42, 8, 1029, 9, 1028, + 1027, 1026, 14, 49, 1024, 1018, 1017, 1013, 1007, 1001, + 3, 1000, 16, 998, 995, 993, 992, 991, 28, 990, + 988, 985, 983, 982, 980, 976, 21, 974, 971, 962, + 25, 961, 23, 12, 959, 40, 958, 955, 953, 945, + 41, 6, 19, 939, 13, 937, 933, 930, 15, 853, 7, 20, } var yyR1 = [...]int{ - 0, 149, 83, 83, 84, 84, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 85, 85, - 4, 4, 4, 4, 86, 86, 5, 5, 5, 5, - 87, 87, 6, 6, 6, 6, 53, 53, 88, 88, + 0, 149, 84, 84, 85, 85, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 86, 86, + 4, 4, 4, 4, 87, 87, 5, 5, 5, 5, + 88, 88, 6, 6, 6, 6, 53, 53, 89, 89, 24, 24, 24, 24, 24, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 106, 106, 58, 58, 107, - 107, 108, 108, 59, 104, 104, 56, 51, 52, 144, + 26, 26, 26, 26, 26, 107, 107, 58, 58, 108, + 108, 109, 109, 59, 105, 105, 56, 51, 52, 144, 144, 145, 145, 60, 61, 61, 64, 64, 64, 64, - 65, 65, 2, 116, 116, 112, 112, 117, 117, 141, - 141, 140, 140, 140, 147, 147, 148, 148, 57, 57, - 105, 105, 142, 142, 142, 142, 102, 102, 102, 150, - 150, 146, 146, 98, 98, 99, 99, 54, 54, 55, - 55, 109, 109, 110, 110, 63, 63, 62, 62, 62, - 62, 81, 81, 81, 118, 118, 69, 69, 69, 69, - 89, 89, 27, 27, 27, 90, 90, 90, 90, 111, - 111, 66, 66, 66, 66, 68, 119, 119, 82, 82, - 120, 120, 121, 121, 70, 70, 71, 122, 122, 74, - 74, 73, 72, 72, 75, 75, 143, 143, 113, 113, - 114, 114, 123, 123, 76, 76, 76, 76, 76, 76, - 115, 115, 115, 115, 67, 67, 103, 103, 101, 101, - 100, 100, 129, 129, 127, 127, 128, 128, 128, 130, - 130, 42, 15, 15, 15, 15, 15, 15, 15, 15, + 65, 65, 2, 117, 117, 113, 113, 118, 118, 142, + 142, 141, 141, 141, 147, 147, 148, 148, 57, 57, + 106, 106, 83, 83, 83, 83, 103, 103, 103, 150, + 150, 146, 146, 99, 99, 100, 100, 54, 54, 55, + 55, 110, 110, 111, 111, 63, 63, 62, 62, 62, + 62, 81, 81, 81, 119, 119, 69, 69, 69, 69, + 90, 90, 27, 27, 27, 91, 91, 91, 91, 112, + 112, 66, 66, 66, 66, 68, 120, 120, 82, 82, + 121, 121, 122, 122, 70, 70, 71, 123, 123, 74, + 74, 73, 72, 72, 75, 75, 143, 143, 114, 114, + 115, 115, 124, 124, 76, 76, 76, 76, 76, 76, + 116, 116, 116, 116, 67, 67, 104, 104, 102, 102, + 101, 101, 130, 130, 128, 128, 129, 129, 129, 131, + 131, 42, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, @@ -1680,27 +1680,27 @@ var yyR1 = [...]int{ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 50, 50, 50, 50, - 47, 47, 47, 47, 46, 46, 1, 97, 97, 96, - 96, 96, 96, 23, 23, 23, 23, 23, 23, 23, + 47, 47, 47, 47, 46, 46, 1, 98, 98, 97, + 97, 97, 97, 23, 23, 23, 23, 23, 23, 23, 23, 11, 11, 11, 11, 45, 45, 45, 43, 43, - 41, 41, 137, 137, 136, 49, 49, 49, 124, 124, - 124, 80, 80, 7, 7, 7, 7, 7, 7, 7, + 41, 41, 138, 138, 137, 49, 49, 49, 125, 125, + 125, 80, 80, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 28, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 35, 35, 35, 35, 29, 29, 29, 29, 29, 29, - 29, 125, 125, 151, 151, 126, 126, 126, 126, 14, - 14, 48, 48, 16, 17, 18, 19, 19, 138, 138, - 131, 133, 133, 77, 132, 132, 132, 40, 40, 44, + 29, 126, 126, 151, 151, 127, 127, 127, 127, 14, + 14, 48, 48, 16, 17, 18, 19, 19, 139, 139, + 132, 134, 134, 77, 133, 133, 133, 40, 40, 44, 44, 12, 22, 22, 20, 20, 20, 21, 21, 21, - 10, 10, 10, 9, 9, 13, 13, 134, 134, 135, - 135, 135, 39, 39, 139, 139, 95, 95, 38, 38, - 38, 94, 94, 93, 93, 93, 93, 93, 93, 93, - 93, 91, 91, 91, 91, 33, 33, 33, 33, 33, + 10, 10, 10, 9, 9, 13, 13, 135, 135, 136, + 136, 136, 39, 39, 140, 140, 96, 96, 38, 38, + 38, 95, 95, 94, 94, 94, 94, 94, 94, 94, + 94, 92, 92, 92, 92, 33, 33, 33, 33, 33, 33, 34, 34, 34, 37, 37, 37, 37, 37, 37, - 37, 37, 92, 92, 36, 36, 30, 30, 31, 32, + 37, 37, 93, 93, 36, 36, 30, 30, 31, 32, } var yyR2 = [...]int{ @@ -1759,7 +1759,7 @@ var yyR2 = [...]int{ } var yyChk = [...]int{ - -1000, -149, -83, -3, 2, -25, -51, -52, 51, 79, + -1000, -149, -84, -3, 2, -25, -51, -52, 51, 79, 44, -53, -26, 10, -60, -61, 38, 142, 7, 21, 20, 23, 30, 34, 35, 39, -50, 46, 98, 19, 14, -14, 48, 25, 27, 144, 40, 43, 36, -1, @@ -1769,99 +1769,99 @@ var yyChk = [...]int{ 112, 113, 6, 156, -29, -47, -46, 141, 96, -20, 91, 49, 50, 4, 5, 84, 85, 86, 11, -35, -32, -7, 140, 74, 62, 18, 60, 148, -21, -22, - -23, -30, -84, 82, -11, 8, 9, 66, 67, 81, - 63, 64, 65, 80, -10, -139, -44, -12, -40, -9, - 157, 12, 146, -84, 142, 82, 10, -85, 37, 38, - -4, -84, 82, 144, 158, 145, 10, -88, -48, 146, + -23, -30, -85, 82, -11, 8, 9, 66, 67, 81, + 63, 64, 65, 80, -10, -140, -44, -12, -40, -9, + 157, 12, 146, -85, 142, 82, 10, -86, 37, 38, + -4, -85, 82, 144, 158, 145, 10, -89, -48, 146, -48, -25, -1, 79, 146, -48, 144, -14, 97, 98, - 144, -14, 144, -15, -19, -14, 144, -89, -27, 12, - 157, -90, -1, 12, -103, -14, 144, 129, 130, 87, + 144, -14, 144, -15, -19, -14, 144, -90, -27, 12, + 157, -91, -1, 12, -104, -14, 144, 129, 130, 87, 89, 88, 159, 151, 161, 167, 153, 152, 162, 131, 163, 164, 132, 133, 134, 135, 136, 137, 165, 138, 166, 139, 90, 150, 146, 146, 146, 142, -14, 10, -144, 151, 10, 10, -15, -19, -14, 52, 52, 160, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 146, -14, 104, 105, -18, -19, -84, 79, + 127, 128, 146, -14, 104, 105, -18, -19, -85, 79, 82, -11, -12, 98, -18, -14, -14, -14, -14, -42, -14, -50, -14, -14, -14, -14, -14, -14, -14, -49, - 146, -48, -14, 148, 148, -124, 17, -91, -33, 12, - 76, 77, -14, 57, -43, -11, -41, -84, 79, 82, - -21, -10, -139, -12, 146, 146, -14, -14, 146, -14, - -14, 148, -91, 17, 17, 75, -91, 148, 146, -94, - -93, -14, 151, 148, 148, 82, -81, 146, -84, 78, + 146, -48, -14, 148, 148, -125, 17, -92, -33, 12, + 76, 77, -14, 57, -43, -11, -41, -85, 79, 82, + -21, -10, -140, -12, 146, 146, -14, -14, 146, -14, + -14, 148, -92, 17, 17, 75, -92, 148, 146, -95, + -94, -14, 151, 148, 148, 82, -81, 146, -85, 78, 148, 142, -10, 157, 78, -81, 142, 147, 144, 142, - -83, -84, 144, 158, -86, -5, -84, 82, -87, -6, - -84, 82, 29, -84, 10, 160, -24, 143, 2, -25, + -84, -85, 144, 158, -87, -5, -85, 82, -88, -6, + -85, 82, 29, -85, 10, 160, -24, 143, 2, -25, -51, -52, 51, -25, 145, -146, -25, 145, 21, -144, - -101, -100, -14, -142, 142, 145, 144, 144, 144, 144, + -102, -101, -14, -83, 142, 145, 144, 144, 144, 144, 144, 158, -16, 142, -19, 144, 158, -144, 160, 144, 158, -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, -43, -14, 145, -104, - -56, -19, -19, -15, -105, 10, -88, 144, 144, 10, - 146, -65, 55, -116, 55, 58, -14, 151, -14, -14, + -14, -14, -14, -14, -14, -14, -43, -14, 145, -105, + -56, -19, -19, -15, -106, 10, -89, 144, 144, 10, + 146, -65, 55, -117, 55, 58, -14, 151, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -95, -38, -19, 59, 82, -84, 78, 78, 147, 147, + -96, -38, -19, 59, 82, -85, 78, 78, 147, 147, 147, 147, -13, -14, -13, 141, -33, -33, 17, 148, - 57, -14, 11, -19, -134, -135, -40, -39, -10, -139, - 10, 142, -80, -81, 78, 82, -84, 57, -10, 78, - -92, -36, -19, -15, -19, -15, -14, -13, 140, 75, - 75, -13, -94, 149, -151, 158, 58, -17, -19, -13, - -13, 10, 147, -118, -50, -69, -15, -19, 151, 83, + 57, -14, 11, -19, -135, -136, -40, -39, -10, -140, + 10, 142, -80, -81, 78, 82, -85, 57, -10, 78, + -93, -36, -19, -15, -19, -15, -14, -13, 140, 75, + 75, -13, -95, 149, -151, 158, 58, -17, -19, -13, + -13, 10, 147, -119, -50, -69, -15, -19, 151, 83, -81, -39, -40, 10, 52, -13, -14, -39, -40, 10, - -14, 144, -83, 143, -81, -4, 144, 158, 29, -84, - 144, 158, 29, -84, 10, 29, 160, -28, -78, -7, - -31, -84, 79, 82, 60, 148, -8, 62, -79, 18, - 74, -11, 154, 155, 153, 152, 146, 146, -98, -88, - -88, -48, 144, 158, -102, 144, -102, 144, -27, -14, + -14, 144, -84, 143, -81, -4, 144, 158, 29, -85, + 144, 158, 29, -85, 10, 29, 160, -28, -78, -7, + -31, -85, 79, 82, 60, 148, -8, 62, -79, 18, + 74, -11, 154, 155, 153, 152, 146, 146, -99, -89, + -89, -48, 144, 158, -103, 144, -103, 144, -27, -14, 12, 146, -28, -14, 145, -14, 147, 158, 29, 29, - 147, 158, 160, 143, 146, -109, -110, -63, -62, 60, - 61, -45, -84, 79, 82, -112, 56, -45, 142, -117, - -45, -15, -19, -19, 91, 147, 158, 146, -84, -130, - -128, -127, -129, 148, -131, 57, 149, 149, -34, 10, - 13, 12, 10, 143, 148, 143, -132, -77, -133, -81, - 148, 142, -10, -14, -40, -84, -134, -40, 147, 158, + 147, 158, 160, 143, 146, -110, -111, -63, -62, 60, + 61, -45, -85, 79, 82, -113, 56, -45, 142, -118, + -45, -15, -19, -19, 91, 147, 158, 146, -85, -131, + -129, -128, -130, 148, -132, 57, 149, 149, -34, 10, + 13, 12, 10, 143, 148, 143, -133, -77, -134, -81, + 148, 142, -10, -14, -40, -85, -135, -40, 147, 158, 147, 147, 147, 149, 149, 147, -14, 151, -14, 151, 149, 149, 147, 158, 147, -17, -14, -81, -81, 149, 143, -81, -81, 143, 143, -5, 10, 29, -6, 10, 29, 10, -28, 148, 153, 152, 162, 131, 163, 164, 159, 151, 161, 132, 133, 167, 88, 89, 87, 130, 129, 134, 135, 136, 137, 165, 166, 138, 139, 150, - 82, -84, 146, -125, -126, -78, 17, 78, -78, -78, - -78, -78, -78, 147, -54, 93, 94, -99, 22, 144, - -101, -14, 143, 32, 33, -102, 31, -102, 143, 160, - -109, -14, 144, -56, -140, -19, 151, 59, -140, -57, - -25, 145, 10, -28, -106, 41, -109, 147, 158, -144, - 82, -84, 142, -117, -111, 158, -43, 160, -38, -95, - 148, -129, -131, -13, -134, 149, -14, -138, 148, 148, - -13, -14, 143, -137, -36, 58, -17, -17, -69, 10, + 82, -85, 146, -126, -127, -78, 17, 78, -78, -78, + -78, -78, -78, 147, -54, 93, 94, -100, 22, 144, + -102, -14, 143, 32, 33, -103, 31, -103, 143, 160, + -110, -14, 144, -56, -141, -19, 151, 59, -141, -57, + -25, 145, 10, -28, -107, 41, -110, 147, 158, -144, + 82, -85, 142, -118, -112, 158, -43, 160, -38, -96, + 148, -130, -132, -13, -135, 149, -14, -139, 148, 148, + -13, -14, 143, -138, -36, 58, -17, -17, -69, 10, 10, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, 145, -78, -84, - -125, 149, -151, 158, 58, 10, 52, 147, 144, -48, + -78, -78, -78, -78, -78, -78, -78, 145, -78, -85, + -126, 149, -151, 158, 58, 10, 52, 147, 144, -48, -25, -55, 93, 94, 144, 144, -14, -150, 145, 144, - 143, 144, 31, -28, 147, -141, 58, -19, 146, -141, - -88, 160, -58, 42, 146, 147, -97, 44, -63, -145, - 83, -84, -111, 143, -66, -113, -67, -68, -114, -123, + 143, 144, 31, -28, 147, -142, 58, -19, 146, -142, + -89, 160, -58, 42, 146, 147, -98, 44, -63, -145, + 83, -85, -112, 143, -66, -114, -67, -68, -115, -124, 47, 38, 44, -76, 103, 102, 101, 98, 99, 100, - -45, -80, -14, 147, -13, 149, -132, 149, -131, -13, - -13, 149, 143, -136, 57, -14, 151, 149, -78, 145, - 147, -78, -78, -25, 95, -48, 145, -101, -150, -88, - 144, -97, 147, -140, -95, 147, 28, -28, 142, -45, - 142, 142, 146, 12, 143, -115, 12, 144, 158, -1, - -76, 10, -119, -45, 149, 143, 149, 149, -134, -17, - -78, 58, 144, 145, -88, 147, -88, 142, -148, -25, - 145, 147, -148, 144, -88, 12, -88, -88, -96, 12, + -45, -80, -14, 147, -13, 149, -133, 149, -132, -13, + -13, 149, 143, -137, 57, -14, 151, 149, -78, 145, + 147, -78, -78, -25, 95, -48, 145, -102, -150, -89, + 144, -98, 147, -141, -96, 147, 28, -28, 142, -45, + 142, 142, 146, 12, 143, -116, 12, 144, 158, -1, + -76, 10, -120, -45, 149, 143, 149, 149, -135, -17, + -78, 58, 144, 145, -89, 147, -89, 142, -148, -25, + 145, 147, -148, 144, -89, 12, -89, -89, -97, 12, 151, 160, 144, 158, 160, 10, -144, 160, -82, 158, - 144, 142, -78, -88, -147, -25, 145, -88, -88, 143, + 144, 142, -78, -89, -147, -25, 145, -89, -89, 143, 147, 143, 143, 147, 158, 12, -28, 12, -28, 160, - 10, -28, -45, -120, -121, -70, -71, -72, -73, -74, - -45, 10, -88, 143, 26, 142, 12, 151, 160, -28, + 10, -28, -45, -121, -122, -70, -71, -72, -73, -74, + -45, 10, -89, 143, 26, 142, 12, 151, 160, -28, 146, 143, -70, 144, 144, 45, 29, 78, 24, 144, - -88, 12, -28, -109, -122, -45, -75, -76, 10, 144, - 143, 147, 158, 10, -107, -108, -59, 41, -143, 144, - 142, -45, -59, 146, -88, -45, 143, 12, 147, 142, - -88, 143, + -89, 12, -28, -110, -123, -45, -75, -76, 10, 144, + 143, 147, 158, 10, -108, -109, -59, 41, -143, 144, + 142, -45, -59, 146, -89, -45, 143, 12, 147, 142, + -89, 143, } var yyDef = [...]int{ @@ -2345,14 +2345,14 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:271 + //line php5/php5.y:272 { yylex.(*Parser).rootNode = stmt.NewStmtList(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) } case 2: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:279 + //line php5/php5.y:280 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2360,13 +2360,13 @@ yydefault: } case 3: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:284 + //line php5/php5.y:285 { yyVAL.list = []node.Node{} } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:289 + //line php5/php5.y:290 { namePart := name.NewNamePart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2375,7 +2375,7 @@ yydefault: } case 5: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:296 + //line php5/php5.y:297 { namePart := name.NewNamePart(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2384,32 +2384,32 @@ yydefault: } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:306 + //line php5/php5.y:307 { // error yyVAL.node = nil } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:311 + //line php5/php5.y:312 { yyVAL.node = yyDollar[1].node } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:313 + //line php5/php5.y:314 { yyVAL.node = yyDollar[1].node } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:315 + //line php5/php5.y:316 { yyVAL.node = yyDollar[1].node } case 10: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:317 + //line php5/php5.y:318 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2417,7 +2417,7 @@ yydefault: } case 11: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:323 + //line php5/php5.y:324 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2429,7 +2429,7 @@ yydefault: } case 12: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:333 + //line php5/php5.y:334 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2441,7 +2441,7 @@ yydefault: } case 13: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:343 + //line php5/php5.y:344 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2449,7 +2449,7 @@ yydefault: } case 14: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:349 + //line php5/php5.y:350 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2457,7 +2457,7 @@ yydefault: } case 15: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:355 + //line php5/php5.y:356 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2469,7 +2469,7 @@ yydefault: } case 16: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:365 + //line php5/php5.y:366 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2481,25 +2481,25 @@ yydefault: } case 17: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:375 + //line php5/php5.y:376 { yyVAL.node = yyDollar[1].node } case 18: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:380 + //line php5/php5.y:381 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:382 + //line php5/php5.y:383 { yyVAL.list = []node.Node{yyDollar[1].node} } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:387 + //line php5/php5.y:388 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2511,7 +2511,7 @@ yydefault: } case 21: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:397 + //line php5/php5.y:398 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2526,7 +2526,7 @@ yydefault: } case 22: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:410 + //line php5/php5.y:411 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2538,7 +2538,7 @@ yydefault: } case 23: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:420 + //line php5/php5.y:421 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2553,19 +2553,19 @@ yydefault: } case 24: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:436 + //line php5/php5.y:437 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:438 + //line php5/php5.y:439 { yyVAL.list = []node.Node{yyDollar[1].node} } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:443 + //line php5/php5.y:444 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2577,7 +2577,7 @@ yydefault: } case 27: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:453 + //line php5/php5.y:454 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2592,7 +2592,7 @@ yydefault: } case 28: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:466 + //line php5/php5.y:467 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2604,7 +2604,7 @@ yydefault: } case 29: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:476 + //line php5/php5.y:477 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2619,19 +2619,19 @@ yydefault: } case 30: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:492 + //line php5/php5.y:493 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:494 + //line php5/php5.y:495 { yyVAL.list = []node.Node{yyDollar[1].node} } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:499 + //line php5/php5.y:500 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2643,7 +2643,7 @@ yydefault: } case 33: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:509 + //line php5/php5.y:510 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2658,7 +2658,7 @@ yydefault: } case 34: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:522 + //line php5/php5.y:523 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2670,7 +2670,7 @@ yydefault: } case 35: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:532 + //line php5/php5.y:533 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2685,7 +2685,7 @@ yydefault: } case 36: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:548 + //line php5/php5.y:549 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2703,7 +2703,7 @@ yydefault: } case 37: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:564 + //line php5/php5.y:565 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2721,7 +2721,7 @@ yydefault: } case 38: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:583 + //line php5/php5.y:584 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2729,38 +2729,38 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:589 + //line php5/php5.y:590 { yyVAL.list = []node.Node{} } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:595 + //line php5/php5.y:596 { // error yyVAL.node = nil } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:600 + //line php5/php5.y:601 { yyVAL.node = yyDollar[1].node } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:602 + //line php5/php5.y:603 { yyVAL.node = yyDollar[1].node } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:604 + //line php5/php5.y:605 { yyVAL.node = yyDollar[1].node } case 44: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:606 + //line php5/php5.y:607 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2768,13 +2768,13 @@ yydefault: } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:616 + //line php5/php5.y:617 { yyVAL.node = yyDollar[1].node } case 46: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:618 + //line php5/php5.y:619 { label := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2786,7 +2786,7 @@ yydefault: } case 47: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:631 + //line php5/php5.y:632 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2794,7 +2794,7 @@ yydefault: } case 48: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:637 + //line php5/php5.y:638 { yyVAL.node = stmt.NewIf(yyDollar[2].node, yyDollar[3].node, yyDollar[4].list, yyDollar[5].node) @@ -2810,7 +2810,7 @@ yydefault: } case 49: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:651 + //line php5/php5.y:652 { stmts := stmt.NewStmtList(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) @@ -2821,7 +2821,7 @@ yydefault: } case 50: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:660 + //line php5/php5.y:661 { if yyDollar[3].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltWhile(yyDollar[2].node, yyDollar[3].altSyntaxNode.node) @@ -2833,7 +2833,7 @@ yydefault: } case 51: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:670 + //line php5/php5.y:671 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2841,7 +2841,7 @@ yydefault: } case 52: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:676 + //line php5/php5.y:677 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltFor(yyDollar[3].list, yyDollar[5].list, yyDollar[7].list, yyDollar[9].altSyntaxNode.node) @@ -2853,19 +2853,25 @@ yydefault: } case 53: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:686 + //line php5/php5.y:687 { - if yyDollar[3].nodesWithEndToken.endToken.Value == ";" { - yyVAL.node = stmt.NewAltSwitch(yyDollar[2].node, yyDollar[3].nodesWithEndToken.nodes) - } else { - yyVAL.node = stmt.NewSwitch(yyDollar[2].node, yyDollar[3].nodesWithEndToken.nodes) + switch n := yyDollar[3].node.(type) { + case *stmt.Switch: + n.Cond = yyDollar[2].node + case *stmt.AltSwitch: + n.Cond = yyDollar[2].node + default: + panic("unexpected node type") } - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].nodesWithEndToken.endToken)) + + yyVAL.node = yyDollar[3].node + + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 54: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:696 + //line php5/php5.y:703 { yyVAL.node = stmt.NewBreak(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2873,7 +2879,7 @@ yydefault: } case 55: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:702 + //line php5/php5.y:709 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2881,7 +2887,7 @@ yydefault: } case 56: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:708 + //line php5/php5.y:715 { yyVAL.node = stmt.NewContinue(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2889,7 +2895,7 @@ yydefault: } case 57: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:714 + //line php5/php5.y:721 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2897,7 +2903,7 @@ yydefault: } case 58: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:720 + //line php5/php5.y:727 { yyVAL.node = stmt.NewReturn(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2905,7 +2911,7 @@ yydefault: } case 59: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:726 + //line php5/php5.y:733 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2913,7 +2919,7 @@ yydefault: } case 60: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:732 + //line php5/php5.y:739 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2921,7 +2927,7 @@ yydefault: } case 61: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:738 + //line php5/php5.y:745 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2929,7 +2935,7 @@ yydefault: } case 62: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:744 + //line php5/php5.y:751 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2937,7 +2943,7 @@ yydefault: } case 63: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:750 + //line php5/php5.y:757 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2945,7 +2951,7 @@ yydefault: } case 64: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:756 + //line php5/php5.y:763 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2953,7 +2959,7 @@ yydefault: } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:762 + //line php5/php5.y:769 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2961,7 +2967,7 @@ yydefault: } case 66: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:768 + //line php5/php5.y:775 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2969,7 +2975,7 @@ yydefault: } case 67: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:774 + //line php5/php5.y:781 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2977,7 +2983,7 @@ yydefault: } case 68: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:780 + //line php5/php5.y:787 { if yyDollar[6].foreachVariable.node == nil { if yyDollar[8].altSyntaxNode.isAlt { @@ -2997,7 +3003,7 @@ yydefault: } case 69: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:798 + //line php5/php5.y:805 { if yyDollar[6].foreachVariable.node == nil { if yyDollar[8].altSyntaxNode.isAlt { @@ -3017,7 +3023,7 @@ yydefault: } case 70: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:816 + //line php5/php5.y:823 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) @@ -3025,7 +3031,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:822 + //line php5/php5.y:829 { yyVAL.node = stmt.NewNop() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3033,7 +3039,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:828 + //line php5/php5.y:835 { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3047,7 +3053,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:840 + //line php5/php5.y:847 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -3055,7 +3061,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:846 + //line php5/php5.y:853 { label := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3067,13 +3073,13 @@ yydefault: } case 75: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:859 + //line php5/php5.y:866 { yyVAL.list = []node.Node{} } case 76: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:861 + //line php5/php5.y:868 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3091,13 +3097,13 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:879 + //line php5/php5.y:886 { yyVAL.node = nil } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:881 + //line php5/php5.y:888 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3105,31 +3111,31 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:890 + //line php5/php5.y:897 { yyVAL.list = yyDollar[1].list } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:892 + //line php5/php5.y:899 { yyVAL.list = []node.Node{} } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:897 + //line php5/php5.y:904 { yyVAL.list = []node.Node{yyDollar[1].node} } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:899 + //line php5/php5.y:906 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:904 + //line php5/php5.y:911 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3145,61 +3151,61 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:921 + //line php5/php5.y:928 { yyVAL.list = []node.Node{yyDollar[1].node} } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:923 + //line php5/php5.y:930 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:928 + //line php5/php5.y:935 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:933 + //line php5/php5.y:940 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:938 + //line php5/php5.y:945 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:943 + //line php5/php5.y:950 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:945 + //line php5/php5.y:952 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:950 + //line php5/php5.y:957 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:952 + //line php5/php5.y:959 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:957 + //line php5/php5.y:964 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3211,7 +3217,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:970 + //line php5/php5.y:977 { switch n := yyDollar[1].node.(type) { case *stmt.Class: @@ -3234,7 +3240,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:991 + //line php5/php5.y:998 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3246,7 +3252,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1005 + //line php5/php5.y:1012 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3254,7 +3260,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1011 + //line php5/php5.y:1018 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3266,7 +3272,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1021 + //line php5/php5.y:1028 { yyVAL.node = stmt.NewTrait(nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3274,7 +3280,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1027 + //line php5/php5.y:1034 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3286,85 +3292,85 @@ yydefault: } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1040 + //line php5/php5.y:1047 { yyVAL.node = nil } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1042 + //line php5/php5.y:1049 { yyVAL.node = yyDollar[2].node } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1047 + //line php5/php5.y:1054 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1052 + //line php5/php5.y:1059 { yyVAL.list = nil } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1054 + //line php5/php5.y:1061 { yyVAL.list = yyDollar[2].list } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1059 + //line php5/php5.y:1066 { yyVAL.list = nil } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1061 + //line php5/php5.y:1068 { yyVAL.list = yyDollar[2].list } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1066 + //line php5/php5.y:1073 { yyVAL.list = []node.Node{yyDollar[1].node} } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1068 + //line php5/php5.y:1075 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1073 + //line php5/php5.y:1080 { yyVAL.foreachVariable = foreachVariable{nil, false} } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1075 + //line php5/php5.y:1082 { yyVAL.foreachVariable = yyDollar[2].foreachVariable } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1080 + //line php5/php5.y:1087 { yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1082 + //line php5/php5.y:1089 { yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1084 + //line php5/php5.y:1091 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3373,39 +3379,39 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1094 + //line php5/php5.y:1101 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1096 + //line php5/php5.y:1103 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1105 + //line php5/php5.y:1112 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1107 + //line php5/php5.y:1114 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1116 + //line php5/php5.y:1123 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1118 + //line php5/php5.y:1125 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3413,7 +3419,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1128 + //line php5/php5.y:1135 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3427,7 +3433,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1140 + //line php5/php5.y:1147 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3441,37 +3447,54 @@ yydefault: } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1156 + //line php5/php5.y:1163 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} + caseList := stmt.NewCaseList(yyDollar[2].list) + yyVAL.node = stmt.NewSwitch(nil, caseList) + + yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1158 + //line php5/php5.y:1171 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[4].token} + caseList := stmt.NewCaseList(yyDollar[3].list) + yyVAL.node = stmt.NewSwitch(nil, caseList) + + yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1160 + //line php5/php5.y:1179 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[4].token} + caseList := stmt.NewCaseList(yyDollar[2].list) + yyVAL.node = stmt.NewAltSwitch(nil, caseList) + + yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1162 + //line php5/php5.y:1187 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[5].token} + + caseList := stmt.NewCaseList(yyDollar[3].list) + yyVAL.node = stmt.NewAltSwitch(nil, caseList) + + yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1168 + //line php5/php5.y:1200 { yyVAL.list = []node.Node{} } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1170 + //line php5/php5.y:1202 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) @@ -3480,7 +3503,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1177 + //line php5/php5.y:1209 { _default := stmt.NewDefault(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) @@ -3489,26 +3512,26 @@ yydefault: } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1194 + //line php5/php5.y:1226 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1196 + //line php5/php5.y:1228 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1206 + //line php5/php5.y:1238 { yyVAL.list = nil } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1208 + //line php5/php5.y:1240 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) @@ -3518,13 +3541,13 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1220 + //line php5/php5.y:1252 { yyVAL.list = nil } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1222 + //line php5/php5.y:1254 { stmts := stmt.NewStmtList(yyDollar[5].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[5].list)) @@ -3537,13 +3560,13 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1237 + //line php5/php5.y:1269 { yyVAL.node = nil } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1239 + //line php5/php5.y:1271 { yyVAL.node = stmt.NewElse(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3551,13 +3574,13 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1249 + //line php5/php5.y:1281 { yyVAL.node = nil } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1251 + //line php5/php5.y:1283 { stmts := stmt.NewStmtList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) @@ -3568,31 +3591,31 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1264 + //line php5/php5.y:1296 { yyVAL.list = yyDollar[1].list } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1266 + //line php5/php5.y:1298 { yyVAL.list = nil } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1271 + //line php5/php5.y:1303 { yyVAL.list = []node.Node{yyDollar[1].node} } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1273 + //line php5/php5.y:1305 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1278 + //line php5/php5.y:1310 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3620,7 +3643,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1304 + //line php5/php5.y:1336 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3648,13 +3671,13 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1334 + //line php5/php5.y:1366 { yyVAL.node = nil } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1336 + //line php5/php5.y:1368 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3662,7 +3685,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1342 + //line php5/php5.y:1374 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3670,13 +3693,13 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1348 + //line php5/php5.y:1380 { yyVAL.node = yyDollar[1].node } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1354 + //line php5/php5.y:1386 { yyVAL.node = node.NewArgumentList(nil) @@ -3685,7 +3708,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1361 + //line php5/php5.y:1393 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -3694,7 +3717,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1368 + //line php5/php5.y:1400 { arg := node.NewArgument(yyDollar[2].node, false, false) yyVAL.node = node.NewArgumentList([]node.Node{arg}) @@ -3705,19 +3728,19 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1381 + //line php5/php5.y:1413 { yyVAL.list = []node.Node{yyDollar[1].node} } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1383 + //line php5/php5.y:1415 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1388 + //line php5/php5.y:1420 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3725,7 +3748,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1394 + //line php5/php5.y:1426 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3733,7 +3756,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1400 + //line php5/php5.y:1432 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -3741,7 +3764,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1406 + //line php5/php5.y:1438 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3749,19 +3772,19 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1415 + //line php5/php5.y:1447 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1417 + //line php5/php5.y:1449 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1423 + //line php5/php5.y:1455 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3773,7 +3796,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1433 + //line php5/php5.y:1465 { yyVAL.node = expr.NewVariable(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3781,7 +3804,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1439 + //line php5/php5.y:1471 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3789,7 +3812,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1449 + //line php5/php5.y:1481 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3808,7 +3831,7 @@ yydefault: } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1466 + //line php5/php5.y:1498 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3827,7 +3850,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1483 + //line php5/php5.y:1515 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3846,7 +3869,7 @@ yydefault: } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1500 + //line php5/php5.y:1532 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3865,19 +3888,19 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1522 + //line php5/php5.y:1554 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1524 + //line php5/php5.y:1556 { yyVAL.list = []node.Node{} } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1530 + //line php5/php5.y:1562 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) @@ -3885,19 +3908,19 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1536 + //line php5/php5.y:1568 { yyVAL.node = yyDollar[1].node } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1538 + //line php5/php5.y:1570 { yyVAL.node = yyDollar[1].node } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1540 + //line php5/php5.y:1572 { name := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3909,7 +3932,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1553 + //line php5/php5.y:1585 { var adaptationList *stmt.TraitAdaptationList switch n := yyDollar[3].node.(type) { @@ -3925,19 +3948,19 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1570 + //line php5/php5.y:1602 { yyVAL.list = []node.Node{yyDollar[1].node} } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1572 + //line php5/php5.y:1604 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1577 + //line php5/php5.y:1609 { yyVAL.node = stmt.NewNop() @@ -3945,7 +3968,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1583 + //line php5/php5.y:1615 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -3953,43 +3976,43 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1592 + //line php5/php5.y:1624 { yyVAL.list = nil } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1594 + //line php5/php5.y:1626 { yyVAL.list = yyDollar[1].list } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1599 + //line php5/php5.y:1631 { yyVAL.list = []node.Node{yyDollar[1].node} } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1601 + //line php5/php5.y:1633 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1606 + //line php5/php5.y:1638 { yyVAL.node = yyDollar[1].node } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1608 + //line php5/php5.y:1640 { yyVAL.node = yyDollar[1].node } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1613 + //line php5/php5.y:1645 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) @@ -3997,19 +4020,19 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1622 + //line php5/php5.y:1654 { yyVAL.list = []node.Node{yyDollar[1].node} } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1624 + //line php5/php5.y:1656 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1629 + //line php5/php5.y:1661 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4021,13 +4044,13 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1639 + //line php5/php5.y:1671 { yyVAL.node = yyDollar[1].node } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1644 + //line php5/php5.y:1676 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4039,7 +4062,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1657 + //line php5/php5.y:1689 { alias := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -4051,7 +4074,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1667 + //line php5/php5.y:1699 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4059,37 +4082,37 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1676 + //line php5/php5.y:1708 { yyVAL.node = nil } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1678 + //line php5/php5.y:1710 { yyVAL.node = yyDollar[1].node } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1683 + //line php5/php5.y:1715 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1685 + //line php5/php5.y:1717 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1690 + //line php5/php5.y:1722 { yyVAL.list = yyDollar[1].list } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1692 + //line php5/php5.y:1724 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4099,31 +4122,31 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1703 + //line php5/php5.y:1735 { yyVAL.list = nil } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1705 + //line php5/php5.y:1737 { yyVAL.list = yyDollar[1].list } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1710 + //line php5/php5.y:1742 { yyVAL.list = []node.Node{yyDollar[1].node} } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1712 + //line php5/php5.y:1744 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 204: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1717 + //line php5/php5.y:1749 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4131,7 +4154,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1723 + //line php5/php5.y:1755 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4139,7 +4162,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1729 + //line php5/php5.y:1761 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4147,7 +4170,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1735 + //line php5/php5.y:1767 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4155,7 +4178,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1741 + //line php5/php5.y:1773 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4163,7 +4186,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1747 + //line php5/php5.y:1779 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4171,7 +4194,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1756 + //line php5/php5.y:1788 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4189,7 +4212,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1772 + //line php5/php5.y:1804 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4207,7 +4230,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1788 + //line php5/php5.y:1820 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4225,7 +4248,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1804 + //line php5/php5.y:1836 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4243,7 +4266,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1823 + //line php5/php5.y:1855 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4260,7 +4283,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1838 + //line php5/php5.y:1870 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -4276,55 +4299,55 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1855 + //line php5/php5.y:1887 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1857 + //line php5/php5.y:1889 { yyVAL.list = []node.Node{yyDollar[1].node} } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1863 + //line php5/php5.y:1895 { yyVAL.list = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1865 + //line php5/php5.y:1897 { yyVAL.list = yyDollar[1].list } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1870 + //line php5/php5.y:1902 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1872 + //line php5/php5.y:1904 { yyVAL.list = []node.Node{yyDollar[1].node} } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1877 + //line php5/php5.y:1909 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1879 + //line php5/php5.y:1911 { yyVAL.list = yyDollar[1].list } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1884 + //line php5/php5.y:1916 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -4333,7 +4356,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1891 + //line php5/php5.y:1923 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -4342,37 +4365,37 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1901 + //line php5/php5.y:1933 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1903 + //line php5/php5.y:1935 { yyVAL.list = yyDollar[1].list } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1905 + //line php5/php5.y:1937 { yyVAL.list = yyDollar[1].list } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1910 + //line php5/php5.y:1942 { yyVAL.list = nil } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1912 + //line php5/php5.y:1944 { yyVAL.list = yyDollar[1].list } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1917 + //line php5/php5.y:1949 { if yyDollar[3].node != nil { @@ -4387,7 +4410,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1933 + //line php5/php5.y:1965 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -4399,7 +4422,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1943 + //line php5/php5.y:1975 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4407,7 +4430,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1949 + //line php5/php5.y:1981 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4415,7 +4438,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1955 + //line php5/php5.y:1987 { var _new *expr.New @@ -4434,7 +4457,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1972 + //line php5/php5.y:2004 { yyVAL.node = expr.NewClone(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4442,7 +4465,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1978 + //line php5/php5.y:2010 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4450,7 +4473,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1984 + //line php5/php5.y:2016 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4458,7 +4481,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1990 + //line php5/php5.y:2022 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4466,7 +4489,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1996 + //line php5/php5.y:2028 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4474,7 +4497,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2002 + //line php5/php5.y:2034 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4482,7 +4505,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2008 + //line php5/php5.y:2040 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4490,7 +4513,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2014 + //line php5/php5.y:2046 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4498,7 +4521,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2020 + //line php5/php5.y:2052 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4506,7 +4529,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2026 + //line php5/php5.y:2058 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4514,7 +4537,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2032 + //line php5/php5.y:2064 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4522,7 +4545,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2038 + //line php5/php5.y:2070 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4530,7 +4553,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2044 + //line php5/php5.y:2076 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4538,7 +4561,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2050 + //line php5/php5.y:2082 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4546,7 +4569,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2056 + //line php5/php5.y:2088 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4554,7 +4577,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2062 + //line php5/php5.y:2094 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4562,7 +4585,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2068 + //line php5/php5.y:2100 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4570,7 +4593,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2074 + //line php5/php5.y:2106 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4578,7 +4601,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2080 + //line php5/php5.y:2112 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4586,7 +4609,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2086 + //line php5/php5.y:2118 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4594,7 +4617,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2092 + //line php5/php5.y:2124 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4602,7 +4625,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2098 + //line php5/php5.y:2130 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4610,7 +4633,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2104 + //line php5/php5.y:2136 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4618,7 +4641,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2110 + //line php5/php5.y:2142 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4626,7 +4649,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2116 + //line php5/php5.y:2148 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4634,7 +4657,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2122 + //line php5/php5.y:2154 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4642,7 +4665,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2128 + //line php5/php5.y:2160 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4650,7 +4673,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2134 + //line php5/php5.y:2166 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4658,7 +4681,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2140 + //line php5/php5.y:2172 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4666,7 +4689,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2146 + //line php5/php5.y:2178 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4674,7 +4697,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2152 + //line php5/php5.y:2184 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4682,7 +4705,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2158 + //line php5/php5.y:2190 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4690,7 +4713,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2164 + //line php5/php5.y:2196 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4698,7 +4721,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2170 + //line php5/php5.y:2202 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4706,7 +4729,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2176 + //line php5/php5.y:2208 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4714,7 +4737,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2182 + //line php5/php5.y:2214 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4722,7 +4745,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2188 + //line php5/php5.y:2220 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4730,7 +4753,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2194 + //line php5/php5.y:2226 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4738,7 +4761,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2200 + //line php5/php5.y:2232 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4746,7 +4769,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2206 + //line php5/php5.y:2238 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4754,7 +4777,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2212 + //line php5/php5.y:2244 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4762,7 +4785,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2218 + //line php5/php5.y:2250 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4770,7 +4793,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2224 + //line php5/php5.y:2256 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4778,7 +4801,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2230 + //line php5/php5.y:2262 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4786,7 +4809,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2236 + //line php5/php5.y:2268 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4794,7 +4817,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2242 + //line php5/php5.y:2274 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4802,7 +4825,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2248 + //line php5/php5.y:2280 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4810,19 +4833,19 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2254 + //line php5/php5.y:2286 { yyVAL.node = yyDollar[1].node } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2256 + //line php5/php5.y:2288 { yyVAL.node = yyDollar[1].node } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2258 + //line php5/php5.y:2290 { yyVAL.node = yyDollar[2].node @@ -4850,7 +4873,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2284 + //line php5/php5.y:2316 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -4858,7 +4881,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2290 + //line php5/php5.y:2322 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4866,13 +4889,13 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2296 + //line php5/php5.y:2328 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2298 + //line php5/php5.y:2330 { yyVAL.node = cast.NewInt(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4880,7 +4903,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2304 + //line php5/php5.y:2336 { yyVAL.node = cast.NewDouble(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4888,7 +4911,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2310 + //line php5/php5.y:2342 { yyVAL.node = cast.NewString(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4896,7 +4919,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2316 + //line php5/php5.y:2348 { yyVAL.node = cast.NewArray(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4904,7 +4927,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2322 + //line php5/php5.y:2354 { yyVAL.node = cast.NewObject(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4912,7 +4935,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2328 + //line php5/php5.y:2360 { yyVAL.node = cast.NewBool(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4920,7 +4943,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2334 + //line php5/php5.y:2366 { yyVAL.node = cast.NewUnset(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4928,7 +4951,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2340 + //line php5/php5.y:2372 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -4940,7 +4963,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2350 + //line php5/php5.y:2382 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4948,25 +4971,25 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2356 + //line php5/php5.y:2388 { yyVAL.node = yyDollar[1].node } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2358 + //line php5/php5.y:2390 { yyVAL.node = yyDollar[1].node } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2360 + //line php5/php5.y:2392 { yyVAL.node = yyDollar[1].node } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2362 + //line php5/php5.y:2394 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -4974,7 +4997,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2368 + //line php5/php5.y:2400 { yyVAL.node = expr.NewPrint(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4982,7 +5005,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2374 + //line php5/php5.y:2406 { yyVAL.node = expr.NewYield(nil, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4990,7 +5013,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:2380 + //line php5/php5.y:2412 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].list, nil, yyDollar[8].list, false, yyDollar[2].boolWithToken.value, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) @@ -4999,7 +5022,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:2387 + //line php5/php5.y:2419 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, nil, yyDollar[9].list, true, yyDollar[3].boolWithToken.value, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) @@ -5008,7 +5031,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2397 + //line php5/php5.y:2429 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5016,7 +5039,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2403 + //line php5/php5.y:2435 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5024,7 +5047,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2409 + //line php5/php5.y:2441 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5032,7 +5055,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2415 + //line php5/php5.y:2447 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5040,7 +5063,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2424 + //line php5/php5.y:2456 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5048,7 +5071,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2430 + //line php5/php5.y:2462 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5056,7 +5079,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2436 + //line php5/php5.y:2468 { str := scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(str, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5068,7 +5091,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2446 + //line php5/php5.y:2478 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5076,7 +5099,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2455 + //line php5/php5.y:2487 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5084,7 +5107,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2461 + //line php5/php5.y:2493 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5092,25 +5115,25 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2470 + //line php5/php5.y:2502 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2475 + //line php5/php5.y:2507 { yyVAL.list = []node.Node{} } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2477 + //line php5/php5.y:2509 { yyVAL.list = yyDollar[3].list } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2482 + //line php5/php5.y:2514 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5128,7 +5151,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2498 + //line php5/php5.y:2530 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -5146,7 +5169,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2514 + //line php5/php5.y:2546 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5164,7 +5187,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2530 + //line php5/php5.y:2562 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5182,7 +5205,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2549 + //line php5/php5.y:2581 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5194,7 +5217,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2559 + //line php5/php5.y:2591 { funcName := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5206,7 +5229,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2569 + //line php5/php5.y:2601 { funcName := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5218,7 +5241,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2579 + //line php5/php5.y:2611 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5226,7 +5249,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2585 + //line php5/php5.y:2617 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5234,7 +5257,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2591 + //line php5/php5.y:2623 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5242,7 +5265,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2597 + //line php5/php5.y:2629 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5250,7 +5273,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2603 + //line php5/php5.y:2635 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) @@ -5258,7 +5281,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2612 + //line php5/php5.y:2644 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5266,7 +5289,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2618 + //line php5/php5.y:2650 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5274,7 +5297,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2624 + //line php5/php5.y:2656 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5282,7 +5305,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2630 + //line php5/php5.y:2662 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5290,7 +5313,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2639 + //line php5/php5.y:2671 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5298,7 +5321,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2645 + //line php5/php5.y:2677 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5306,7 +5329,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2651 + //line php5/php5.y:2683 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5314,19 +5337,19 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2660 + //line php5/php5.y:2692 { yyVAL.node = yyDollar[1].node } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2662 + //line php5/php5.y:2694 { yyVAL.node = yyDollar[1].node } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2667 + //line php5/php5.y:2699 { yyVAL.node = yyDollar[1].node @@ -5364,79 +5387,79 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2703 + //line php5/php5.y:2735 { yyVAL.node = yyDollar[1].node } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2709 + //line php5/php5.y:2741 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2711 + //line php5/php5.y:2743 { yyVAL.list = []node.Node{} } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2717 + //line php5/php5.y:2749 { yyVAL.list = yyDollar[2].list } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2722 + //line php5/php5.y:2754 { yyVAL.node = nil } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2724 + //line php5/php5.y:2756 { yyVAL.node = nil } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2726 + //line php5/php5.y:2758 { yyVAL.node = yyDollar[1].node } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2731 + //line php5/php5.y:2763 { yyVAL.list = []node.Node{} } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2733 + //line php5/php5.y:2765 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2735 + //line php5/php5.y:2767 { yyVAL.list = yyDollar[1].list } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2740 + //line php5/php5.y:2772 { yyVAL.node = nil } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2742 + //line php5/php5.y:2774 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2747 + //line php5/php5.y:2779 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5444,7 +5467,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2753 + //line php5/php5.y:2785 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5452,7 +5475,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2759 + //line php5/php5.y:2791 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5460,7 +5483,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2765 + //line php5/php5.y:2797 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5468,7 +5491,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2771 + //line php5/php5.y:2803 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5476,7 +5499,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2777 + //line php5/php5.y:2809 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5484,7 +5507,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2783 + //line php5/php5.y:2815 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5492,7 +5515,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2789 + //line php5/php5.y:2821 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5500,7 +5523,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2795 + //line php5/php5.y:2827 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5508,7 +5531,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2801 + //line php5/php5.y:2833 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5516,7 +5539,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2807 + //line php5/php5.y:2839 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5528,7 +5551,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2817 + //line php5/php5.y:2849 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -5536,7 +5559,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2826 + //line php5/php5.y:2858 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5548,25 +5571,25 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2839 + //line php5/php5.y:2871 { yyVAL.node = yyDollar[1].node } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2844 + //line php5/php5.y:2876 { yyVAL.node = yyDollar[1].node } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2846 + //line php5/php5.y:2878 { yyVAL.node = yyDollar[1].node } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2848 + //line php5/php5.y:2880 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5578,7 +5601,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2858 + //line php5/php5.y:2890 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5590,7 +5613,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2868 + //line php5/php5.y:2900 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5602,7 +5625,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2878 + //line php5/php5.y:2910 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5610,7 +5633,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2884 + //line php5/php5.y:2916 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5618,13 +5641,13 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2890 + //line php5/php5.y:2922 { yyVAL.node = yyDollar[1].node } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2892 + //line php5/php5.y:2924 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5632,13 +5655,13 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2898 + //line php5/php5.y:2930 { yyVAL.node = yyDollar[1].node } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2903 + //line php5/php5.y:2935 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5646,7 +5669,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2909 + //line php5/php5.y:2941 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5654,7 +5677,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2915 + //line php5/php5.y:2947 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5662,7 +5685,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2921 + //line php5/php5.y:2953 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5670,7 +5693,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2927 + //line php5/php5.y:2959 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5678,7 +5701,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2933 + //line php5/php5.y:2965 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5686,7 +5709,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2939 + //line php5/php5.y:2971 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5694,7 +5717,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2945 + //line php5/php5.y:2977 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5702,7 +5725,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2951 + //line php5/php5.y:2983 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5710,7 +5733,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2957 + //line php5/php5.y:2989 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5718,7 +5741,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2963 + //line php5/php5.y:2995 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5726,7 +5749,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2969 + //line php5/php5.y:3001 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5734,7 +5757,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2975 + //line php5/php5.y:3007 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5742,7 +5765,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2981 + //line php5/php5.y:3013 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5750,7 +5773,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2987 + //line php5/php5.y:3019 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5758,7 +5781,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2993 + //line php5/php5.y:3025 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5766,7 +5789,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2999 + //line php5/php5.y:3031 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5774,7 +5797,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3005 + //line php5/php5.y:3037 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5782,7 +5805,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3011 + //line php5/php5.y:3043 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5790,7 +5813,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3017 + //line php5/php5.y:3049 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5798,7 +5821,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3023 + //line php5/php5.y:3055 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5806,7 +5829,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3029 + //line php5/php5.y:3061 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5814,7 +5837,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3035 + //line php5/php5.y:3067 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5822,7 +5845,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3041 + //line php5/php5.y:3073 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5830,7 +5853,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3047 + //line php5/php5.y:3079 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5838,7 +5861,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3053 + //line php5/php5.y:3085 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5846,7 +5869,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3059 + //line php5/php5.y:3091 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5854,7 +5877,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3065 + //line php5/php5.y:3097 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5862,7 +5885,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3071 + //line php5/php5.y:3103 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5870,7 +5893,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3077 + //line php5/php5.y:3109 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -5878,7 +5901,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3083 + //line php5/php5.y:3115 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5886,7 +5909,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3089 + //line php5/php5.y:3121 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5894,19 +5917,19 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3095 + //line php5/php5.y:3127 { yyVAL.node = yyDollar[2].node } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3100 + //line php5/php5.y:3132 { yyVAL.node = yyDollar[1].node } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3102 + //line php5/php5.y:3134 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5918,7 +5941,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3112 + //line php5/php5.y:3144 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5930,7 +5953,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3122 + //line php5/php5.y:3154 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5942,7 +5965,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3135 + //line php5/php5.y:3167 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5954,25 +5977,25 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3145 + //line php5/php5.y:3177 { yyVAL.node = yyDollar[1].node } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3147 + //line php5/php5.y:3179 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3149 + //line php5/php5.y:3181 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3151 + //line php5/php5.y:3183 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5980,7 +6003,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3157 + //line php5/php5.y:3189 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5988,7 +6011,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3163 + //line php5/php5.y:3195 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5996,19 +6019,19 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3172 + //line php5/php5.y:3204 { yyVAL.list = nil } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3174 + //line php5/php5.y:3206 { yyVAL.list = yyDollar[1].list } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3184 + //line php5/php5.y:3216 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -6018,7 +6041,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3192 + //line php5/php5.y:3224 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6028,7 +6051,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3200 + //line php5/php5.y:3232 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6038,7 +6061,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3208 + //line php5/php5.y:3240 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6048,49 +6071,49 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3219 + //line php5/php5.y:3251 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3221 + //line php5/php5.y:3253 { yyVAL.node = yyDollar[1].node } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3226 + //line php5/php5.y:3258 { yyVAL.node = yyDollar[2].node } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3228 + //line php5/php5.y:3260 { yyVAL.node = yyDollar[2].node } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3234 + //line php5/php5.y:3266 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3240 + //line php5/php5.y:3272 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3245 + //line php5/php5.y:3277 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3250 + //line php5/php5.y:3282 { yyVAL.node = yyDollar[1].node @@ -6145,25 +6168,25 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3303 + //line php5/php5.y:3335 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3308 + //line php5/php5.y:3340 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3310 + //line php5/php5.y:3342 { yyVAL.list = []node.Node{} } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3316 + //line php5/php5.y:3348 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -6174,7 +6197,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3328 + //line php5/php5.y:3360 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6183,7 +6206,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3335 + //line php5/php5.y:3367 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6192,38 +6215,38 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3345 + //line php5/php5.y:3377 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3353 + //line php5/php5.y:3385 { yyVAL.list = []node.Node{yyDollar[1].node} } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3355 + //line php5/php5.y:3387 { yyVAL.list = yyDollar[1].list } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3357 + //line php5/php5.y:3389 { yyVAL.list = nil } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3362 + //line php5/php5.y:3394 { yyVAL.node = yyDollar[1].node } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3364 + //line php5/php5.y:3396 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6235,7 +6258,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3377 + //line php5/php5.y:3409 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6243,7 +6266,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3383 + //line php5/php5.y:3415 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6251,13 +6274,13 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3393 + //line php5/php5.y:3425 { yyVAL.node = yyDollar[1].node } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3398 + //line php5/php5.y:3430 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6265,7 +6288,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3404 + //line php5/php5.y:3436 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6273,31 +6296,31 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3412 + //line php5/php5.y:3444 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3413 + //line php5/php5.y:3445 { yyVAL.node = yyDollar[1].node } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3414 + //line php5/php5.y:3446 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3420 + //line php5/php5.y:3452 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3422 + //line php5/php5.y:3454 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6309,13 +6332,13 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3432 + //line php5/php5.y:3464 { yyVAL.node = yyDollar[1].node } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3437 + //line php5/php5.y:3469 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6323,7 +6346,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3443 + //line php5/php5.y:3475 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6331,13 +6354,13 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3449 + //line php5/php5.y:3481 { yyVAL.node = yyDollar[1].node } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3455 + //line php5/php5.y:3487 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6349,7 +6372,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3465 + //line php5/php5.y:3497 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6357,25 +6380,25 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3474 + //line php5/php5.y:3506 { yyVAL.node = nil } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3476 + //line php5/php5.y:3508 { yyVAL.node = yyDollar[1].node } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3482 + //line php5/php5.y:3514 { yyVAL.list = yyDollar[1].list } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3484 + //line php5/php5.y:3516 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6384,7 +6407,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3494 + //line php5/php5.y:3526 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6393,7 +6416,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3501 + //line php5/php5.y:3533 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6402,7 +6425,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3508 + //line php5/php5.y:3540 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6411,7 +6434,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3518 + //line php5/php5.y:3550 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6419,13 +6442,13 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3524 + //line php5/php5.y:3556 { yyVAL.node = yyDollar[2].node } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3529 + //line php5/php5.y:3561 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6435,7 +6458,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3537 + //line php5/php5.y:3569 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6449,13 +6472,13 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3552 + //line php5/php5.y:3584 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3554 + //line php5/php5.y:3586 { if yyDollar[1].node == nil { yyVAL.list = []node.Node{} @@ -6465,7 +6488,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3566 + //line php5/php5.y:3598 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6473,7 +6496,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3572 + //line php5/php5.y:3604 { item := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6485,25 +6508,25 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3582 + //line php5/php5.y:3614 { yyVAL.node = nil } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3588 + //line php5/php5.y:3620 { yyVAL.list = []node.Node{} } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3590 + //line php5/php5.y:3622 { yyVAL.list = yyDollar[1].list } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3595 + //line php5/php5.y:3627 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -6513,7 +6536,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3603 + //line php5/php5.y:3635 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6523,7 +6546,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3611 + //line php5/php5.y:3643 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6533,7 +6556,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3619 + //line php5/php5.y:3651 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6543,7 +6566,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3627 + //line php5/php5.y:3659 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[6].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) @@ -6553,7 +6576,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3635 + //line php5/php5.y:3667 { arrayItem := expr.NewArrayItem(nil, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) @@ -6563,7 +6586,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3643 + //line php5/php5.y:3675 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -6573,7 +6596,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3651 + //line php5/php5.y:3683 { arrayItem := expr.NewArrayItem(nil, yyDollar[2].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6583,13 +6606,13 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3662 + //line php5/php5.y:3694 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3664 + //line php5/php5.y:3696 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6598,13 +6621,13 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3671 + //line php5/php5.y:3703 { yyVAL.list = []node.Node{yyDollar[1].node} } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3673 + //line php5/php5.y:3705 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6613,7 +6636,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3683 + //line php5/php5.y:3715 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6625,7 +6648,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3693 + //line php5/php5.y:3725 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6640,7 +6663,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3706 + //line php5/php5.y:3738 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6658,7 +6681,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3722 + //line php5/php5.y:3754 { yyVAL.node = yyDollar[2].node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6666,7 +6689,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3728 + //line php5/php5.y:3760 { identifier := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6681,13 +6704,13 @@ yydefault: } case 500: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3742 + //line php5/php5.y:3774 { yyVAL.node = yyDollar[2].node } case 501: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3747 + //line php5/php5.y:3779 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6695,7 +6718,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3753 + //line php5/php5.y:3785 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -6709,7 +6732,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3765 + //line php5/php5.y:3797 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6721,7 +6744,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3778 + //line php5/php5.y:3810 { yyVAL.node = expr.NewIsset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6729,7 +6752,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3784 + //line php5/php5.y:3816 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6737,7 +6760,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3790 + //line php5/php5.y:3822 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6745,7 +6768,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3796 + //line php5/php5.y:3828 { yyVAL.node = expr.NewInclude(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6753,7 +6776,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3802 + //line php5/php5.y:3834 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6761,7 +6784,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3808 + //line php5/php5.y:3840 { yyVAL.node = expr.NewEval(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6769,7 +6792,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3814 + //line php5/php5.y:3846 { yyVAL.node = expr.NewRequire(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6777,7 +6800,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3820 + //line php5/php5.y:3852 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6785,31 +6808,31 @@ yydefault: } case 512: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3829 + //line php5/php5.y:3861 { yyVAL.list = []node.Node{yyDollar[1].node} } case 513: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3831 + //line php5/php5.y:3863 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 514: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3836 + //line php5/php5.y:3868 { yyVAL.node = yyDollar[1].node } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3838 + //line php5/php5.y:3870 { yyVAL.node = yyDollar[1].node } case 516: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3843 + //line php5/php5.y:3875 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6821,7 +6844,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3853 + //line php5/php5.y:3885 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6833,7 +6856,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3866 + //line php5/php5.y:3898 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6845,7 +6868,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3879 + //line php5/php5.y:3911 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) diff --git a/php5/php5.y b/php5/php5.y index 4561c55..a0db787 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -244,6 +244,7 @@ import ( %type static_scalar_value static_operation %type ctor_arguments function_call_parameter_list %type trait_adaptations +%type switch_case_list %type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations %type inner_statement_list global_var_list static_var_list encaps_list isset_variables non_empty_array_pair_list @@ -260,7 +261,7 @@ import ( %type simple_indirect_reference %type foreach_variable foreach_optional_arg -%type switch_case_list method_body +%type method_body %type is_reference is_variadic %type while_statement for_statement foreach_statement @@ -684,12 +685,18 @@ unticked_statement: } | T_SWITCH parenthesis_expr switch_case_list { - if ($3.endToken.Value == ";") { - $$ = stmt.NewAltSwitch($2, $3.nodes) - } else { - $$ = stmt.NewSwitch($2, $3.nodes) + switch n := $3.(type) { + case *stmt.Switch: + n.Cond = $2 + case *stmt.AltSwitch: + n.Cond = $2 + default: + panic("unexpected node type") } - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3.endToken)) + + $$ = $3 + + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) yylex.(*Parser).comments.AddComments($$, $1.Comments()) } | T_BREAK ';' @@ -1153,13 +1160,38 @@ declare_list: switch_case_list: '{' case_list '}' - { $$ = &nodesWithEndToken{$2, $3} } + { + caseList := stmt.NewCaseList($2) + $$ = stmt.NewSwitch(nil, caseList) + + yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + } | '{' ';' case_list '}' - { $$ = &nodesWithEndToken{$3, $4} } + { + caseList := stmt.NewCaseList($3) + $$ = stmt.NewSwitch(nil, caseList) + + yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + } | ':' case_list T_ENDSWITCH ';' - { $$ = &nodesWithEndToken{$2, $4} } + { + caseList := stmt.NewCaseList($2) + $$ = stmt.NewAltSwitch(nil, caseList) + + yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + } | ':' ';' case_list T_ENDSWITCH ';' - { $$ = &nodesWithEndToken{$3, $5} } + { + + caseList := stmt.NewCaseList($3) + $$ = stmt.NewAltSwitch(nil, caseList) + + yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition($3)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + } ; diff --git a/php5/php5_test.go b/php5/php5_test.go index 6150359..31d8a09 100644 --- a/php5/php5_test.go +++ b/php5/php5_test.go @@ -1354,63 +1354,71 @@ func TestPhp5(t *testing.T) { }, &stmt.AltSwitch{ Cond: &scalar.Lnumber{Value: "1"}, - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmts: []node.Node{}, - }, - &stmt.Default{ - Stmts: []node.Node{}, - }, - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, - Stmts: []node.Node{}, + CaseList: &stmt.CaseList{ + Cases: []node.Node{ + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "1"}, + Stmts: []node.Node{}, + }, + &stmt.Default{ + Stmts: []node.Node{}, + }, + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "2"}, + Stmts: []node.Node{}, + }, }, }, }, &stmt.AltSwitch{ Cond: &scalar.Lnumber{Value: "1"}, - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmts: []node.Node{}, - }, - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Switch{ - Cond: &scalar.Lnumber{Value: "1"}, - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmts: []node.Node{ - &stmt.Break{}, + CaseList: &stmt.CaseList{ + Cases: []node.Node{ + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "1"}, + Stmts: []node.Node{}, }, - }, - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, - Stmts: []node.Node{ - &stmt.Break{}, + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "2"}, + Stmts: []node.Node{}, }, }, }, }, &stmt.Switch{ Cond: &scalar.Lnumber{Value: "1"}, - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmts: []node.Node{ - &stmt.Break{}, + CaseList: &stmt.CaseList{ + Cases: []node.Node{ + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "1"}, + Stmts: []node.Node{ + &stmt.Break{}, + }, + }, + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "2"}, + Stmts: []node.Node{ + &stmt.Break{}, + }, }, }, - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, - Stmts: []node.Node{ - &stmt.Break{}, + }, + }, + &stmt.Switch{ + Cond: &scalar.Lnumber{Value: "1"}, + CaseList: &stmt.CaseList{ + Cases: []node.Node{ + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "1"}, + Stmts: []node.Node{ + &stmt.Break{}, + }, + }, + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "2"}, + Stmts: []node.Node{ + &stmt.Break{}, + }, }, }, }, diff --git a/php7/php7.go b/php7/php7.go index e5ffa3a..5d74876 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -345,7 +345,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:4160 +//line php7/php7.y:4219 type foreachVariable struct { node node.Node @@ -644,7 +644,7 @@ var yyAct = [...]int{ 527, 256, 257, 531, 738, 106, 222, 740, 818, 805, 526, 256, 257, 521, 860, 824, 367, 873, 827, 145, 806, 792, 817, 232, 823, 142, 719, 323, 149, 255, - 836, 834, 660, 822, 278, 255, 251, 645, 830, 928, + 836, 834, 660, 822, 278, 255, 251, 928, 830, 645, 422, 255, 840, 849, 224, 43, 282, 42, 16, 15, 851, 843, 599, 267, 546, 49, 546, 848, 745, 746, 747, 744, 743, 742, 853, 48, 867, 108, 671, 255, @@ -1453,7 +1453,7 @@ var yyPgo = [...]int{ 855, 853, 5, 852, 83, 40, 845, 138, 43, 840, 837, 835, 825, 823, 119, 822, 819, 818, 817, 12, 815, 814, 44, 42, 32, 2, 15, 629, 41, 74, - 812, 8, 686, 20, 809, 807, 536, 806, 121, 803, + 812, 809, 8, 686, 20, 807, 536, 806, 121, 803, 802, 800, 71, 798, 33, 797, 795, 30, 37, 791, 789, 28, 787, 786, 545, 784, 18, 783, 776, 26, 773, 63, 1, 4, 768, 17, 767, 39, 765, 763, @@ -1471,7 +1471,7 @@ var yyR1 = [...]int{ 5, 5, 5, 5, 5, 5, 6, 6, 111, 111, 88, 88, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 82, 82, 16, 16, 18, 18, 7, 7, 98, 98, + 83, 83, 16, 16, 18, 18, 7, 7, 98, 98, 97, 97, 104, 104, 17, 17, 20, 20, 19, 19, 92, 92, 112, 112, 22, 22, 22, 22, 22, 22, 22, 11, 11, 11, 11, 11, 11, 11, 11, 11, @@ -1479,16 +1479,16 @@ var yyR1 = [...]int{ 11, 11, 11, 11, 11, 90, 90, 89, 89, 26, 26, 103, 103, 27, 12, 1, 1, 2, 2, 13, 13, 122, 122, 77, 77, 14, 15, 29, 29, 116, - 116, 117, 117, 83, 83, 83, 83, 125, 125, 126, - 126, 25, 25, 85, 85, 85, 85, 101, 101, 101, + 116, 117, 117, 84, 84, 84, 84, 125, 125, 126, + 126, 25, 25, 81, 81, 81, 81, 101, 101, 101, 8, 8, 124, 124, 68, 68, 66, 66, 70, 70, 67, 67, 113, 113, 114, 114, 30, 30, 31, 31, 76, 76, 74, 74, 74, 75, 75, 78, 78, 110, 110, 32, 32, 96, 96, 34, 100, 100, 35, 35, 115, 115, 36, 36, 36, 36, 121, 121, 80, 80, 80, 102, 102, 37, 37, 38, 39, 39, 39, 39, - 41, 41, 40, 84, 84, 119, 119, 118, 118, 120, - 120, 81, 81, 81, 81, 81, 81, 99, 99, 42, + 41, 41, 40, 85, 85, 119, 119, 118, 118, 120, + 120, 82, 82, 82, 82, 82, 82, 99, 99, 42, 42, 91, 91, 69, 21, 93, 93, 43, 94, 94, 95, 95, 45, 44, 44, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, @@ -1576,7 +1576,7 @@ var yyChk = [...]int{ -58, -53, -46, -56, -57, 91, 49, 50, 4, 5, 84, 85, 86, 8, 9, 66, 67, 81, 63, 64, 65, 80, 62, 74, 140, 12, 157, -10, -60, 60, - 18, -88, 82, 146, 82, -88, 142, 10, -18, -82, + 18, -88, 82, 146, 82, -88, 142, 10, -18, -83, -104, -88, 82, 37, 38, -19, -20, -92, -21, 10, -112, 146, -11, 37, 79, 146, 146, -24, -23, 98, -24, -24, -96, -34, -48, -100, 37, -35, 12, -93, @@ -1628,9 +1628,9 @@ var yyChk = [...]int{ 10, 13, 152, 12, 10, 143, 143, 148, 143, -23, 149, -78, -23, -78, -48, -24, -23, -55, -48, -29, -7, 158, 147, 147, 143, -7, 158, -23, 147, 143, - 142, 82, -98, -17, -20, -82, 142, -123, 147, -124, - -11, 145, -23, -94, -23, -85, 142, 145, 146, -23, - 147, -27, -83, -28, 151, 59, 148, -25, -11, 145, + 142, 82, -98, -17, -20, -83, 142, -123, 147, -124, + -11, 145, -23, -94, -23, -81, 142, 145, 146, -23, + 147, -27, -84, -28, 151, 59, 148, -25, -11, 145, -90, 146, -113, -114, -30, -31, -76, -74, 150, 60, 61, -10, -117, -123, -121, -115, 142, 158, 147, 147, 95, -11, 145, 143, 160, -23, -28, 146, 147, 149, @@ -1639,12 +1639,12 @@ var yyChk = [...]int{ 144, -101, 144, -101, 144, -113, 144, 147, 58, -28, 146, -109, -112, -26, 41, 42, -113, 147, 158, -1, 151, -74, -123, 142, 143, -36, -119, -118, 44, -120, - 47, -81, 103, 102, 101, 98, 99, 100, -115, -10, + 47, -82, 103, 102, 101, 98, 99, 100, -115, -10, -11, 145, 144, -112, -23, -109, 149, -123, -7, 158, -97, 143, -17, -7, 22, 144, -94, 143, 32, 33, - -101, 31, -101, 147, -126, -11, 145, -83, -28, -109, + -101, 31, -101, 147, -126, -11, 145, -84, -28, -109, 149, 28, 146, 142, 147, -106, 44, -30, -2, 83, - 142, -115, -99, -42, 12, 38, 37, -121, -81, 143, + 142, -115, -99, -42, 12, 38, 37, -121, -82, 143, -112, 147, 143, 142, 143, -20, -7, 143, 144, 147, -23, -8, 145, 144, 143, 144, 31, -106, -112, 147, 147, 144, -89, -10, -112, -75, 145, -75, 146, 12, @@ -1656,8 +1656,8 @@ var yyChk = [...]int{ -6, 79, 10, 143, -112, -112, 142, 144, 147, -10, -112, -112, 147, 158, 12, -23, -123, -69, -23, -123, 143, -37, 144, 144, 45, 29, 78, 24, -112, 142, - 143, 143, -52, -123, 146, -121, 10, -4, -81, -6, - 144, 143, -112, -113, -6, 143, 147, -75, -84, 144, + 143, 143, -52, -123, 146, -121, 10, -4, -82, -6, + 144, 143, -112, -113, -6, 143, 147, -75, -85, 144, 142, -112, 143, } var yyDef = [...]int{ @@ -2133,7 +2133,7 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:295 + //line php7/php7.y:296 { yylex.(*Parser).rootNode = stmt.NewStmtList(yyDollar[1].list) @@ -2142,463 +2142,463 @@ yydefault: } case 2: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 3: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 5: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 10: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 11: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 12: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 13: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 14: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 15: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 16: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 17: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 18: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 21: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 22: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 23: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 24: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 27: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 28: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 29: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 30: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 33: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 34: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 35: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 36: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 37: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 38: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 39: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 44: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 46: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 47: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 48: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 49: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 50: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 51: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 52: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 53: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 54: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 55: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 56: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 57: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 58: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 59: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 60: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 61: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 62: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 63: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 64: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 66: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 67: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 68: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 69: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 70: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 72: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 73: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 74: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 75: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:317 { yyVAL.token = yyDollar[1].token } case 76: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:321 + //line php7/php7.y:322 { yyVAL.token = yyDollar[1].token } case 77: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:323 + //line php7/php7.y:324 { yyVAL.token = yyDollar[1].token } case 78: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:328 + //line php7/php7.y:329 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2606,13 +2606,13 @@ yydefault: } case 79: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:334 + //line php7/php7.y:335 { yyVAL.list = []node.Node{} } case 80: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:339 + //line php7/php7.y:340 { namePart := name.NewNamePart(yyDollar[1].token.Value) yyVAL.list = []node.Node{namePart} @@ -2625,7 +2625,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:350 + //line php7/php7.y:351 { namePart := name.NewNamePart(yyDollar[3].token.Value) yyVAL.list = append(yyDollar[1].list, namePart) @@ -2639,7 +2639,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:365 + //line php7/php7.y:366 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -2648,7 +2648,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:372 + //line php7/php7.y:373 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -2661,7 +2661,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:383 + //line php7/php7.y:384 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -2673,44 +2673,44 @@ yydefault: } case 85: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:396 + //line php7/php7.y:397 { // error yyVAL.node = nil } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:401 + //line php7/php7.y:402 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:403 + //line php7/php7.y:404 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:405 + //line php7/php7.y:406 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:407 + //line php7/php7.y:408 { yyVAL.node = yyDollar[1].node } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:409 + //line php7/php7.y:410 { yyVAL.node = yyDollar[1].node } case 91: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:411 + //line php7/php7.y:412 { yyVAL.node = stmt.NewHaltCompiler() @@ -2725,7 +2725,7 @@ yydefault: } case 92: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:424 + //line php7/php7.y:425 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2740,7 +2740,7 @@ yydefault: } case 93: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:437 + //line php7/php7.y:438 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2756,7 +2756,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:451 + //line php7/php7.y:452 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2770,7 +2770,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:463 + //line php7/php7.y:464 { yyVAL.node = yyDollar[2].node @@ -2783,7 +2783,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:474 + //line php7/php7.y:475 { yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) @@ -2796,7 +2796,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:485 + //line php7/php7.y:486 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2809,7 +2809,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:496 + //line php7/php7.y:497 { yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) @@ -2822,7 +2822,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:507 + //line php7/php7.y:508 { yyVAL.node = stmt.NewConstList(yyDollar[2].list) @@ -2835,7 +2835,7 @@ yydefault: } case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:521 + //line php7/php7.y:522 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2847,7 +2847,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:531 + //line php7/php7.y:532 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2859,7 +2859,7 @@ yydefault: } case 102: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:544 + //line php7/php7.y:545 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2878,7 +2878,7 @@ yydefault: } case 103: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:561 + //line php7/php7.y:562 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2898,7 +2898,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:582 + //line php7/php7.y:583 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2917,7 +2917,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:599 + //line php7/php7.y:600 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2937,19 +2937,19 @@ yydefault: } case 106: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:620 + //line php7/php7.y:621 { yyVAL.token = nil } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:622 + //line php7/php7.y:623 { yyVAL.token = yyDollar[1].token } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:627 + //line php7/php7.y:628 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2958,13 +2958,13 @@ yydefault: } case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:634 + //line php7/php7.y:635 { yyVAL.list = []node.Node{yyDollar[1].node} } case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:639 + //line php7/php7.y:640 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2973,13 +2973,13 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:646 + //line php7/php7.y:647 { yyVAL.list = []node.Node{yyDollar[1].node} } case 112: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:651 + //line php7/php7.y:652 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2988,25 +2988,25 @@ yydefault: } case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:658 + //line php7/php7.y:659 { yyVAL.list = []node.Node{yyDollar[1].node} } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:663 + //line php7/php7.y:664 { yyVAL.node = yyDollar[1].node } case 115: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:665 + //line php7/php7.y:666 { yyVAL.node = yyDollar[2].node.(*stmt.Use).SetUseType(yyDollar[1].node) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:670 + //line php7/php7.y:671 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -3017,7 +3017,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:679 + //line php7/php7.y:680 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -3034,13 +3034,13 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:697 + //line php7/php7.y:698 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:699 + //line php7/php7.y:700 { yyVAL.node = yyDollar[2].node @@ -3049,7 +3049,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:709 + //line php7/php7.y:710 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3058,13 +3058,13 @@ yydefault: } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:716 + //line php7/php7.y:717 { yyVAL.list = []node.Node{yyDollar[1].node} } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:721 + //line php7/php7.y:722 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3072,50 +3072,50 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:727 + //line php7/php7.y:728 { yyVAL.list = []node.Node{} } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:732 + //line php7/php7.y:733 { // error yyVAL.node = nil } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:737 + //line php7/php7.y:738 { yyVAL.node = yyDollar[1].node } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:739 + //line php7/php7.y:740 { yyVAL.node = yyDollar[1].node } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:741 + //line php7/php7.y:742 { yyVAL.node = yyDollar[1].node } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:743 + //line php7/php7.y:744 { yyVAL.node = yyDollar[1].node } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:745 + //line php7/php7.y:746 { yyVAL.node = yyDollar[1].node } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:747 + //line php7/php7.y:748 { yyVAL.node = stmt.NewHaltCompiler() @@ -3130,7 +3130,7 @@ yydefault: } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:762 + //line php7/php7.y:763 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3143,19 +3143,19 @@ yydefault: } case 132: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:773 + //line php7/php7.y:774 { yyVAL.node = yyDollar[1].node } case 133: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:775 + //line php7/php7.y:776 { yyVAL.node = yyDollar[1].node } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:777 + //line php7/php7.y:778 { if yyDollar[5].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltWhile(yyDollar[3].node, yyDollar[5].altSyntaxNode.node) @@ -3173,7 +3173,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:793 + //line php7/php7.y:794 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) @@ -3189,7 +3189,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:807 + //line php7/php7.y:808 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltFor(yyDollar[3].list, yyDollar[5].list, yyDollar[7].list, yyDollar[9].altSyntaxNode.node) @@ -3209,16 +3209,21 @@ yydefault: } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:825 + //line php7/php7.y:826 { - if yyDollar[5].nodesWithEndToken.endToken.Value == ";" { - yyVAL.node = stmt.NewAltSwitch(yyDollar[3].node, yyDollar[5].nodesWithEndToken.nodes) - } else { - yyVAL.node = stmt.NewSwitch(yyDollar[3].node, yyDollar[5].nodesWithEndToken.nodes) + switch n := yyDollar[5].node.(type) { + case *stmt.Switch: + n.Cond = yyDollar[3].node + case *stmt.AltSwitch: + n.Cond = yyDollar[3].node + default: + panic("unexpected node type") } + yyVAL.node = yyDollar[5].node + // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].nodesWithEndToken.endToken)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SwitchToken) @@ -3227,7 +3232,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:841 + //line php7/php7.y:847 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3240,7 +3245,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:852 + //line php7/php7.y:858 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3253,7 +3258,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:863 + //line php7/php7.y:869 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3266,7 +3271,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:874 + //line php7/php7.y:880 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3279,7 +3284,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:885 + //line php7/php7.y:891 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3292,7 +3297,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:896 + //line php7/php7.y:902 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3305,7 +3310,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:907 + //line php7/php7.y:913 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3317,7 +3322,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:917 + //line php7/php7.y:923 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3329,7 +3334,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:927 + //line php7/php7.y:933 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3347,7 +3352,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:943 + //line php7/php7.y:949 { if yyDollar[7].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, nil, yyDollar[5].foreachVariable.node, yyDollar[7].altSyntaxNode.node, yyDollar[5].foreachVariable.byRef) @@ -3366,7 +3371,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:960 + //line php7/php7.y:966 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, yyDollar[5].node, yyDollar[7].foreachVariable.node, yyDollar[9].altSyntaxNode.node, yyDollar[7].foreachVariable.byRef) @@ -3386,7 +3391,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:978 + //line php7/php7.y:984 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) @@ -3400,7 +3405,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:990 + //line php7/php7.y:996 { yyVAL.node = stmt.NewNop() @@ -3412,7 +3417,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1000 + //line php7/php7.y:1006 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3429,7 +3434,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1015 + //line php7/php7.y:1021 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3442,7 +3447,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1026 + //line php7/php7.y:1032 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3458,7 +3463,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1040 + //line php7/php7.y:1046 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -3473,13 +3478,13 @@ yydefault: } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1055 + //line php7/php7.y:1061 { yyVAL.list = []node.Node{} } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1057 + //line php7/php7.y:1063 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[5].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -3501,13 +3506,13 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1079 + //line php7/php7.y:1085 { yyVAL.list = []node.Node{yyDollar[1].node} } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1081 + //line php7/php7.y:1087 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3516,13 +3521,13 @@ yydefault: } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1091 + //line php7/php7.y:1097 { yyVAL.node = nil } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1093 + //line php7/php7.y:1099 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3536,13 +3541,13 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1108 + //line php7/php7.y:1114 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1110 + //line php7/php7.y:1116 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3551,13 +3556,13 @@ yydefault: } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1120 + //line php7/php7.y:1126 { yyVAL.node = yyDollar[1].node } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1125 + //line php7/php7.y:1131 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].boolWithToken.value, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) @@ -3579,31 +3584,31 @@ yydefault: } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1148 + //line php7/php7.y:1154 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1150 + //line php7/php7.y:1156 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1155 + //line php7/php7.y:1161 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1157 + //line php7/php7.y:1163 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1162 + //line php7/php7.y:1168 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].node, yyDollar[5].list, yyDollar[8].list, yyDollar[6].str) @@ -3626,7 +3631,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1183 + //line php7/php7.y:1189 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) @@ -3649,19 +3654,19 @@ yydefault: } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1207 + //line php7/php7.y:1213 { yyVAL.list = []node.Node{yyDollar[1].node} } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1209 + //line php7/php7.y:1215 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1214 + //line php7/php7.y:1220 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3673,7 +3678,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1224 + //line php7/php7.y:1230 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3685,7 +3690,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1237 + //line php7/php7.y:1243 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3702,7 +3707,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1255 + //line php7/php7.y:1261 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].list, yyDollar[6].list, yyDollar[4].str) @@ -3722,13 +3727,13 @@ yydefault: } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1276 + //line php7/php7.y:1282 { yyVAL.node = nil } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1278 + //line php7/php7.y:1284 { yyVAL.node = yyDollar[2].node @@ -3737,13 +3742,13 @@ yydefault: } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1288 + //line php7/php7.y:1294 { yyVAL.list = nil } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1290 + //line php7/php7.y:1296 { yyVAL.list = yyDollar[2].list @@ -3752,13 +3757,13 @@ yydefault: } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1300 + //line php7/php7.y:1306 { yyVAL.list = nil } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1302 + //line php7/php7.y:1308 { yyVAL.list = yyDollar[2].list @@ -3767,13 +3772,13 @@ yydefault: } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1312 + //line php7/php7.y:1318 { yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1314 + //line php7/php7.y:1320 { yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} @@ -3785,7 +3790,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1324 + //line php7/php7.y:1330 { list := expr.NewList(yyDollar[3].list) yyVAL.foreachVariable = foreachVariable{list, false} @@ -3800,7 +3805,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1337 + //line php7/php7.y:1343 { list := expr.NewShortList(yyDollar[2].list) yyVAL.foreachVariable = foreachVariable{list, false} @@ -3814,13 +3819,13 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1352 + //line php7/php7.y:1358 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1354 + //line php7/php7.y:1360 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} @@ -3834,13 +3839,13 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1369 + //line php7/php7.y:1375 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1371 + //line php7/php7.y:1377 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} @@ -3854,13 +3859,13 @@ yydefault: } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1386 + //line php7/php7.y:1392 { yyVAL.node = yyDollar[1].node } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1388 + //line php7/php7.y:1394 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3874,37 +3879,78 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1402 + //line php7/php7.y:1409 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} + caseList := stmt.NewCaseList(yyDollar[2].list) + yyVAL.node = stmt.NewSwitch(nil, caseList) + + // save position + yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[3].token, comment.CloseCurlyBracesToken) } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1403 + //line php7/php7.y:1422 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[4].token} + caseList := stmt.NewCaseList(yyDollar[3].list) + yyVAL.node = stmt.NewSwitch(nil, caseList) + + // save position + yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[2].token, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[4].token, comment.CloseCurlyBracesToken) } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1404 + //line php7/php7.y:1436 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[4].token} + caseList := stmt.NewCaseList(yyDollar[2].list) + yyVAL.node = stmt.NewAltSwitch(nil, caseList) + + // save position + yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[3].token, comment.EndswitchToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1405 + //line php7/php7.y:1450 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[3].list, yyDollar[5].token} + + caseList := stmt.NewCaseList(yyDollar[3].list) + yyVAL.node = stmt.NewAltSwitch(nil, caseList) + + // save position + yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[2].token, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[4].token, comment.EndswitchToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.SemiColonToken) } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1410 + //line php7/php7.y:1469 { yyVAL.list = []node.Node{} } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1412 + //line php7/php7.y:1471 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -3918,7 +3964,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1424 + //line php7/php7.y:1483 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -3932,25 +3978,25 @@ yydefault: } case 200: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1439 + //line php7/php7.y:1498 { yyVAL.token = yyDollar[1].token } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1441 + //line php7/php7.y:1500 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1446 + //line php7/php7.y:1505 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1448 + //line php7/php7.y:1507 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} @@ -3964,7 +4010,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1463 + //line php7/php7.y:1522 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -3978,7 +4024,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1475 + //line php7/php7.y:1534 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -3994,13 +4040,13 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1492 + //line php7/php7.y:1551 { yyVAL.node = yyDollar[1].node } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1494 + //line php7/php7.y:1553 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4014,7 +4060,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1509 + //line php7/php7.y:1568 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4031,7 +4077,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1524 + //line php7/php7.y:1583 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4049,7 +4095,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1543 + //line php7/php7.y:1602 { yyVAL.node = yyDollar[1].node @@ -4062,7 +4108,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1554 + //line php7/php7.y:1613 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4081,25 +4127,25 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1574 + //line php7/php7.y:1633 { yyVAL.list = yyDollar[1].list } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1576 + //line php7/php7.y:1635 { yyVAL.list = nil } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1581 + //line php7/php7.y:1640 { yyVAL.list = []node.Node{yyDollar[1].node} } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1583 + //line php7/php7.y:1642 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4108,7 +4154,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1593 + //line php7/php7.y:1652 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4147,7 +4193,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1630 + //line php7/php7.y:1689 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4186,25 +4232,25 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1670 + //line php7/php7.y:1729 { yyVAL.node = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1672 + //line php7/php7.y:1731 { yyVAL.node = yyDollar[1].node } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1677 + //line php7/php7.y:1736 { yyVAL.node = yyDollar[1].node } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1679 + //line php7/php7.y:1738 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4216,7 +4262,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1692 + //line php7/php7.y:1751 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4228,7 +4274,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1702 + //line php7/php7.y:1761 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4240,19 +4286,19 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1712 + //line php7/php7.y:1771 { yyVAL.node = yyDollar[1].node } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1717 + //line php7/php7.y:1776 { yyVAL.node = nil } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1719 + //line php7/php7.y:1778 { yyVAL.node = yyDollar[2].node @@ -4261,7 +4307,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1729 + //line php7/php7.y:1788 { yyVAL.node = node.NewArgumentList(nil) @@ -4270,7 +4316,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1736 + //line php7/php7.y:1795 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4279,13 +4325,13 @@ yydefault: } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1746 + //line php7/php7.y:1805 { yyVAL.list = []node.Node{yyDollar[1].node} } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1748 + //line php7/php7.y:1807 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4294,7 +4340,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1758 + //line php7/php7.y:1817 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4303,7 +4349,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1765 + //line php7/php7.y:1824 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4315,7 +4361,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1778 + //line php7/php7.y:1837 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4324,19 +4370,19 @@ yydefault: } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1785 + //line php7/php7.y:1844 { yyVAL.list = []node.Node{yyDollar[1].node} } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1790 + //line php7/php7.y:1849 { yyVAL.node = yyDollar[1].node } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1795 + //line php7/php7.y:1854 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4345,13 +4391,13 @@ yydefault: } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1802 + //line php7/php7.y:1861 { yyVAL.list = []node.Node{yyDollar[1].node} } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1807 + //line php7/php7.y:1866 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4367,7 +4413,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1821 + //line php7/php7.y:1880 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4384,19 +4430,19 @@ yydefault: } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1839 + //line php7/php7.y:1898 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1841 + //line php7/php7.y:1900 { yyVAL.list = []node.Node{} } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1846 + //line php7/php7.y:1905 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4408,7 +4454,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1856 + //line php7/php7.y:1915 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4421,7 +4467,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1867 + //line php7/php7.y:1926 { var adaptationList *stmt.TraitAdaptationList @@ -4443,7 +4489,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:1887 + //line php7/php7.y:1946 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].boolWithToken.value, yyDollar[7].list, yyDollar[9].node, yyDollar[10].nodesWithEndToken.nodes, yyDollar[5].str) @@ -4463,13 +4509,13 @@ yydefault: } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1908 + //line php7/php7.y:1967 { yyVAL.list = []node.Node{yyDollar[1].node} } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1910 + //line php7/php7.y:1969 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4478,7 +4524,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1920 + //line php7/php7.y:1979 { yyVAL.node = stmt.NewNop() @@ -4490,7 +4536,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1930 + //line php7/php7.y:1989 { yyVAL.node = stmt.NewTraitAdaptationList(nil) @@ -4502,7 +4548,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1940 + //line php7/php7.y:1999 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4514,19 +4560,19 @@ yydefault: } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1953 + //line php7/php7.y:2012 { yyVAL.list = []node.Node{yyDollar[1].node} } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1955 + //line php7/php7.y:2014 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1960 + //line php7/php7.y:2019 { yyVAL.node = yyDollar[1].node @@ -4535,7 +4581,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1967 + //line php7/php7.y:2026 { yyVAL.node = yyDollar[1].node @@ -4544,7 +4590,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1977 + //line php7/php7.y:2036 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4556,7 +4602,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1990 + //line php7/php7.y:2049 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4571,7 +4617,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2003 + //line php7/php7.y:2062 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4586,7 +4632,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2016 + //line php7/php7.y:2075 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -4601,7 +4647,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2029 + //line php7/php7.y:2088 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -4613,7 +4659,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2042 + //line php7/php7.y:2101 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -4627,13 +4673,13 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2054 + //line php7/php7.y:2113 { yyVAL.node = yyDollar[1].node } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2059 + //line php7/php7.y:2118 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -4648,25 +4694,25 @@ yydefault: } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2074 + //line php7/php7.y:2133 { yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2075 + //line php7/php7.y:2134 { yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2080 + //line php7/php7.y:2139 { yyVAL.list = yyDollar[1].list } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2082 + //line php7/php7.y:2141 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -4679,31 +4725,31 @@ yydefault: } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2096 + //line php7/php7.y:2155 { yyVAL.list = nil } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2098 + //line php7/php7.y:2157 { yyVAL.list = yyDollar[1].list } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2103 + //line php7/php7.y:2162 { yyVAL.list = []node.Node{yyDollar[1].node} } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2105 + //line php7/php7.y:2164 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2110 + //line php7/php7.y:2169 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4715,7 +4761,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2120 + //line php7/php7.y:2179 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4727,7 +4773,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2130 + //line php7/php7.y:2189 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4739,7 +4785,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2140 + //line php7/php7.y:2199 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4751,7 +4797,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2150 + //line php7/php7.y:2209 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4763,7 +4809,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2160 + //line php7/php7.y:2219 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4775,7 +4821,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2173 + //line php7/php7.y:2232 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4784,13 +4830,13 @@ yydefault: } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2180 + //line php7/php7.y:2239 { yyVAL.list = []node.Node{yyDollar[1].node} } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2185 + //line php7/php7.y:2244 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4806,7 +4852,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2199 + //line php7/php7.y:2258 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4823,7 +4869,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2217 + //line php7/php7.y:2276 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4832,13 +4878,13 @@ yydefault: } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2224 + //line php7/php7.y:2283 { yyVAL.list = []node.Node{yyDollar[1].node} } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2229 + //line php7/php7.y:2288 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4853,7 +4899,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2245 + //line php7/php7.y:2304 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4868,7 +4914,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2261 + //line php7/php7.y:2320 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4877,31 +4923,31 @@ yydefault: } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2268 + //line php7/php7.y:2327 { yyVAL.list = []node.Node{yyDollar[1].node} } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2273 + //line php7/php7.y:2332 { yyVAL.node = yyDollar[1].node } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2278 + //line php7/php7.y:2337 { yyVAL.list = nil } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2280 + //line php7/php7.y:2339 { yyVAL.list = yyDollar[1].list } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2285 + //line php7/php7.y:2344 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4910,13 +4956,13 @@ yydefault: } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2292 + //line php7/php7.y:2351 { yyVAL.list = []node.Node{yyDollar[1].node} } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:2297 + //line php7/php7.y:2356 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) @@ -4940,7 +4986,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2322 + //line php7/php7.y:2381 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -4955,7 +5001,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2335 + //line php7/php7.y:2394 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -4967,7 +5013,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2348 + //line php7/php7.y:2407 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -4984,7 +5030,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:2363 + //line php7/php7.y:2422 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5000,7 +5046,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2377 + //line php7/php7.y:2436 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5012,7 +5058,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2387 + //line php7/php7.y:2446 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5025,7 +5071,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2398 + //line php7/php7.y:2457 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5037,7 +5083,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2408 + //line php7/php7.y:2467 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5049,7 +5095,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2418 + //line php7/php7.y:2477 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5061,7 +5107,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2428 + //line php7/php7.y:2487 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5073,7 +5119,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2438 + //line php7/php7.y:2497 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5085,7 +5131,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2448 + //line php7/php7.y:2507 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5097,7 +5143,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2458 + //line php7/php7.y:2517 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5109,7 +5155,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2468 + //line php7/php7.y:2527 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5121,7 +5167,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2478 + //line php7/php7.y:2537 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5133,7 +5179,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2488 + //line php7/php7.y:2547 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5145,7 +5191,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2498 + //line php7/php7.y:2557 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5157,7 +5203,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2508 + //line php7/php7.y:2567 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5169,7 +5215,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2518 + //line php7/php7.y:2577 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5181,7 +5227,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2528 + //line php7/php7.y:2587 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5193,7 +5239,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2538 + //line php7/php7.y:2597 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5205,7 +5251,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2548 + //line php7/php7.y:2607 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5217,7 +5263,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2558 + //line php7/php7.y:2617 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5229,7 +5275,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2568 + //line php7/php7.y:2627 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5241,7 +5287,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2578 + //line php7/php7.y:2637 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5253,7 +5299,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2588 + //line php7/php7.y:2647 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5265,7 +5311,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2598 + //line php7/php7.y:2657 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5277,7 +5323,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2608 + //line php7/php7.y:2667 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5289,7 +5335,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2618 + //line php7/php7.y:2677 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5301,7 +5347,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2628 + //line php7/php7.y:2687 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5313,7 +5359,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2638 + //line php7/php7.y:2697 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5325,7 +5371,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2648 + //line php7/php7.y:2707 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5337,7 +5383,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2658 + //line php7/php7.y:2717 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5349,7 +5395,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2668 + //line php7/php7.y:2727 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5361,7 +5407,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2678 + //line php7/php7.y:2737 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5373,7 +5419,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2688 + //line php7/php7.y:2747 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5385,7 +5431,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2698 + //line php7/php7.y:2757 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5397,7 +5443,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2708 + //line php7/php7.y:2767 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5409,7 +5455,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2718 + //line php7/php7.y:2777 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5421,7 +5467,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2728 + //line php7/php7.y:2787 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5433,7 +5479,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2738 + //line php7/php7.y:2797 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -5445,7 +5491,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2748 + //line php7/php7.y:2807 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -5457,7 +5503,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2758 + //line php7/php7.y:2817 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -5469,7 +5515,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2768 + //line php7/php7.y:2827 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -5481,7 +5527,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2778 + //line php7/php7.y:2837 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5493,7 +5539,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2788 + //line php7/php7.y:2847 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5505,7 +5551,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2798 + //line php7/php7.y:2857 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -5517,7 +5563,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2808 + //line php7/php7.y:2867 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -5529,7 +5575,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2818 + //line php7/php7.y:2877 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -5541,7 +5587,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2828 + //line php7/php7.y:2887 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5553,7 +5599,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2838 + //line php7/php7.y:2897 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -5565,7 +5611,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2848 + //line php7/php7.y:2907 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5577,7 +5623,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2858 + //line php7/php7.y:2917 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -5589,7 +5635,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2868 + //line php7/php7.y:2927 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -5601,7 +5647,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2878 + //line php7/php7.y:2937 { yyVAL.node = yyDollar[2].node @@ -5611,13 +5657,13 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2886 + //line php7/php7.y:2945 { yyVAL.node = yyDollar[1].node } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:2888 + //line php7/php7.y:2947 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -5630,7 +5676,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2899 + //line php7/php7.y:2958 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -5643,7 +5689,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2910 + //line php7/php7.y:2969 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -5655,13 +5701,13 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2920 + //line php7/php7.y:2979 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2922 + //line php7/php7.y:2981 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -5673,7 +5719,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2932 + //line php7/php7.y:2991 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -5685,7 +5731,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2942 + //line php7/php7.y:3001 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -5697,7 +5743,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2952 + //line php7/php7.y:3011 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -5709,7 +5755,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2962 + //line php7/php7.y:3021 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -5721,7 +5767,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2972 + //line php7/php7.y:3031 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -5733,7 +5779,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2982 + //line php7/php7.y:3041 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -5745,7 +5791,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2992 + //line php7/php7.y:3051 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -5761,7 +5807,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3006 + //line php7/php7.y:3065 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -5773,13 +5819,13 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3016 + //line php7/php7.y:3075 { yyVAL.node = yyDollar[1].node } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3018 + //line php7/php7.y:3077 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -5792,7 +5838,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3029 + //line php7/php7.y:3088 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -5804,7 +5850,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3039 + //line php7/php7.y:3098 { yyVAL.node = expr.NewYield(nil, nil) @@ -5816,7 +5862,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3049 + //line php7/php7.y:3108 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -5828,7 +5874,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3059 + //line php7/php7.y:3118 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -5841,7 +5887,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3070 + //line php7/php7.y:3129 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -5853,7 +5899,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3080 + //line php7/php7.y:3139 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].boolWithToken.value, yyDollar[3].str) @@ -5872,7 +5918,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:3097 + //line php7/php7.y:3156 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].list, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].boolWithToken.value, yyDollar[4].str) @@ -5892,38 +5938,38 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3118 + //line php7/php7.y:3177 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3126 + //line php7/php7.y:3185 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3128 + //line php7/php7.y:3187 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3133 + //line php7/php7.y:3192 { yyVAL.list = []node.Node{} } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3135 + //line php7/php7.y:3194 { yyVAL.list = yyDollar[3].list } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3140 + //line php7/php7.y:3199 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5932,13 +5978,13 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3147 + //line php7/php7.y:3206 { yyVAL.list = []node.Node{yyDollar[1].node} } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3152 + //line php7/php7.y:3211 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -5954,7 +6000,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3166 + //line php7/php7.y:3225 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -5971,7 +6017,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3184 + //line php7/php7.y:3243 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -5980,7 +6026,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3191 + //line php7/php7.y:3250 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -5992,7 +6038,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3201 + //line php7/php7.y:3260 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6004,7 +6050,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3211 + //line php7/php7.y:3270 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6013,7 +6059,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3221 + //line php7/php7.y:3280 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6025,67 +6071,67 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3231 + //line php7/php7.y:3290 { yyVAL.node = yyDollar[1].node } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3236 + //line php7/php7.y:3295 { yyVAL.node = yyDollar[1].node } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3238 + //line php7/php7.y:3297 { yyVAL.node = yyDollar[1].node } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3243 + //line php7/php7.y:3302 { yyVAL.node = nil } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3245 + //line php7/php7.y:3304 { yyVAL.node = yyDollar[2].node } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3250 + //line php7/php7.y:3309 { yyVAL.list = []node.Node{} } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3252 + //line php7/php7.y:3311 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3254 + //line php7/php7.y:3313 { yyVAL.list = yyDollar[1].list } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3259 + //line php7/php7.y:3318 { yyVAL.node = nil } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3261 + //line php7/php7.y:3320 { yyVAL.node = yyDollar[1].node } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3266 + //line php7/php7.y:3325 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6099,7 +6145,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3278 + //line php7/php7.y:3337 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6112,7 +6158,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3289 + //line php7/php7.y:3348 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6124,7 +6170,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3302 + //line php7/php7.y:3361 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6136,7 +6182,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3312 + //line php7/php7.y:3371 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6148,7 +6194,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3322 + //line php7/php7.y:3381 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6160,7 +6206,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3332 + //line php7/php7.y:3391 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6172,7 +6218,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3342 + //line php7/php7.y:3401 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6184,7 +6230,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3352 + //line php7/php7.y:3411 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6196,7 +6242,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3362 + //line php7/php7.y:3421 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6208,7 +6254,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3372 + //line php7/php7.y:3431 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6220,7 +6266,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3382 + //line php7/php7.y:3441 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6232,7 +6278,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3392 + //line php7/php7.y:3451 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6244,7 +6290,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3402 + //line php7/php7.y:3461 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -6258,7 +6304,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3414 + //line php7/php7.y:3473 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -6270,7 +6316,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3424 + //line php7/php7.y:3483 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -6282,7 +6328,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3434 + //line php7/php7.y:3493 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -6294,19 +6340,19 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3444 + //line php7/php7.y:3503 { yyVAL.node = yyDollar[1].node } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3446 + //line php7/php7.y:3505 { yyVAL.node = yyDollar[1].node } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3451 + //line php7/php7.y:3510 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -6315,7 +6361,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3458 + //line php7/php7.y:3517 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6330,7 +6376,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3471 + //line php7/php7.y:3530 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6345,43 +6391,43 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3487 + //line php7/php7.y:3546 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3489 + //line php7/php7.y:3548 { yyVAL.node = yyDollar[1].node } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3494 + //line php7/php7.y:3553 { yyVAL.node = nil } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3496 + //line php7/php7.y:3555 { yyVAL.node = yyDollar[1].node } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3501 + //line php7/php7.y:3560 { yyVAL.node = yyDollar[1].node } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3506 + //line php7/php7.y:3565 { yyVAL.node = yyDollar[1].node } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3508 + //line php7/php7.y:3567 { yyVAL.node = yyDollar[2].node @@ -6391,19 +6437,19 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3516 + //line php7/php7.y:3575 { yyVAL.node = yyDollar[1].node } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3521 + //line php7/php7.y:3580 { yyVAL.node = yyDollar[1].node } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3523 + //line php7/php7.y:3582 { yyVAL.node = yyDollar[2].node @@ -6413,19 +6459,19 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3531 + //line php7/php7.y:3590 { yyVAL.node = yyDollar[1].node } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3536 + //line php7/php7.y:3595 { yyVAL.node = yyDollar[1].node } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3538 + //line php7/php7.y:3597 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6438,7 +6484,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3549 + //line php7/php7.y:3608 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6451,7 +6497,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3560 + //line php7/php7.y:3619 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6464,7 +6510,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3571 + //line php7/php7.y:3630 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6476,25 +6522,25 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3581 + //line php7/php7.y:3640 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3586 + //line php7/php7.y:3645 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3588 + //line php7/php7.y:3647 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3590 + //line php7/php7.y:3649 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6506,7 +6552,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3603 + //line php7/php7.y:3662 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6520,7 +6566,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3615 + //line php7/php7.y:3674 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -6534,7 +6580,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3627 + //line php7/php7.y:3686 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6546,7 +6592,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3640 + //line php7/php7.y:3699 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6558,7 +6604,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3650 + //line php7/php7.y:3709 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6570,13 +6616,13 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3663 + //line php7/php7.y:3722 { yyVAL.node = yyDollar[1].node } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3665 + //line php7/php7.y:3724 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6589,7 +6635,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3676 + //line php7/php7.y:3735 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6602,7 +6648,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3687 + //line php7/php7.y:3746 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6614,7 +6660,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3697 + //line php7/php7.y:3756 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6626,7 +6672,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3707 + //line php7/php7.y:3766 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6638,7 +6684,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3720 + //line php7/php7.y:3779 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6650,7 +6696,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3730 + //line php7/php7.y:3789 { yyVAL.node = yyDollar[2].node @@ -6660,13 +6706,13 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3738 + //line php7/php7.y:3797 { yyVAL.node = yyDollar[1].node } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3743 + //line php7/php7.y:3802 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6678,7 +6724,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3753 + //line php7/php7.y:3812 { yyVAL.node = yyDollar[2].node @@ -6688,13 +6734,13 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3761 + //line php7/php7.y:3820 { yyVAL.node = yyDollar[1].node } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3766 + //line php7/php7.y:3825 { if yyDollar[1].list[len(yyDollar[1].list)-1] == nil { yyVAL.list = yyDollar[1].list[:len(yyDollar[1].list)-1] @@ -6704,19 +6750,19 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3777 + //line php7/php7.y:3836 { yyVAL.node = nil } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3779 + //line php7/php7.y:3838 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3784 + //line php7/php7.y:3843 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6725,13 +6771,13 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3791 + //line php7/php7.y:3850 { yyVAL.list = []node.Node{yyDollar[1].node} } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3796 + //line php7/php7.y:3855 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) @@ -6743,7 +6789,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3806 + //line php7/php7.y:3865 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) @@ -6752,7 +6798,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3813 + //line php7/php7.y:3872 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) @@ -6765,7 +6811,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3824 + //line php7/php7.y:3883 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[2].node, true) @@ -6777,7 +6823,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3834 + //line php7/php7.y:3893 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -6795,7 +6841,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3850 + //line php7/php7.y:3909 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -6812,13 +6858,13 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3868 + //line php7/php7.y:3927 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3870 + //line php7/php7.y:3929 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -6831,13 +6877,13 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3881 + //line php7/php7.y:3940 { yyVAL.list = []node.Node{yyDollar[1].node} } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3883 + //line php7/php7.y:3942 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -6850,7 +6896,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3897 + //line php7/php7.y:3956 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6864,7 +6910,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3909 + //line php7/php7.y:3968 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6882,7 +6928,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3925 + //line php7/php7.y:3984 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6902,7 +6948,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3943 + //line php7/php7.y:4002 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6915,7 +6961,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3954 + //line php7/php7.y:4013 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -6931,7 +6977,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3968 + //line php7/php7.y:4027 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -6951,13 +6997,13 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3986 + //line php7/php7.y:4045 { yyVAL.node = yyDollar[2].node } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3992 + //line php7/php7.y:4051 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6969,7 +7015,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4002 + //line php7/php7.y:4061 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -6986,7 +7032,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4017 + //line php7/php7.y:4076 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -7017,7 +7063,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4046 + //line php7/php7.y:4105 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(identifier) @@ -7031,7 +7077,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:4061 + //line php7/php7.y:4120 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -7048,7 +7094,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4076 + //line php7/php7.y:4135 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -7062,7 +7108,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4088 + //line php7/php7.y:4147 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -7074,7 +7120,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4098 + //line php7/php7.y:4157 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -7086,7 +7132,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4108 + //line php7/php7.y:4167 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -7100,7 +7146,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4120 + //line php7/php7.y:4179 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -7112,7 +7158,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4130 + //line php7/php7.y:4189 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -7124,13 +7170,13 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4143 + //line php7/php7.y:4202 { yyVAL.list = []node.Node{yyDollar[1].node} } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4145 + //line php7/php7.y:4204 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -7139,7 +7185,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4155 + //line php7/php7.y:4214 { yyVAL.node = yyDollar[1].node } diff --git a/php7/php7.y b/php7/php7.y index 6e3285f..ac4f9bd 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -265,12 +265,13 @@ import ( %type class_modifier %type argument_list ctor_arguments %type trait_adaptations +%type switch_case_list %type member_modifier %type use_type %type foreach_variable -%type method_body switch_case_list +%type method_body %type encaps_list backticks_expr namespace_name catch_name_list catch_list class_const_list %type const_list echo_expr_list for_exprs non_empty_for_exprs global_var_list @@ -823,14 +824,19 @@ statement: } | T_SWITCH '(' expr ')' switch_case_list { - if ($5.endToken.Value == ";") { - $$ = stmt.NewAltSwitch($3, $5.nodes) - } else { - $$ = stmt.NewSwitch($3, $5.nodes) + switch n := $5.(type) { + case *stmt.Switch: + n.Cond = $3 + case *stmt.AltSwitch: + n.Cond = $3 + default: + panic("unexpected node type") } + $$ = $5 + // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5.endToken)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.SwitchToken) @@ -1399,10 +1405,63 @@ declare_statement: ; switch_case_list: - '{' case_list '}' { $$ = &nodesWithEndToken{$2, $3} } - | '{' ';' case_list '}' { $$ = &nodesWithEndToken{$3, $4} } - | ':' case_list T_ENDSWITCH ';' { $$ = &nodesWithEndToken{$2, $4} } - | ':' ';' case_list T_ENDSWITCH ';' { $$ = &nodesWithEndToken{$3, $5} } + '{' case_list '}' + { + caseList := stmt.NewCaseList($2) + $$ = stmt.NewSwitch(nil, caseList) + + // save position + yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(caseList, $3, comment.CloseCurlyBracesToken) + } + | '{' ';' case_list '}' + { + caseList := stmt.NewCaseList($3) + $$ = stmt.NewSwitch(nil, caseList) + + // save position + yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(caseList, $2, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken(caseList, $4, comment.CloseCurlyBracesToken) + } + | ':' case_list T_ENDSWITCH ';' + { + caseList := stmt.NewCaseList($2) + $$ = stmt.NewAltSwitch(nil, caseList) + + // save position + yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(caseList, $3, comment.EndswitchToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) + } + | ':' ';' case_list T_ENDSWITCH ';' + { + + caseList := stmt.NewCaseList($3) + $$ = stmt.NewAltSwitch(nil, caseList) + + // save position + yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition($3)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + + // save comments + yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(caseList, $2, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken(caseList, $4, comment.EndswitchToken) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.SemiColonToken) + } ; case_list: diff --git a/php7/php7_test.go b/php7/php7_test.go index fd1214e..6d7f98e 100644 --- a/php7/php7_test.go +++ b/php7/php7_test.go @@ -1381,63 +1381,71 @@ func TestPhp7(t *testing.T) { }, &stmt.AltSwitch{ Cond: &scalar.Lnumber{Value: "1"}, - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmts: []node.Node{}, - }, - &stmt.Default{ - Stmts: []node.Node{}, - }, - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, - Stmts: []node.Node{}, + CaseList: &stmt.CaseList{ + Cases: []node.Node{ + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "1"}, + Stmts: []node.Node{}, + }, + &stmt.Default{ + Stmts: []node.Node{}, + }, + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "2"}, + Stmts: []node.Node{}, + }, }, }, }, &stmt.AltSwitch{ Cond: &scalar.Lnumber{Value: "1"}, - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmts: []node.Node{}, - }, - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Switch{ - Cond: &scalar.Lnumber{Value: "1"}, - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmts: []node.Node{ - &stmt.Break{}, + CaseList: &stmt.CaseList{ + Cases: []node.Node{ + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "1"}, + Stmts: []node.Node{}, }, - }, - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, - Stmts: []node.Node{ - &stmt.Break{}, + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "2"}, + Stmts: []node.Node{}, }, }, }, }, &stmt.Switch{ Cond: &scalar.Lnumber{Value: "1"}, - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmts: []node.Node{ - &stmt.Break{}, + CaseList: &stmt.CaseList{ + Cases: []node.Node{ + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "1"}, + Stmts: []node.Node{ + &stmt.Break{}, + }, + }, + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "2"}, + Stmts: []node.Node{ + &stmt.Break{}, + }, }, }, - &stmt.Case{ - Cond: &scalar.Lnumber{Value: "2"}, - Stmts: []node.Node{ - &stmt.Break{}, + }, + }, + &stmt.Switch{ + Cond: &scalar.Lnumber{Value: "1"}, + CaseList: &stmt.CaseList{ + Cases: []node.Node{ + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "1"}, + Stmts: []node.Node{ + &stmt.Break{}, + }, + }, + &stmt.Case{ + Cond: &scalar.Lnumber{Value: "2"}, + Stmts: []node.Node{ + &stmt.Break{}, + }, }, }, }, diff --git a/printer/printer.go b/printer/printer.go index 3970430..56ae2a5 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1428,7 +1428,7 @@ func (p *Printer) printStmtAltSwitch(n node.Node) { p.Print(nn.Cond) io.WriteString(p.w, ") :\n") - s := nn.Cases + s := nn.CaseList.Cases p.printNodes(s) io.WriteString(p.w, "\n") @@ -2009,7 +2009,7 @@ func (p *Printer) printStmtSwitch(n node.Node) { io.WriteString(p.w, ")") io.WriteString(p.w, " {\n") - p.printNodes(nn.Cases) + p.printNodes(nn.CaseList.Cases) io.WriteString(p.w, "\n") p.printIndent() io.WriteString(p.w, "}") diff --git a/printer/printer_test.go b/printer/printer_test.go index 4a46f79..b763766 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -2284,17 +2284,19 @@ func TestPrintStmtAltSwitch(t *testing.T) { Stmts: []node.Node{ &stmt.AltSwitch{ Cond: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.String{Value: "'a'"}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + CaseList: &stmt.CaseList{ + Cases: []node.Node{ + &stmt.Case{ + Cond: &scalar.String{Value: "'a'"}, + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + }, }, - }, - &stmt.Case{ - Cond: &scalar.String{Value: "'b'"}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &stmt.Case{ + Cond: &scalar.String{Value: "'b'"}, + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, @@ -3649,17 +3651,19 @@ func TestPrintStmtSwitch(t *testing.T) { Stmts: []node.Node{ &stmt.Switch{ Cond: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.String{Value: "'a'"}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + CaseList: &stmt.CaseList{ + Cases: []node.Node{ + &stmt.Case{ + Cond: &scalar.String{Value: "'a'"}, + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + }, }, - }, - &stmt.Case{ - Cond: &scalar.String{Value: "'b'"}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &stmt.Case{ + Cond: &scalar.String{Value: "'b'"}, + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + }, }, }, }, From 2abe1dfb843c62d0777c9558ae26be99c8a7fa6e Mon Sep 17 00:00:00 2001 From: z7zmey Date: Wed, 2 May 2018 12:14:24 +0300 Subject: [PATCH 16/25] create Root node --- node/expr/assign/t_assign_op_test.go | 32 +++++++------- node/expr/binary/t_binary_op_test.go | 54 +++++++++++------------ node/expr/cast/t_cast_test.go | 20 ++++----- node/expr/t_array_dim_fetch_test.go | 4 +- node/expr/t_array_test.go | 6 +-- node/expr/t_bitwise_not_test.go | 2 +- node/expr/t_boolean_not_test.go | 2 +- node/expr/t_class_const_fetch_test.go | 4 +- node/expr/t_clone_test.go | 4 +- node/expr/t_closure_test.go | 8 ++-- node/expr/t_const_fetch_test.go | 6 +-- node/expr/t_empty_test.go | 2 +- node/expr/t_error_supress_test.go | 2 +- node/expr/t_eval_test.go | 2 +- node/expr/t_exit_test.go | 8 ++-- node/expr/t_function_call_test.go | 10 ++--- node/expr/t_inc_dec_test.go | 8 ++-- node/expr/t_include_test.go | 8 ++-- node/expr/t_instance_of_test.go | 6 +-- node/expr/t_isset_test.go | 4 +- node/expr/t_list_test.go | 8 ++-- node/expr/t_method_call_test.go | 2 +- node/expr/t_new_test.go | 8 ++-- node/expr/t_print_test.go | 2 +- node/expr/t_property_fetch_test.go | 2 +- node/expr/t_shell_exec_test.go | 2 +- node/expr/t_short_array_test.go | 6 +-- node/expr/t_short_list_test.go | 6 +-- node/expr/t_static_call_test.go | 10 ++--- node/expr/t_static_property_fetch_test.go | 6 +-- node/expr/t_ternary_test.go | 8 ++-- node/expr/t_unary_test.go | 4 +- node/expr/t_variable_test.go | 4 +- node/expr/t_yield_test.go | 12 ++--- node/n_root.go | 41 +++++++++++++++++ node/name/t_name_test.go | 6 +-- node/scalar/t_encapsed_test.go | 16 +++---- node/scalar/t_heredoc_test.go | 10 ++--- node/scalar/t_magic_constant_test.go | 2 +- node/scalar/t_numbers_test.go | 14 +++--- node/scalar/t_string_test.go | 10 ++--- node/stmt/t_alt_if_test.go | 8 ++-- node/stmt/t_class_const_list_test.go | 4 +- node/stmt/t_class_method_test.go | 12 ++--- node/stmt/t_class_test.go | 12 ++--- node/stmt/t_const_list_test.go | 2 +- node/stmt/t_continue_test.go | 6 +-- node/stmt/t_declare_test.go | 6 +-- node/stmt/t_do_test.go | 2 +- node/stmt/t_echo_test.go | 4 +- node/stmt/t_expression_test.go | 2 +- node/stmt/t_for_test.go | 4 +- node/stmt/t_foreach_test.go | 14 +++--- node/stmt/t_function_test.go | 10 ++--- node/stmt/t_global_test.go | 4 +- node/stmt/t_goto_label_test.go | 2 +- node/stmt/t_halt_compiler_test.go | 2 +- node/stmt/t_if_test.go | 10 ++--- node/stmt/t_inline_html_test.go | 2 +- node/stmt/t_interface_test.go | 6 +-- node/stmt/t_namespace_test.go | 6 +-- node/stmt/t_property_list_test.go | 6 +-- node/stmt/t_static_var_test.go | 6 +-- node/stmt/t_switch_case_default_test.go | 8 ++-- node/stmt/t_throw_test.go | 2 +- node/stmt/t_trait_test.go | 2 +- node/stmt/t_trait_use_test.go | 12 ++--- node/stmt/t_try_catch_finnaly_test.go | 12 ++--- node/stmt/t_unset_test.go | 6 +-- node/stmt/t_use_test.go | 28 ++++++------ node/stmt/t_while_break_test.go | 6 +-- node/t_node_test.go | 12 ++--- node/t_visitor_test.go | 9 ++++ php5/php5.go | 2 +- php5/php5.y | 2 +- php5/php5_test.go | 6 +-- php7/php7.go | 2 +- php7/php7.y | 4 +- php7/php7_test.go | 6 +-- printer/printer.go | 46 ++++++++++--------- printer/printer_test.go | 4 +- visitor/dumper_test.go | 2 +- 82 files changed, 363 insertions(+), 309 deletions(-) create mode 100644 node/n_root.go diff --git a/node/expr/assign/t_assign_op_test.go b/node/expr/assign/t_assign_op_test.go index 90e3527..207e891 100644 --- a/node/expr/assign/t_assign_op_test.go +++ b/node/expr/assign/t_assign_op_test.go @@ -32,7 +32,7 @@ func assertEqual(t *testing.T, expected interface{}, actual interface{}) { func TestReference(t *testing.T) { src := `>= $b;` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &assign.ShiftRight{ diff --git a/node/expr/binary/t_binary_op_test.go b/node/expr/binary/t_binary_op_test.go index 414af88..3f316d0 100644 --- a/node/expr/binary/t_binary_op_test.go +++ b/node/expr/binary/t_binary_op_test.go @@ -30,7 +30,7 @@ func assertEqual(t *testing.T, expected interface{}, actual interface{}) { func TestBitwiseAnd(t *testing.T) { src := `= $b;` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &binary.GreaterOrEqual{ @@ -275,7 +275,7 @@ func TestGreaterOrEqual(t *testing.T) { func TestGreater(t *testing.T) { src := ` $b;` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &binary.Greater{ @@ -300,7 +300,7 @@ func TestGreater(t *testing.T) { func TestIdentical(t *testing.T) { src := `> $b;` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &binary.ShiftRight{ @@ -625,7 +625,7 @@ func TestShiftRight(t *testing.T) { func TestSmallerOrEqual(t *testing.T) { src := ` $b;` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &binary.Spaceship{ diff --git a/node/expr/cast/t_cast_test.go b/node/expr/cast/t_cast_test.go index c8a0246..4058f6c 100644 --- a/node/expr/cast/t_cast_test.go +++ b/node/expr/cast/t_cast_test.go @@ -30,7 +30,7 @@ func assertEqual(t *testing.T, expected interface{}, actual interface{}) { func TestArray(t *testing.T) { src := `1, &$b,);` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &expr.Array{ diff --git a/node/expr/t_bitwise_not_test.go b/node/expr/t_bitwise_not_test.go index 2cf5f72..a4c6456 100644 --- a/node/expr/t_bitwise_not_test.go +++ b/node/expr/t_bitwise_not_test.go @@ -15,7 +15,7 @@ import ( func TestBitwiseNot(t *testing.T) { src := `foo();` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &expr.MethodCall{ diff --git a/node/expr/t_new_test.go b/node/expr/t_new_test.go index e286459..cba3c88 100644 --- a/node/expr/t_new_test.go +++ b/node/expr/t_new_test.go @@ -17,7 +17,7 @@ import ( func TestNew(t *testing.T) { src := `foo;` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &expr.PropertyFetch{ diff --git a/node/expr/t_shell_exec_test.go b/node/expr/t_shell_exec_test.go index 824c453..19f4ee9 100644 --- a/node/expr/t_shell_exec_test.go +++ b/node/expr/t_shell_exec_test.go @@ -17,7 +17,7 @@ import ( func TestShellExec(t *testing.T) { src := "1, &$b,];` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &expr.ShortArray{ diff --git a/node/expr/t_short_list_test.go b/node/expr/t_short_list_test.go index 98a6a8a..3a1a95e 100644 --- a/node/expr/t_short_list_test.go +++ b/node/expr/t_short_list_test.go @@ -16,7 +16,7 @@ import ( func TestShortList(t *testing.T) { src := ` $b;` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &expr.Yield{ @@ -87,7 +87,7 @@ func TestYieldKeyVal(t *testing.T) { func TestYieldExpr(t *testing.T) { src := ` 1;` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &expr.Yield{ @@ -136,7 +136,7 @@ func TestYieldKeyExpr(t *testing.T) { func TestYieldFrom(t *testing.T) { src := `bar()";` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &scalar.Encapsed{ @@ -157,7 +157,7 @@ func TestSimpleVarPropertyFetch(t *testing.T) { func TestDollarOpenCurlyBraces(t *testing.T) { src := `bar()}";` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &scalar.Encapsed{ diff --git a/node/scalar/t_heredoc_test.go b/node/scalar/t_heredoc_test.go index 754195f..10ffb61 100644 --- a/node/scalar/t_heredoc_test.go +++ b/node/scalar/t_heredoc_test.go @@ -19,7 +19,7 @@ test $var LBL; ` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &scalar.Heredoc{ @@ -51,7 +51,7 @@ test $var LBL; ` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &scalar.Heredoc{ @@ -83,7 +83,7 @@ test $var LBL; ` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &scalar.Heredoc{ @@ -112,7 +112,7 @@ func TestEmptyHeredoc(t *testing.T) { CAD; ` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &scalar.Heredoc{ @@ -139,7 +139,7 @@ func TestHeredocScalarString(t *testing.T) { CAD; ` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Expression{ Expr: &scalar.Heredoc{ diff --git a/node/scalar/t_magic_constant_test.go b/node/scalar/t_magic_constant_test.go index 9b8d2f1..0fbdfdb 100644 --- a/node/scalar/t_magic_constant_test.go +++ b/node/scalar/t_magic_constant_test.go @@ -15,7 +15,7 @@ func TestMagicConstant(t *testing.T) { // TODO: test all magic constants src := ` $v) {}` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Foreach{ Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, @@ -112,7 +112,7 @@ func TestForeachWithKey(t *testing.T) { func TestForeachExprWithKey(t *testing.T) { src := ` $v) {}` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Foreach{ Expr: &expr.ShortArray{Items: []node.Node{}}, @@ -137,7 +137,7 @@ func TestForeachExprWithKey(t *testing.T) { func TestForeachWithRef(t *testing.T) { src := ` &$v) {}` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Foreach{ ByRef: true, @@ -163,7 +163,7 @@ func TestForeachWithRef(t *testing.T) { func TestForeachWithList(t *testing.T) { src := ` list($v)) {}` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Foreach{ ByRef: false, diff --git a/node/stmt/t_function_test.go b/node/stmt/t_function_test.go index 92cf463..fb32180 100644 --- a/node/stmt/t_function_test.go +++ b/node/stmt/t_function_test.go @@ -17,7 +17,7 @@ import ( func TestSimpleFunction(t *testing.T) { src := `
` - expected := &stmt.StmtList{ + expected := &node.Root{ Stmts: []node.Node{ &stmt.Nop{}, &stmt.InlineHtml{Value: "
"}, diff --git a/node/stmt/t_interface_test.go b/node/stmt/t_interface_test.go index 78f1e8e..524178d 100644 --- a/node/stmt/t_interface_test.go +++ b/node/stmt/t_interface_test.go @@ -14,7 +14,7 @@ import ( func TestInterface(t *testing.T) { src := ` 0 { - firstStmt := n.Stmts[0] - n.Stmts = n.Stmts[1:] - - switch fs := firstStmt.(type) { - case *stmt.InlineHtml: - io.WriteString(p.w, fs.Value) - io.WriteString(p.w, " 0 { + firstStmt := v.Stmts[0] + v.Stmts = v.Stmts[1:] + + switch fs := firstStmt.(type) { + case *stmt.InlineHtml: + io.WriteString(p.w, fs.Value) + io.WriteString(p.w, "HTML"}, &stmt.Expression{ diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index cb3094c..0f79ff4 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -39,7 +39,7 @@ func ExampleDumper() { nodes.Walk(dumper) // Unordered output: - //| [*stmt.StmtList] + //| [*node.Root] //| "Position": Pos{Line: 3-11 Pos: 10-143}; //| "Stmts": //| [*stmt.Namespace] From a488f43496068c5681f5c3316f1369f2c420166c Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 3 Jun 2018 09:35:44 +0300 Subject: [PATCH 17/25] remove nodesWithEndToken type --- README.md | 10 +- node/stmt/n_class_method.go | 16 +- node/stmt/t_class_method_test.go | 25 +- node/stmt/t_visitor_test.go | 6 +- node/t_node_test.go | 8 +- parser/position_builder.go | 10 + parser/position_builder_test.go | 35 + php5/php5.go | 1286 ++++++++++++++-------------- php5/php5.y | 32 +- php5/php5_test.go | 21 +- php7/php7.go | 1053 ++++++++++++----------- php7/php7.y | 39 +- php7/php7_test.go | 25 +- printer/printer.go | 19 +- printer/printer_test.go | 28 +- visitor/dumper_test.go | 27 +- visitor/namespace_resolver_test.go | 4 +- 17 files changed, 1393 insertions(+), 1251 deletions(-) diff --git a/README.md b/README.md index 1d21f1a..d9c4a93 100644 --- a/README.md +++ b/README.md @@ -103,10 +103,12 @@ nodes := &stmt.StmtList{ &stmt.ClassMethod{ Modifiers: []node.Node{&node.Identifier{Value: "public"}}, MethodName: &node.Identifier{Value: "greet"}, - Stmts: []node.Node{ - &stmt.Echo{ - Exprs: []node.Node{ - &scalar.String{Value: "'Hello world'"}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Echo{ + Exprs: []node.Node{ + &scalar.String{Value: "'Hello world'"}, + }, }, }, }, diff --git a/node/stmt/n_class_method.go b/node/stmt/n_class_method.go index 2ae7dde..ec7d9ee 100644 --- a/node/stmt/n_class_method.go +++ b/node/stmt/n_class_method.go @@ -13,11 +13,11 @@ type ClassMethod struct { Modifiers []node.Node Params []node.Node ReturnType node.Node - Stmts []node.Node + Stmt node.Node } // NewClassMethod node constructor -func NewClassMethod(MethodName node.Node, Modifiers []node.Node, ReturnsRef bool, Params []node.Node, ReturnType node.Node, Stmts []node.Node, PhpDocComment string) *ClassMethod { +func NewClassMethod(MethodName node.Node, Modifiers []node.Node, ReturnsRef bool, Params []node.Node, ReturnType node.Node, Stmt node.Node, PhpDocComment string) *ClassMethod { return &ClassMethod{ ReturnsRef, PhpDocComment, @@ -25,7 +25,7 @@ func NewClassMethod(MethodName node.Node, Modifiers []node.Node, ReturnsRef bool Modifiers, Params, ReturnType, - Stmts, + Stmt, } } @@ -72,13 +72,9 @@ func (n *ClassMethod) Walk(v walker.Visitor) { n.ReturnType.Walk(vv) } - if n.Stmts != nil { - vv := v.GetChildrenVisitor("Stmts") - for _, nn := range n.Stmts { - if nn != nil { - nn.Walk(vv) - } - } + if n.Stmt != nil { + vv := v.GetChildrenVisitor("Stmt") + n.Stmt.Walk(vv) } v.LeaveNode(n) diff --git a/node/stmt/t_class_method_test.go b/node/stmt/t_class_method_test.go index 4ed96fa..e0766d7 100644 --- a/node/stmt/t_class_method_test.go +++ b/node/stmt/t_class_method_test.go @@ -2,9 +2,10 @@ package stmt_test import ( "bytes" - "github.com/z7zmey/php-parser/node/name" "testing" + "github.com/z7zmey/php-parser/node/name" + "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/stmt" "github.com/z7zmey/php-parser/php5" @@ -22,7 +23,9 @@ func TestSimpleClassMethod(t *testing.T) { &stmt.ClassMethod{ PhpDocComment: "", MethodName: &node.Identifier{Value: "bar"}, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, }, }, @@ -56,7 +59,9 @@ func TestPrivateProtectedClassMethod(t *testing.T) { &node.Identifier{Value: "final"}, &node.Identifier{Value: "private"}, }, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, &stmt.ClassMethod{ PhpDocComment: "", @@ -65,7 +70,9 @@ func TestPrivateProtectedClassMethod(t *testing.T) { Modifiers: []node.Node{ &node.Identifier{Value: "protected"}, }, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, }, }, @@ -99,7 +106,9 @@ func TestPhp5ClassMethod(t *testing.T) { &node.Identifier{Value: "public"}, &node.Identifier{Value: "static"}, }, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, }, }, @@ -133,7 +142,9 @@ func TestPhp7ClassMethod(t *testing.T) { &name.NamePart{Value: "void"}, }, }, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, }, }, @@ -163,6 +174,7 @@ func TestAbstractClassMethod(t *testing.T) { &node.Identifier{Value: "abstract"}, &node.Identifier{Value: "public"}, }, + Stmt: &stmt.Nop{}, }, }, }, @@ -201,6 +213,7 @@ func TestPhp7AbstractClassMethod(t *testing.T) { &name.NamePart{Value: "void"}, }, }, + Stmt: &stmt.Nop{}, }, }, }, diff --git a/node/stmt/t_visitor_test.go b/node/stmt/t_visitor_test.go index b7f1a26..06cf9a3 100644 --- a/node/stmt/t_visitor_test.go +++ b/node/stmt/t_visitor_test.go @@ -82,9 +82,9 @@ var nodesToTest = []struct { Modifiers: []node.Node{&stmt.Expression{}}, Params: []node.Node{&stmt.Expression{}}, ReturnType: &node.Identifier{}, - Stmts: []node.Node{&stmt.Expression{}}, + Stmt: &stmt.StmtList{}, }, - []string{"MethodName", "Modifiers", "Params", "ReturnType", "Stmts"}, + []string{"MethodName", "Modifiers", "Params", "ReturnType", "Stmt"}, map[string]interface{}{"ReturnsRef": true, "PhpDocComment": "/** */"}, }, { @@ -360,7 +360,7 @@ var nodesToTest = []struct { }, { &stmt.Switch{ - Cond: &expr.Variable{}, + Cond: &expr.Variable{}, CaseList: &stmt.CaseList{}, }, []string{"Cond", "CaseList"}, diff --git a/node/t_node_test.go b/node/t_node_test.go index e8cd453..656bdb3 100644 --- a/node/t_node_test.go +++ b/node/t_node_test.go @@ -289,7 +289,9 @@ func TestPhp7ParameterNode(t *testing.T) { MethodName: &node.Identifier{Value: "foo"}, Modifiers: []node.Node{&node.Identifier{Value: "public"}}, Params: expectedParams, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, }, }, @@ -357,7 +359,9 @@ func TestPhp5ParameterNode(t *testing.T) { MethodName: &node.Identifier{Value: "foo"}, Modifiers: []node.Node{&node.Identifier{Value: "public"}}, Params: expectedParams, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, }, }, diff --git a/parser/position_builder.go b/parser/position_builder.go index d1079e8..9b196b9 100644 --- a/parser/position_builder.go +++ b/parser/position_builder.go @@ -174,6 +174,16 @@ func (b *PositionBuilder) NewNodeNodeListPosition(n node.Node, list []node.Node) ) } +// NewNodeListNodePosition returns new Position +func (b *PositionBuilder) NewNodeListNodePosition(list []node.Node, n node.Node) *position.Position { + return position.NewPosition( + b.getListStartPos(list).startLine, + b.getNodeEndPos(n).endLine, + b.getListStartPos(list).startPos, + b.getNodeEndPos(n).endPos, + ) +} + // NewOptionalListTokensPosition returns new Position func (b *PositionBuilder) NewOptionalListTokensPosition(list []node.Node, t *scanner.Token, endToken *scanner.Token) *position.Position { if list == nil { diff --git a/parser/position_builder_test.go b/parser/position_builder_test.go index c794695..1ab4a85 100644 --- a/parser/position_builder_test.go +++ b/parser/position_builder_test.go @@ -259,6 +259,41 @@ func TestNewNodeNodeListPosition(t *testing.T) { } } +func TestNewNodeListNodePosition(t *testing.T) { + n1 := node.NewIdentifier("test node") + n2 := node.NewIdentifier("test node") + n3 := node.NewIdentifier("test node") + + builder := parser.PositionBuilder{ + Positions: &parser.Positions{ + n1: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 0, + EndPos: 8, + }, + n2: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 9, + EndPos: 17, + }, + n3: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 18, + EndPos: 26, + }, + }, + } + + pos := builder.NewNodeListNodePosition([]node.Node{n1, n2}, n3) + + if pos.String() != `Pos{Line: 1-3 Pos: 0-26}` { + t.Errorf("token value is not equal\n") + } +} + func TestNewOptionalListTokensPosition(t *testing.T) { builder := parser.PositionBuilder{} diff --git a/php5/php5.go b/php5/php5.go index c35b515..ad8d884 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -27,7 +27,6 @@ type yySymType struct { boolWithToken boolWithToken list []node.Node foreachVariable foreachVariable - nodesWithEndToken *nodesWithEndToken simpleIndirectReference simpleIndirectReference altSyntaxNode altSyntaxNode } @@ -344,18 +343,13 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:3922 +//line php5/php5.y:3935 type foreachVariable struct { node node.Node byRef bool } -type nodesWithEndToken struct { - nodes []node.Node - endToken *scanner.Token -} - type boolWithToken struct { value bool token *scanner.Token @@ -712,18 +706,18 @@ var yyAct = [...]int{ 531, 922, 481, 259, 283, 908, 449, 395, 256, 39, 446, 324, 521, 936, 203, 285, 260, 261, 469, 260, 261, 232, 202, 199, 136, 879, 909, 531, 260, 261, - 944, 519, 521, 335, 231, 521, 873, 829, 521, 1008, - 572, 962, 572, 970, 39, 747, 39, 812, 703, 704, - 706, 703, 704, 753, 39, 863, 39, 39, 445, 608, - 521, 589, 590, 260, 261, 572, 970, 260, 261, 956, - 982, 591, 958, 39, 684, 961, 255, 39, 39, 521, - 839, 572, 994, 964, 993, 963, 572, 995, 902, 997, - 483, 403, 895, 838, 914, 835, 916, 979, 575, 448, - 566, 1005, 39, 572, 1011, 531, 924, 1004, 926, 927, - 1012, 531, 531, 724, 572, 1015, 992, 394, 389, 919, - 39, 232, 919, 232, 164, 558, 341, 697, 538, 928, - 290, 943, 460, 161, 231, 947, 231, 157, 948, 531, - 318, 314, 127, 343, 39, 938, 528, 607, 996, 969, + 944, 519, 521, 335, 231, 521, 873, 829, 521, 747, + 572, 962, 572, 970, 39, 753, 39, 812, 703, 704, + 706, 703, 704, 863, 39, 445, 39, 39, 608, 589, + 521, 590, 591, 260, 261, 572, 970, 260, 261, 956, + 982, 684, 958, 39, 255, 961, 839, 39, 39, 521, + 994, 572, 964, 963, 993, 902, 572, 995, 483, 997, + 403, 895, 838, 835, 914, 575, 916, 979, 566, 448, + 1005, 1004, 39, 572, 1011, 531, 924, 724, 926, 927, + 1012, 531, 531, 394, 572, 1015, 992, 389, 164, 919, + 39, 232, 919, 232, 341, 558, 697, 538, 928, 290, + 460, 943, 161, 157, 231, 947, 231, 318, 948, 531, + 314, 127, 1008, 343, 39, 938, 528, 607, 996, 969, 39, 968, 945, 967, 966, 837, 836, 834, 401, 40, 568, 15, 14, 822, 972, 719, 801, 694, 11, 249, 75, 232, 76, 116, 266, 64, 89, 598, 90, 520, @@ -1638,41 +1632,41 @@ var yyPgo = [...]int{ 73, 68, 61, 1068, 1067, 1066, 35, 1065, 1063, 4, 1062, 1061, 1060, 17, 1059, 1058, 1057, 1056, 1055, 51, 5, 1054, 1053, 1051, 1049, 1048, 2, 1047, 631, 1046, - 18, 22, 1045, 1043, 39, 0, 1042, 1041, 1040, 117, - 1037, 1033, 553, 1032, 1030, 42, 8, 1029, 9, 1028, - 1027, 1026, 14, 49, 1024, 1018, 1017, 1013, 1007, 1001, - 3, 1000, 16, 998, 995, 993, 992, 991, 28, 990, - 988, 985, 983, 982, 980, 976, 21, 974, 971, 962, - 25, 961, 23, 12, 959, 40, 958, 955, 953, 945, - 41, 6, 19, 939, 13, 937, 933, 930, 15, 853, + 18, 22, 1045, 1043, 1042, 39, 0, 1041, 1040, 1037, + 117, 1033, 1032, 553, 1030, 1029, 42, 8, 1028, 9, + 1027, 1026, 1024, 14, 49, 1018, 1017, 1013, 1007, 1001, + 1000, 3, 998, 16, 995, 993, 992, 991, 990, 28, + 988, 985, 983, 982, 980, 976, 974, 21, 971, 962, + 961, 25, 959, 23, 12, 958, 40, 955, 953, 945, + 939, 41, 6, 19, 13, 937, 933, 930, 15, 853, 7, 20, } var yyR1 = [...]int{ - 0, 149, 84, 84, 85, 85, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 86, 86, - 4, 4, 4, 4, 87, 87, 5, 5, 5, 5, - 88, 88, 6, 6, 6, 6, 53, 53, 89, 89, + 0, 149, 85, 85, 86, 86, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 87, 87, + 4, 4, 4, 4, 88, 88, 5, 5, 5, 5, + 89, 89, 6, 6, 6, 6, 53, 53, 90, 90, 24, 24, 24, 24, 24, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 107, 107, 58, 58, 108, - 108, 109, 109, 59, 105, 105, 56, 51, 52, 144, + 26, 26, 26, 26, 26, 108, 108, 58, 58, 109, + 109, 110, 110, 59, 106, 106, 56, 51, 52, 144, 144, 145, 145, 60, 61, 61, 64, 64, 64, 64, - 65, 65, 2, 117, 117, 113, 113, 118, 118, 142, - 142, 141, 141, 141, 147, 147, 148, 148, 57, 57, - 106, 106, 83, 83, 83, 83, 103, 103, 103, 150, - 150, 146, 146, 99, 99, 100, 100, 54, 54, 55, - 55, 110, 110, 111, 111, 63, 63, 62, 62, 62, - 62, 81, 81, 81, 119, 119, 69, 69, 69, 69, - 90, 90, 27, 27, 27, 91, 91, 91, 91, 112, - 112, 66, 66, 66, 66, 68, 120, 120, 82, 82, - 121, 121, 122, 122, 70, 70, 71, 123, 123, 74, - 74, 73, 72, 72, 75, 75, 143, 143, 114, 114, - 115, 115, 124, 124, 76, 76, 76, 76, 76, 76, - 116, 116, 116, 116, 67, 67, 104, 104, 102, 102, - 101, 101, 130, 130, 128, 128, 129, 129, 129, 131, - 131, 42, 15, 15, 15, 15, 15, 15, 15, 15, + 65, 65, 2, 118, 118, 114, 114, 119, 119, 143, + 143, 142, 142, 142, 147, 147, 148, 148, 57, 57, + 107, 107, 83, 83, 83, 83, 104, 104, 104, 150, + 150, 146, 146, 100, 100, 101, 101, 54, 54, 55, + 55, 111, 111, 112, 112, 63, 63, 62, 62, 62, + 62, 81, 81, 81, 120, 120, 69, 69, 69, 69, + 91, 91, 27, 27, 27, 92, 92, 92, 92, 113, + 113, 66, 66, 66, 66, 68, 121, 121, 82, 82, + 122, 122, 123, 123, 70, 70, 71, 124, 124, 74, + 74, 73, 72, 72, 75, 75, 84, 84, 115, 115, + 116, 116, 125, 125, 76, 76, 76, 76, 76, 76, + 117, 117, 117, 117, 67, 67, 105, 105, 103, 103, + 102, 102, 131, 131, 129, 129, 130, 130, 130, 132, + 132, 42, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, @@ -1680,27 +1674,27 @@ var yyR1 = [...]int{ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 50, 50, 50, 50, - 47, 47, 47, 47, 46, 46, 1, 98, 98, 97, - 97, 97, 97, 23, 23, 23, 23, 23, 23, 23, + 47, 47, 47, 47, 46, 46, 1, 99, 99, 98, + 98, 98, 98, 23, 23, 23, 23, 23, 23, 23, 23, 11, 11, 11, 11, 45, 45, 45, 43, 43, - 41, 41, 138, 138, 137, 49, 49, 49, 125, 125, - 125, 80, 80, 7, 7, 7, 7, 7, 7, 7, + 41, 41, 139, 139, 138, 49, 49, 49, 126, 126, + 126, 80, 80, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 28, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 35, 35, 35, 35, 29, 29, 29, 29, 29, 29, - 29, 126, 126, 151, 151, 127, 127, 127, 127, 14, - 14, 48, 48, 16, 17, 18, 19, 19, 139, 139, - 132, 134, 134, 77, 133, 133, 133, 40, 40, 44, + 29, 127, 127, 151, 151, 128, 128, 128, 128, 14, + 14, 48, 48, 16, 17, 18, 19, 19, 140, 140, + 133, 135, 135, 77, 134, 134, 134, 40, 40, 44, 44, 12, 22, 22, 20, 20, 20, 21, 21, 21, - 10, 10, 10, 9, 9, 13, 13, 135, 135, 136, - 136, 136, 39, 39, 140, 140, 96, 96, 38, 38, - 38, 95, 95, 94, 94, 94, 94, 94, 94, 94, - 94, 92, 92, 92, 92, 33, 33, 33, 33, 33, + 10, 10, 10, 9, 9, 13, 13, 136, 136, 137, + 137, 137, 39, 39, 141, 141, 97, 97, 38, 38, + 38, 96, 96, 95, 95, 95, 95, 95, 95, 95, + 95, 93, 93, 93, 93, 33, 33, 33, 33, 33, 33, 34, 34, 34, 37, 37, 37, 37, 37, 37, - 37, 37, 93, 93, 36, 36, 30, 30, 31, 32, + 37, 37, 94, 94, 36, 36, 30, 30, 31, 32, } var yyR2 = [...]int{ @@ -1759,7 +1753,7 @@ var yyR2 = [...]int{ } var yyChk = [...]int{ - -1000, -149, -84, -3, 2, -25, -51, -52, 51, 79, + -1000, -149, -85, -3, 2, -25, -51, -52, 51, 79, 44, -53, -26, 10, -60, -61, 38, 142, 7, 21, 20, 23, 30, 34, 35, 39, -50, 46, 98, 19, 14, -14, 48, 25, 27, 144, 40, 43, 36, -1, @@ -1769,99 +1763,99 @@ var yyChk = [...]int{ 112, 113, 6, 156, -29, -47, -46, 141, 96, -20, 91, 49, 50, 4, 5, 84, 85, 86, 11, -35, -32, -7, 140, 74, 62, 18, 60, 148, -21, -22, - -23, -30, -85, 82, -11, 8, 9, 66, 67, 81, - 63, 64, 65, 80, -10, -140, -44, -12, -40, -9, - 157, 12, 146, -85, 142, 82, 10, -86, 37, 38, - -4, -85, 82, 144, 158, 145, 10, -89, -48, 146, + -23, -30, -86, 82, -11, 8, 9, 66, 67, 81, + 63, 64, 65, 80, -10, -141, -44, -12, -40, -9, + 157, 12, 146, -86, 142, 82, 10, -87, 37, 38, + -4, -86, 82, 144, 158, 145, 10, -90, -48, 146, -48, -25, -1, 79, 146, -48, 144, -14, 97, 98, - 144, -14, 144, -15, -19, -14, 144, -90, -27, 12, - 157, -91, -1, 12, -104, -14, 144, 129, 130, 87, + 144, -14, 144, -15, -19, -14, 144, -91, -27, 12, + 157, -92, -1, 12, -105, -14, 144, 129, 130, 87, 89, 88, 159, 151, 161, 167, 153, 152, 162, 131, 163, 164, 132, 133, 134, 135, 136, 137, 165, 138, 166, 139, 90, 150, 146, 146, 146, 142, -14, 10, -144, 151, 10, 10, -15, -19, -14, 52, 52, 160, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 146, -14, 104, 105, -18, -19, -85, 79, + 127, 128, 146, -14, 104, 105, -18, -19, -86, 79, 82, -11, -12, 98, -18, -14, -14, -14, -14, -42, -14, -50, -14, -14, -14, -14, -14, -14, -14, -49, - 146, -48, -14, 148, 148, -125, 17, -92, -33, 12, - 76, 77, -14, 57, -43, -11, -41, -85, 79, 82, - -21, -10, -140, -12, 146, 146, -14, -14, 146, -14, - -14, 148, -92, 17, 17, 75, -92, 148, 146, -95, - -94, -14, 151, 148, 148, 82, -81, 146, -85, 78, + 146, -48, -14, 148, 148, -126, 17, -93, -33, 12, + 76, 77, -14, 57, -43, -11, -41, -86, 79, 82, + -21, -10, -141, -12, 146, 146, -14, -14, 146, -14, + -14, 148, -93, 17, 17, 75, -93, 148, 146, -96, + -95, -14, 151, 148, 148, 82, -81, 146, -86, 78, 148, 142, -10, 157, 78, -81, 142, 147, 144, 142, - -84, -85, 144, 158, -87, -5, -85, 82, -88, -6, - -85, 82, 29, -85, 10, 160, -24, 143, 2, -25, + -85, -86, 144, 158, -88, -5, -86, 82, -89, -6, + -86, 82, 29, -86, 10, 160, -24, 143, 2, -25, -51, -52, 51, -25, 145, -146, -25, 145, 21, -144, - -102, -101, -14, -83, 142, 145, 144, 144, 144, 144, + -103, -102, -14, -83, 142, 145, 144, 144, 144, 144, 144, 158, -16, 142, -19, 144, 158, -144, 160, 144, 158, -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, -43, -14, 145, -105, - -56, -19, -19, -15, -106, 10, -89, 144, 144, 10, - 146, -65, 55, -117, 55, 58, -14, 151, -14, -14, + -14, -14, -14, -14, -14, -14, -43, -14, 145, -106, + -56, -19, -19, -15, -107, 10, -90, 144, 144, 10, + 146, -65, 55, -118, 55, 58, -14, 151, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -96, -38, -19, 59, 82, -85, 78, 78, 147, 147, + -97, -38, -19, 59, 82, -86, 78, 78, 147, 147, 147, 147, -13, -14, -13, 141, -33, -33, 17, 148, - 57, -14, 11, -19, -135, -136, -40, -39, -10, -140, - 10, 142, -80, -81, 78, 82, -85, 57, -10, 78, - -93, -36, -19, -15, -19, -15, -14, -13, 140, 75, - 75, -13, -95, 149, -151, 158, 58, -17, -19, -13, - -13, 10, 147, -119, -50, -69, -15, -19, 151, 83, + 57, -14, 11, -19, -136, -137, -40, -39, -10, -141, + 10, 142, -80, -81, 78, 82, -86, 57, -10, 78, + -94, -36, -19, -15, -19, -15, -14, -13, 140, 75, + 75, -13, -96, 149, -151, 158, 58, -17, -19, -13, + -13, 10, 147, -120, -50, -69, -15, -19, 151, 83, -81, -39, -40, 10, 52, -13, -14, -39, -40, 10, - -14, 144, -84, 143, -81, -4, 144, 158, 29, -85, - 144, 158, 29, -85, 10, 29, 160, -28, -78, -7, - -31, -85, 79, 82, 60, 148, -8, 62, -79, 18, - 74, -11, 154, 155, 153, 152, 146, 146, -99, -89, - -89, -48, 144, 158, -103, 144, -103, 144, -27, -14, + -14, 144, -85, 143, -81, -4, 144, 158, 29, -86, + 144, 158, 29, -86, 10, 29, 160, -28, -78, -7, + -31, -86, 79, 82, 60, 148, -8, 62, -79, 18, + 74, -11, 154, 155, 153, 152, 146, 146, -100, -90, + -90, -48, 144, 158, -104, 144, -104, 144, -27, -14, 12, 146, -28, -14, 145, -14, 147, 158, 29, 29, - 147, 158, 160, 143, 146, -110, -111, -63, -62, 60, - 61, -45, -85, 79, 82, -113, 56, -45, 142, -118, - -45, -15, -19, -19, 91, 147, 158, 146, -85, -131, - -129, -128, -130, 148, -132, 57, 149, 149, -34, 10, - 13, 12, 10, 143, 148, 143, -133, -77, -134, -81, - 148, 142, -10, -14, -40, -85, -135, -40, 147, 158, + 147, 158, 160, 143, 146, -111, -112, -63, -62, 60, + 61, -45, -86, 79, 82, -114, 56, -45, 142, -119, + -45, -15, -19, -19, 91, 147, 158, 146, -86, -132, + -130, -129, -131, 148, -133, 57, 149, 149, -34, 10, + 13, 12, 10, 143, 148, 143, -134, -77, -135, -81, + 148, 142, -10, -14, -40, -86, -136, -40, 147, 158, 147, 147, 147, 149, 149, 147, -14, 151, -14, 151, 149, 149, 147, 158, 147, -17, -14, -81, -81, 149, 143, -81, -81, 143, 143, -5, 10, 29, -6, 10, 29, 10, -28, 148, 153, 152, 162, 131, 163, 164, 159, 151, 161, 132, 133, 167, 88, 89, 87, 130, 129, 134, 135, 136, 137, 165, 166, 138, 139, 150, - 82, -85, 146, -126, -127, -78, 17, 78, -78, -78, - -78, -78, -78, 147, -54, 93, 94, -100, 22, 144, - -102, -14, 143, 32, 33, -103, 31, -103, 143, 160, - -110, -14, 144, -56, -141, -19, 151, 59, -141, -57, - -25, 145, 10, -28, -107, 41, -110, 147, 158, -144, - 82, -85, 142, -118, -112, 158, -43, 160, -38, -96, - 148, -130, -132, -13, -135, 149, -14, -139, 148, 148, - -13, -14, 143, -138, -36, 58, -17, -17, -69, 10, + 82, -86, 146, -127, -128, -78, 17, 78, -78, -78, + -78, -78, -78, 147, -54, 93, 94, -101, 22, 144, + -103, -14, 143, 32, 33, -104, 31, -104, 143, 160, + -111, -14, 144, -56, -142, -19, 151, 59, -142, -57, + -25, 145, 10, -28, -108, 41, -111, 147, 158, -144, + 82, -86, 142, -119, -113, 158, -43, 160, -38, -97, + 148, -131, -133, -13, -136, 149, -14, -140, 148, 148, + -13, -14, 143, -139, -36, 58, -17, -17, -69, 10, 10, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, 145, -78, -85, - -126, 149, -151, 158, 58, 10, 52, 147, 144, -48, + -78, -78, -78, -78, -78, -78, -78, 145, -78, -86, + -127, 149, -151, 158, 58, 10, 52, 147, 144, -48, -25, -55, 93, 94, 144, 144, -14, -150, 145, 144, - 143, 144, 31, -28, 147, -142, 58, -19, 146, -142, - -89, 160, -58, 42, 146, 147, -98, 44, -63, -145, - 83, -85, -112, 143, -66, -114, -67, -68, -115, -124, + 143, 144, 31, -28, 147, -143, 58, -19, 146, -143, + -90, 160, -58, 42, 146, 147, -99, 44, -63, -145, + 83, -86, -113, 143, -66, -115, -67, -68, -116, -125, 47, 38, 44, -76, 103, 102, 101, 98, 99, 100, - -45, -80, -14, 147, -13, 149, -133, 149, -132, -13, - -13, 149, 143, -137, 57, -14, 151, 149, -78, 145, - 147, -78, -78, -25, 95, -48, 145, -102, -150, -89, - 144, -98, 147, -141, -96, 147, 28, -28, 142, -45, - 142, 142, 146, 12, 143, -116, 12, 144, 158, -1, - -76, 10, -120, -45, 149, 143, 149, 149, -135, -17, - -78, 58, 144, 145, -89, 147, -89, 142, -148, -25, - 145, 147, -148, 144, -89, 12, -89, -89, -97, 12, + -45, -80, -14, 147, -13, 149, -134, 149, -133, -13, + -13, 149, 143, -138, 57, -14, 151, 149, -78, 145, + 147, -78, -78, -25, 95, -48, 145, -103, -150, -90, + 144, -99, 147, -142, -97, 147, 28, -28, 142, -45, + 142, 142, 146, 12, 143, -117, 12, 144, 158, -1, + -76, 10, -121, -45, 149, 143, 149, 149, -136, -17, + -78, 58, 144, 145, -90, 147, -90, 142, -148, -25, + 145, 147, -148, 144, -90, 12, -90, -90, -98, 12, 151, 160, 144, 158, 160, 10, -144, 160, -82, 158, - 144, 142, -78, -89, -147, -25, 145, -89, -89, 143, + 144, 142, -78, -90, -147, -25, 145, -90, -90, 143, 147, 143, 143, 147, 158, 12, -28, 12, -28, 160, - 10, -28, -45, -121, -122, -70, -71, -72, -73, -74, - -45, 10, -89, 143, 26, 142, 12, 151, 160, -28, + 10, -28, -45, -122, -123, -70, -71, -72, -73, -74, + -45, 10, -90, 143, 26, 142, 12, 151, 160, -28, 146, 143, -70, 144, 144, 45, 29, 78, 24, 144, - -89, 12, -28, -110, -123, -45, -75, -76, 10, 144, - 143, 147, 158, 10, -108, -109, -59, 41, -143, 144, - 142, -45, -59, 146, -89, -45, 143, 12, 147, 142, - -89, 143, + -90, 12, -28, -111, -124, -45, -75, -76, 10, 144, + 143, 147, 158, 10, -109, -110, -59, 41, -84, 144, + 142, -45, -59, 146, -90, -45, 143, 12, 147, 142, + -90, 143, } var yyDef = [...]int{ @@ -2345,14 +2339,14 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:272 + //line php5/php5.y:271 { yylex.(*Parser).rootNode = node.NewRoot(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) } case 2: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:280 + //line php5/php5.y:279 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2360,13 +2354,13 @@ yydefault: } case 3: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:285 + //line php5/php5.y:284 { yyVAL.list = []node.Node{} } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:290 + //line php5/php5.y:289 { namePart := name.NewNamePart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2375,7 +2369,7 @@ yydefault: } case 5: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:297 + //line php5/php5.y:296 { namePart := name.NewNamePart(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2384,32 +2378,32 @@ yydefault: } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:307 + //line php5/php5.y:306 { // error yyVAL.node = nil } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:312 + //line php5/php5.y:311 { yyVAL.node = yyDollar[1].node } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:314 + //line php5/php5.y:313 { yyVAL.node = yyDollar[1].node } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:316 + //line php5/php5.y:315 { yyVAL.node = yyDollar[1].node } case 10: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:318 + //line php5/php5.y:317 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2417,7 +2411,7 @@ yydefault: } case 11: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:324 + //line php5/php5.y:323 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2429,7 +2423,7 @@ yydefault: } case 12: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:334 + //line php5/php5.y:333 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2441,7 +2435,7 @@ yydefault: } case 13: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:344 + //line php5/php5.y:343 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2449,7 +2443,7 @@ yydefault: } case 14: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:350 + //line php5/php5.y:349 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2457,7 +2451,7 @@ yydefault: } case 15: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:356 + //line php5/php5.y:355 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2469,7 +2463,7 @@ yydefault: } case 16: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:366 + //line php5/php5.y:365 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2481,25 +2475,25 @@ yydefault: } case 17: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:376 + //line php5/php5.y:375 { yyVAL.node = yyDollar[1].node } case 18: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:381 + //line php5/php5.y:380 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:383 + //line php5/php5.y:382 { yyVAL.list = []node.Node{yyDollar[1].node} } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:388 + //line php5/php5.y:387 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2511,7 +2505,7 @@ yydefault: } case 21: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:398 + //line php5/php5.y:397 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2526,7 +2520,7 @@ yydefault: } case 22: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:411 + //line php5/php5.y:410 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2538,7 +2532,7 @@ yydefault: } case 23: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:421 + //line php5/php5.y:420 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2553,19 +2547,19 @@ yydefault: } case 24: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:437 + //line php5/php5.y:436 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:439 + //line php5/php5.y:438 { yyVAL.list = []node.Node{yyDollar[1].node} } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:444 + //line php5/php5.y:443 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2577,7 +2571,7 @@ yydefault: } case 27: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:454 + //line php5/php5.y:453 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2592,7 +2586,7 @@ yydefault: } case 28: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:467 + //line php5/php5.y:466 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2604,7 +2598,7 @@ yydefault: } case 29: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:477 + //line php5/php5.y:476 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2619,19 +2613,19 @@ yydefault: } case 30: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:493 + //line php5/php5.y:492 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:495 + //line php5/php5.y:494 { yyVAL.list = []node.Node{yyDollar[1].node} } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:500 + //line php5/php5.y:499 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2643,7 +2637,7 @@ yydefault: } case 33: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:510 + //line php5/php5.y:509 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2658,7 +2652,7 @@ yydefault: } case 34: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:523 + //line php5/php5.y:522 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2670,7 +2664,7 @@ yydefault: } case 35: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:533 + //line php5/php5.y:532 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2685,7 +2679,7 @@ yydefault: } case 36: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:549 + //line php5/php5.y:548 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2703,7 +2697,7 @@ yydefault: } case 37: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:565 + //line php5/php5.y:564 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2721,7 +2715,7 @@ yydefault: } case 38: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:584 + //line php5/php5.y:583 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2729,38 +2723,38 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:590 + //line php5/php5.y:589 { yyVAL.list = []node.Node{} } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:596 + //line php5/php5.y:595 { // error yyVAL.node = nil } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:601 + //line php5/php5.y:600 { yyVAL.node = yyDollar[1].node } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:603 + //line php5/php5.y:602 { yyVAL.node = yyDollar[1].node } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:605 + //line php5/php5.y:604 { yyVAL.node = yyDollar[1].node } case 44: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:607 + //line php5/php5.y:606 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2768,13 +2762,13 @@ yydefault: } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:617 + //line php5/php5.y:616 { yyVAL.node = yyDollar[1].node } case 46: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:619 + //line php5/php5.y:618 { label := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2786,7 +2780,7 @@ yydefault: } case 47: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:632 + //line php5/php5.y:631 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2794,7 +2788,7 @@ yydefault: } case 48: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:638 + //line php5/php5.y:637 { yyVAL.node = stmt.NewIf(yyDollar[2].node, yyDollar[3].node, yyDollar[4].list, yyDollar[5].node) @@ -2810,7 +2804,7 @@ yydefault: } case 49: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:652 + //line php5/php5.y:651 { stmts := stmt.NewStmtList(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) @@ -2821,7 +2815,7 @@ yydefault: } case 50: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:661 + //line php5/php5.y:660 { if yyDollar[3].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltWhile(yyDollar[2].node, yyDollar[3].altSyntaxNode.node) @@ -2833,7 +2827,7 @@ yydefault: } case 51: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:671 + //line php5/php5.y:670 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2841,7 +2835,7 @@ yydefault: } case 52: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:677 + //line php5/php5.y:676 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltFor(yyDollar[3].list, yyDollar[5].list, yyDollar[7].list, yyDollar[9].altSyntaxNode.node) @@ -2853,7 +2847,7 @@ yydefault: } case 53: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:687 + //line php5/php5.y:686 { switch n := yyDollar[3].node.(type) { case *stmt.Switch: @@ -2871,7 +2865,7 @@ yydefault: } case 54: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:703 + //line php5/php5.y:702 { yyVAL.node = stmt.NewBreak(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2879,7 +2873,7 @@ yydefault: } case 55: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:709 + //line php5/php5.y:708 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2887,7 +2881,7 @@ yydefault: } case 56: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:715 + //line php5/php5.y:714 { yyVAL.node = stmt.NewContinue(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2895,7 +2889,7 @@ yydefault: } case 57: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:721 + //line php5/php5.y:720 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2903,7 +2897,7 @@ yydefault: } case 58: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:727 + //line php5/php5.y:726 { yyVAL.node = stmt.NewReturn(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2911,7 +2905,7 @@ yydefault: } case 59: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:733 + //line php5/php5.y:732 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2919,7 +2913,7 @@ yydefault: } case 60: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:739 + //line php5/php5.y:738 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2927,7 +2921,7 @@ yydefault: } case 61: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:745 + //line php5/php5.y:744 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2935,7 +2929,7 @@ yydefault: } case 62: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:751 + //line php5/php5.y:750 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2943,7 +2937,7 @@ yydefault: } case 63: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:757 + //line php5/php5.y:756 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2951,7 +2945,7 @@ yydefault: } case 64: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:763 + //line php5/php5.y:762 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2959,7 +2953,7 @@ yydefault: } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:769 + //line php5/php5.y:768 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2967,7 +2961,7 @@ yydefault: } case 66: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:775 + //line php5/php5.y:774 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2975,7 +2969,7 @@ yydefault: } case 67: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:781 + //line php5/php5.y:780 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2983,7 +2977,7 @@ yydefault: } case 68: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:787 + //line php5/php5.y:786 { if yyDollar[6].foreachVariable.node == nil { if yyDollar[8].altSyntaxNode.isAlt { @@ -3003,7 +2997,7 @@ yydefault: } case 69: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:805 + //line php5/php5.y:804 { if yyDollar[6].foreachVariable.node == nil { if yyDollar[8].altSyntaxNode.isAlt { @@ -3023,7 +3017,7 @@ yydefault: } case 70: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:823 + //line php5/php5.y:822 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) @@ -3031,7 +3025,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:829 + //line php5/php5.y:828 { yyVAL.node = stmt.NewNop() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3039,7 +3033,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:835 + //line php5/php5.y:834 { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3053,7 +3047,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:847 + //line php5/php5.y:846 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -3061,7 +3055,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:853 + //line php5/php5.y:852 { label := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3073,13 +3067,13 @@ yydefault: } case 75: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:866 + //line php5/php5.y:865 { yyVAL.list = []node.Node{} } case 76: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:868 + //line php5/php5.y:867 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3097,13 +3091,13 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:886 + //line php5/php5.y:885 { yyVAL.node = nil } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:888 + //line php5/php5.y:887 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3111,31 +3105,31 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:897 + //line php5/php5.y:896 { yyVAL.list = yyDollar[1].list } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:899 + //line php5/php5.y:898 { yyVAL.list = []node.Node{} } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:904 + //line php5/php5.y:903 { yyVAL.list = []node.Node{yyDollar[1].node} } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:906 + //line php5/php5.y:905 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:911 + //line php5/php5.y:910 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3151,61 +3145,61 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:928 + //line php5/php5.y:927 { yyVAL.list = []node.Node{yyDollar[1].node} } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:930 + //line php5/php5.y:929 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:935 + //line php5/php5.y:934 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:940 + //line php5/php5.y:939 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:945 + //line php5/php5.y:944 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:950 + //line php5/php5.y:949 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:952 + //line php5/php5.y:951 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:957 + //line php5/php5.y:956 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:959 + //line php5/php5.y:958 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:964 + //line php5/php5.y:963 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3217,7 +3211,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:977 + //line php5/php5.y:976 { switch n := yyDollar[1].node.(type) { case *stmt.Class: @@ -3240,7 +3234,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:998 + //line php5/php5.y:997 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3252,7 +3246,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1012 + //line php5/php5.y:1011 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3260,7 +3254,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1018 + //line php5/php5.y:1017 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3272,7 +3266,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1028 + //line php5/php5.y:1027 { yyVAL.node = stmt.NewTrait(nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3280,7 +3274,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1034 + //line php5/php5.y:1033 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3292,85 +3286,85 @@ yydefault: } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1047 + //line php5/php5.y:1046 { yyVAL.node = nil } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1049 + //line php5/php5.y:1048 { yyVAL.node = yyDollar[2].node } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1054 + //line php5/php5.y:1053 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1059 + //line php5/php5.y:1058 { yyVAL.list = nil } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1061 + //line php5/php5.y:1060 { yyVAL.list = yyDollar[2].list } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1066 + //line php5/php5.y:1065 { yyVAL.list = nil } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1068 + //line php5/php5.y:1067 { yyVAL.list = yyDollar[2].list } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1073 + //line php5/php5.y:1072 { yyVAL.list = []node.Node{yyDollar[1].node} } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1075 + //line php5/php5.y:1074 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1080 + //line php5/php5.y:1079 { yyVAL.foreachVariable = foreachVariable{nil, false} } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1082 + //line php5/php5.y:1081 { yyVAL.foreachVariable = yyDollar[2].foreachVariable } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1087 + //line php5/php5.y:1086 { yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1089 + //line php5/php5.y:1088 { yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1091 + //line php5/php5.y:1090 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3379,39 +3373,39 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1101 + //line php5/php5.y:1100 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1103 + //line php5/php5.y:1102 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1112 + //line php5/php5.y:1111 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1114 + //line php5/php5.y:1113 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1123 + //line php5/php5.y:1122 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1125 + //line php5/php5.y:1124 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3419,7 +3413,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1135 + //line php5/php5.y:1134 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3433,7 +3427,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1147 + //line php5/php5.y:1146 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3447,7 +3441,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1163 + //line php5/php5.y:1162 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3457,7 +3451,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1171 + //line php5/php5.y:1170 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3467,7 +3461,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1179 + //line php5/php5.y:1178 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -3477,7 +3471,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1187 + //line php5/php5.y:1186 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -3488,13 +3482,13 @@ yydefault: } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1200 + //line php5/php5.y:1199 { yyVAL.list = []node.Node{} } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1202 + //line php5/php5.y:1201 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) @@ -3503,7 +3497,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1209 + //line php5/php5.y:1208 { _default := stmt.NewDefault(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) @@ -3512,26 +3506,26 @@ yydefault: } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1226 + //line php5/php5.y:1225 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1228 + //line php5/php5.y:1227 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1238 + //line php5/php5.y:1237 { yyVAL.list = nil } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1240 + //line php5/php5.y:1239 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) @@ -3541,13 +3535,13 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1252 + //line php5/php5.y:1251 { yyVAL.list = nil } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1254 + //line php5/php5.y:1253 { stmts := stmt.NewStmtList(yyDollar[5].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[5].list)) @@ -3560,13 +3554,13 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1269 + //line php5/php5.y:1268 { yyVAL.node = nil } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1271 + //line php5/php5.y:1270 { yyVAL.node = stmt.NewElse(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3574,13 +3568,13 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1281 + //line php5/php5.y:1280 { yyVAL.node = nil } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1283 + //line php5/php5.y:1282 { stmts := stmt.NewStmtList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) @@ -3591,31 +3585,31 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1296 + //line php5/php5.y:1295 { yyVAL.list = yyDollar[1].list } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1298 + //line php5/php5.y:1297 { yyVAL.list = nil } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1303 + //line php5/php5.y:1302 { yyVAL.list = []node.Node{yyDollar[1].node} } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1305 + //line php5/php5.y:1304 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1310 + //line php5/php5.y:1309 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3643,7 +3637,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1336 + //line php5/php5.y:1335 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3671,13 +3665,13 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1366 + //line php5/php5.y:1365 { yyVAL.node = nil } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1368 + //line php5/php5.y:1367 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3685,7 +3679,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1374 + //line php5/php5.y:1373 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3693,13 +3687,13 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1380 + //line php5/php5.y:1379 { yyVAL.node = yyDollar[1].node } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1386 + //line php5/php5.y:1385 { yyVAL.node = node.NewArgumentList(nil) @@ -3708,7 +3702,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1393 + //line php5/php5.y:1392 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -3717,7 +3711,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1400 + //line php5/php5.y:1399 { arg := node.NewArgument(yyDollar[2].node, false, false) yyVAL.node = node.NewArgumentList([]node.Node{arg}) @@ -3728,19 +3722,19 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1413 + //line php5/php5.y:1412 { yyVAL.list = []node.Node{yyDollar[1].node} } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1415 + //line php5/php5.y:1414 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1420 + //line php5/php5.y:1419 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3748,7 +3742,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1426 + //line php5/php5.y:1425 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3756,7 +3750,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1432 + //line php5/php5.y:1431 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -3764,7 +3758,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1438 + //line php5/php5.y:1437 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3772,19 +3766,19 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1447 + //line php5/php5.y:1446 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1449 + //line php5/php5.y:1448 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1455 + //line php5/php5.y:1454 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3796,7 +3790,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1465 + //line php5/php5.y:1464 { yyVAL.node = expr.NewVariable(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3804,7 +3798,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1471 + //line php5/php5.y:1470 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3812,7 +3806,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1481 + //line php5/php5.y:1480 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3831,7 +3825,7 @@ yydefault: } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1498 + //line php5/php5.y:1497 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3850,7 +3844,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1515 + //line php5/php5.y:1514 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3869,7 +3863,7 @@ yydefault: } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1532 + //line php5/php5.y:1531 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3888,19 +3882,19 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1554 + //line php5/php5.y:1553 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1556 + //line php5/php5.y:1555 { yyVAL.list = []node.Node{} } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1562 + //line php5/php5.y:1561 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) @@ -3908,31 +3902,37 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1568 + //line php5/php5.y:1567 { yyVAL.node = yyDollar[1].node } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1570 + //line php5/php5.y:1569 { yyVAL.node = yyDollar[1].node } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1572 + //line php5/php5.y:1571 { name := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yylex.(*Parser).comments.AddComments(name, yyDollar[4].token.Comments()) - yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].boolWithToken.value, yyDollar[6].list, nil, yyDollar[8].nodesWithEndToken.nodes, "") - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[8].nodesWithEndToken.endToken)) + yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].boolWithToken.value, yyDollar[6].list, nil, yyDollar[8].node, "") + + if yyDollar[1].list == nil { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[8].node)) + } else { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListNodePosition(yyDollar[1].list, yyDollar[8].node)) + } + yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1585 + //line php5/php5.y:1590 { var adaptationList *stmt.TraitAdaptationList switch n := yyDollar[3].node.(type) { @@ -3948,19 +3948,19 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1602 + //line php5/php5.y:1607 { yyVAL.list = []node.Node{yyDollar[1].node} } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1604 + //line php5/php5.y:1609 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1609 + //line php5/php5.y:1614 { yyVAL.node = stmt.NewNop() @@ -3968,7 +3968,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1615 + //line php5/php5.y:1620 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -3976,43 +3976,43 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1624 + //line php5/php5.y:1629 { yyVAL.list = nil } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1626 + //line php5/php5.y:1631 { yyVAL.list = yyDollar[1].list } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1631 + //line php5/php5.y:1636 { yyVAL.list = []node.Node{yyDollar[1].node} } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1633 + //line php5/php5.y:1638 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1638 + //line php5/php5.y:1643 { yyVAL.node = yyDollar[1].node } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1640 + //line php5/php5.y:1645 { yyVAL.node = yyDollar[1].node } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1645 + //line php5/php5.y:1650 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) @@ -4020,19 +4020,19 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1654 + //line php5/php5.y:1659 { yyVAL.list = []node.Node{yyDollar[1].node} } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1656 + //line php5/php5.y:1661 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1661 + //line php5/php5.y:1666 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4044,13 +4044,13 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1671 + //line php5/php5.y:1676 { yyVAL.node = yyDollar[1].node } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1676 + //line php5/php5.y:1681 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4062,7 +4062,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1689 + //line php5/php5.y:1694 { alias := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -4074,7 +4074,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1699 + //line php5/php5.y:1704 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4082,37 +4082,41 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1708 + //line php5/php5.y:1713 { yyVAL.node = nil } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1710 + //line php5/php5.y:1715 { yyVAL.node = yyDollar[1].node } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1715 + //line php5/php5.y:1720 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} + yyVAL.node = stmt.NewNop() + + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1717 + //line php5/php5.y:1726 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} + yyVAL.node = stmt.NewStmtList(yyDollar[2].list) + + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1722 + //line php5/php5.y:1735 { yyVAL.list = yyDollar[1].list } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1724 + //line php5/php5.y:1737 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4122,31 +4126,31 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1735 + //line php5/php5.y:1748 { yyVAL.list = nil } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1737 + //line php5/php5.y:1750 { yyVAL.list = yyDollar[1].list } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1742 + //line php5/php5.y:1755 { yyVAL.list = []node.Node{yyDollar[1].node} } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1744 + //line php5/php5.y:1757 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 204: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1749 + //line php5/php5.y:1762 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4154,7 +4158,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1755 + //line php5/php5.y:1768 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4162,7 +4166,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1761 + //line php5/php5.y:1774 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4170,7 +4174,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1767 + //line php5/php5.y:1780 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4178,7 +4182,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1773 + //line php5/php5.y:1786 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4186,7 +4190,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1779 + //line php5/php5.y:1792 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4194,7 +4198,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1788 + //line php5/php5.y:1801 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4212,7 +4216,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1804 + //line php5/php5.y:1817 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4230,7 +4234,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1820 + //line php5/php5.y:1833 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4248,7 +4252,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1836 + //line php5/php5.y:1849 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4266,7 +4270,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1855 + //line php5/php5.y:1868 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4283,7 +4287,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1870 + //line php5/php5.y:1883 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -4299,55 +4303,55 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1887 + //line php5/php5.y:1900 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1889 + //line php5/php5.y:1902 { yyVAL.list = []node.Node{yyDollar[1].node} } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1895 + //line php5/php5.y:1908 { yyVAL.list = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1897 + //line php5/php5.y:1910 { yyVAL.list = yyDollar[1].list } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1902 + //line php5/php5.y:1915 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1904 + //line php5/php5.y:1917 { yyVAL.list = []node.Node{yyDollar[1].node} } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1909 + //line php5/php5.y:1922 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1911 + //line php5/php5.y:1924 { yyVAL.list = yyDollar[1].list } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1916 + //line php5/php5.y:1929 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -4356,7 +4360,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1923 + //line php5/php5.y:1936 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -4365,37 +4369,37 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1933 + //line php5/php5.y:1946 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1935 + //line php5/php5.y:1948 { yyVAL.list = yyDollar[1].list } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1937 + //line php5/php5.y:1950 { yyVAL.list = yyDollar[1].list } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1942 + //line php5/php5.y:1955 { yyVAL.list = nil } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1944 + //line php5/php5.y:1957 { yyVAL.list = yyDollar[1].list } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1949 + //line php5/php5.y:1962 { if yyDollar[3].node != nil { @@ -4410,7 +4414,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1965 + //line php5/php5.y:1978 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -4422,7 +4426,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1975 + //line php5/php5.y:1988 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4430,7 +4434,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1981 + //line php5/php5.y:1994 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4438,7 +4442,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1987 + //line php5/php5.y:2000 { var _new *expr.New @@ -4457,7 +4461,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2004 + //line php5/php5.y:2017 { yyVAL.node = expr.NewClone(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4465,7 +4469,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2010 + //line php5/php5.y:2023 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4473,7 +4477,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2016 + //line php5/php5.y:2029 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4481,7 +4485,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2022 + //line php5/php5.y:2035 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4489,7 +4493,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2028 + //line php5/php5.y:2041 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4497,7 +4501,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2034 + //line php5/php5.y:2047 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4505,7 +4509,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2040 + //line php5/php5.y:2053 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4513,7 +4517,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2046 + //line php5/php5.y:2059 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4521,7 +4525,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2052 + //line php5/php5.y:2065 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4529,7 +4533,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2058 + //line php5/php5.y:2071 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4537,7 +4541,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2064 + //line php5/php5.y:2077 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4545,7 +4549,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2070 + //line php5/php5.y:2083 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4553,7 +4557,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2076 + //line php5/php5.y:2089 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4561,7 +4565,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2082 + //line php5/php5.y:2095 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4569,7 +4573,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2088 + //line php5/php5.y:2101 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4577,7 +4581,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2094 + //line php5/php5.y:2107 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4585,7 +4589,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2100 + //line php5/php5.y:2113 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4593,7 +4597,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2106 + //line php5/php5.y:2119 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4601,7 +4605,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2112 + //line php5/php5.y:2125 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4609,7 +4613,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2118 + //line php5/php5.y:2131 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4617,7 +4621,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2124 + //line php5/php5.y:2137 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4625,7 +4629,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2130 + //line php5/php5.y:2143 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4633,7 +4637,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2136 + //line php5/php5.y:2149 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4641,7 +4645,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2142 + //line php5/php5.y:2155 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4649,7 +4653,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2148 + //line php5/php5.y:2161 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4657,7 +4661,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2154 + //line php5/php5.y:2167 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4665,7 +4669,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2160 + //line php5/php5.y:2173 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4673,7 +4677,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2166 + //line php5/php5.y:2179 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4681,7 +4685,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2172 + //line php5/php5.y:2185 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4689,7 +4693,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2178 + //line php5/php5.y:2191 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4697,7 +4701,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2184 + //line php5/php5.y:2197 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4705,7 +4709,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2190 + //line php5/php5.y:2203 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4713,7 +4717,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2196 + //line php5/php5.y:2209 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4721,7 +4725,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2202 + //line php5/php5.y:2215 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4729,7 +4733,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2208 + //line php5/php5.y:2221 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4737,7 +4741,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2214 + //line php5/php5.y:2227 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4745,7 +4749,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2220 + //line php5/php5.y:2233 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4753,7 +4757,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2226 + //line php5/php5.y:2239 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4761,7 +4765,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2232 + //line php5/php5.y:2245 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4769,7 +4773,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2238 + //line php5/php5.y:2251 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4777,7 +4781,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2244 + //line php5/php5.y:2257 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4785,7 +4789,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2250 + //line php5/php5.y:2263 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4793,7 +4797,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2256 + //line php5/php5.y:2269 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4801,7 +4805,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2262 + //line php5/php5.y:2275 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4809,7 +4813,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2268 + //line php5/php5.y:2281 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4817,7 +4821,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2274 + //line php5/php5.y:2287 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4825,7 +4829,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2280 + //line php5/php5.y:2293 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4833,19 +4837,19 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2286 + //line php5/php5.y:2299 { yyVAL.node = yyDollar[1].node } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2288 + //line php5/php5.y:2301 { yyVAL.node = yyDollar[1].node } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2290 + //line php5/php5.y:2303 { yyVAL.node = yyDollar[2].node @@ -4873,7 +4877,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2316 + //line php5/php5.y:2329 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -4881,7 +4885,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2322 + //line php5/php5.y:2335 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4889,13 +4893,13 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2328 + //line php5/php5.y:2341 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2330 + //line php5/php5.y:2343 { yyVAL.node = cast.NewInt(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4903,7 +4907,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2336 + //line php5/php5.y:2349 { yyVAL.node = cast.NewDouble(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4911,7 +4915,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2342 + //line php5/php5.y:2355 { yyVAL.node = cast.NewString(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4919,7 +4923,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2348 + //line php5/php5.y:2361 { yyVAL.node = cast.NewArray(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4927,7 +4931,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2354 + //line php5/php5.y:2367 { yyVAL.node = cast.NewObject(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4935,7 +4939,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2360 + //line php5/php5.y:2373 { yyVAL.node = cast.NewBool(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4943,7 +4947,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2366 + //line php5/php5.y:2379 { yyVAL.node = cast.NewUnset(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4951,7 +4955,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2372 + //line php5/php5.y:2385 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -4963,7 +4967,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2382 + //line php5/php5.y:2395 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4971,25 +4975,25 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2388 + //line php5/php5.y:2401 { yyVAL.node = yyDollar[1].node } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2390 + //line php5/php5.y:2403 { yyVAL.node = yyDollar[1].node } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2392 + //line php5/php5.y:2405 { yyVAL.node = yyDollar[1].node } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2394 + //line php5/php5.y:2407 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -4997,7 +5001,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2400 + //line php5/php5.y:2413 { yyVAL.node = expr.NewPrint(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5005,7 +5009,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2406 + //line php5/php5.y:2419 { yyVAL.node = expr.NewYield(nil, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5013,7 +5017,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:2412 + //line php5/php5.y:2425 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].list, nil, yyDollar[8].list, false, yyDollar[2].boolWithToken.value, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) @@ -5022,7 +5026,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:2419 + //line php5/php5.y:2432 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, nil, yyDollar[9].list, true, yyDollar[3].boolWithToken.value, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) @@ -5031,7 +5035,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2429 + //line php5/php5.y:2442 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5039,7 +5043,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2435 + //line php5/php5.y:2448 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5047,7 +5051,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2441 + //line php5/php5.y:2454 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5055,7 +5059,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2447 + //line php5/php5.y:2460 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5063,7 +5067,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2456 + //line php5/php5.y:2469 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5071,7 +5075,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2462 + //line php5/php5.y:2475 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5079,7 +5083,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2468 + //line php5/php5.y:2481 { str := scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(str, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5091,7 +5095,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2478 + //line php5/php5.y:2491 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5099,7 +5103,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2487 + //line php5/php5.y:2500 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5107,7 +5111,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2493 + //line php5/php5.y:2506 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5115,25 +5119,25 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2502 + //line php5/php5.y:2515 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2507 + //line php5/php5.y:2520 { yyVAL.list = []node.Node{} } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2509 + //line php5/php5.y:2522 { yyVAL.list = yyDollar[3].list } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2514 + //line php5/php5.y:2527 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5151,7 +5155,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2530 + //line php5/php5.y:2543 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -5169,7 +5173,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2546 + //line php5/php5.y:2559 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5187,7 +5191,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2562 + //line php5/php5.y:2575 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5205,7 +5209,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2581 + //line php5/php5.y:2594 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5217,7 +5221,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2591 + //line php5/php5.y:2604 { funcName := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5229,7 +5233,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2601 + //line php5/php5.y:2614 { funcName := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5241,7 +5245,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2611 + //line php5/php5.y:2624 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5249,7 +5253,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2617 + //line php5/php5.y:2630 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5257,7 +5261,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2623 + //line php5/php5.y:2636 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5265,7 +5269,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2629 + //line php5/php5.y:2642 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5273,7 +5277,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2635 + //line php5/php5.y:2648 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) @@ -5281,7 +5285,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2644 + //line php5/php5.y:2657 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5289,7 +5293,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2650 + //line php5/php5.y:2663 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5297,7 +5301,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2656 + //line php5/php5.y:2669 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5305,7 +5309,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2662 + //line php5/php5.y:2675 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5313,7 +5317,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2671 + //line php5/php5.y:2684 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5321,7 +5325,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2677 + //line php5/php5.y:2690 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5329,7 +5333,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2683 + //line php5/php5.y:2696 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5337,19 +5341,19 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2692 + //line php5/php5.y:2705 { yyVAL.node = yyDollar[1].node } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2694 + //line php5/php5.y:2707 { yyVAL.node = yyDollar[1].node } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2699 + //line php5/php5.y:2712 { yyVAL.node = yyDollar[1].node @@ -5387,79 +5391,79 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2735 + //line php5/php5.y:2748 { yyVAL.node = yyDollar[1].node } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2741 + //line php5/php5.y:2754 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2743 + //line php5/php5.y:2756 { yyVAL.list = []node.Node{} } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2749 + //line php5/php5.y:2762 { yyVAL.list = yyDollar[2].list } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2754 + //line php5/php5.y:2767 { yyVAL.node = nil } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2756 + //line php5/php5.y:2769 { yyVAL.node = nil } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2758 + //line php5/php5.y:2771 { yyVAL.node = yyDollar[1].node } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2763 + //line php5/php5.y:2776 { yyVAL.list = []node.Node{} } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2765 + //line php5/php5.y:2778 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2767 + //line php5/php5.y:2780 { yyVAL.list = yyDollar[1].list } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2772 + //line php5/php5.y:2785 { yyVAL.node = nil } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2774 + //line php5/php5.y:2787 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2779 + //line php5/php5.y:2792 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5467,7 +5471,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2785 + //line php5/php5.y:2798 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5475,7 +5479,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2791 + //line php5/php5.y:2804 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5483,7 +5487,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2797 + //line php5/php5.y:2810 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5491,7 +5495,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2803 + //line php5/php5.y:2816 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5499,7 +5503,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2809 + //line php5/php5.y:2822 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5507,7 +5511,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2815 + //line php5/php5.y:2828 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5515,7 +5519,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2821 + //line php5/php5.y:2834 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5523,7 +5527,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2827 + //line php5/php5.y:2840 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5531,7 +5535,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2833 + //line php5/php5.y:2846 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5539,7 +5543,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2839 + //line php5/php5.y:2852 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5551,7 +5555,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2849 + //line php5/php5.y:2862 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -5559,7 +5563,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2858 + //line php5/php5.y:2871 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5571,25 +5575,25 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2871 + //line php5/php5.y:2884 { yyVAL.node = yyDollar[1].node } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2876 + //line php5/php5.y:2889 { yyVAL.node = yyDollar[1].node } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2878 + //line php5/php5.y:2891 { yyVAL.node = yyDollar[1].node } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2880 + //line php5/php5.y:2893 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5601,7 +5605,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2890 + //line php5/php5.y:2903 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5613,7 +5617,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2900 + //line php5/php5.y:2913 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5625,7 +5629,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2910 + //line php5/php5.y:2923 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5633,7 +5637,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2916 + //line php5/php5.y:2929 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5641,13 +5645,13 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2922 + //line php5/php5.y:2935 { yyVAL.node = yyDollar[1].node } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2924 + //line php5/php5.y:2937 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5655,13 +5659,13 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2930 + //line php5/php5.y:2943 { yyVAL.node = yyDollar[1].node } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2935 + //line php5/php5.y:2948 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5669,7 +5673,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2941 + //line php5/php5.y:2954 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5677,7 +5681,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2947 + //line php5/php5.y:2960 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5685,7 +5689,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2953 + //line php5/php5.y:2966 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5693,7 +5697,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2959 + //line php5/php5.y:2972 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5701,7 +5705,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2965 + //line php5/php5.y:2978 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5709,7 +5713,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2971 + //line php5/php5.y:2984 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5717,7 +5721,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2977 + //line php5/php5.y:2990 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5725,7 +5729,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2983 + //line php5/php5.y:2996 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5733,7 +5737,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2989 + //line php5/php5.y:3002 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5741,7 +5745,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2995 + //line php5/php5.y:3008 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5749,7 +5753,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3001 + //line php5/php5.y:3014 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5757,7 +5761,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3007 + //line php5/php5.y:3020 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5765,7 +5769,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3013 + //line php5/php5.y:3026 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5773,7 +5777,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3019 + //line php5/php5.y:3032 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5781,7 +5785,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3025 + //line php5/php5.y:3038 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5789,7 +5793,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3031 + //line php5/php5.y:3044 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5797,7 +5801,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3037 + //line php5/php5.y:3050 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5805,7 +5809,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3043 + //line php5/php5.y:3056 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5813,7 +5817,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3049 + //line php5/php5.y:3062 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5821,7 +5825,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3055 + //line php5/php5.y:3068 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5829,7 +5833,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3061 + //line php5/php5.y:3074 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5837,7 +5841,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3067 + //line php5/php5.y:3080 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5845,7 +5849,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3073 + //line php5/php5.y:3086 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5853,7 +5857,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3079 + //line php5/php5.y:3092 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5861,7 +5865,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3085 + //line php5/php5.y:3098 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5869,7 +5873,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3091 + //line php5/php5.y:3104 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5877,7 +5881,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3097 + //line php5/php5.y:3110 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5885,7 +5889,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3103 + //line php5/php5.y:3116 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5893,7 +5897,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3109 + //line php5/php5.y:3122 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -5901,7 +5905,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3115 + //line php5/php5.y:3128 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5909,7 +5913,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3121 + //line php5/php5.y:3134 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5917,19 +5921,19 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3127 + //line php5/php5.y:3140 { yyVAL.node = yyDollar[2].node } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3132 + //line php5/php5.y:3145 { yyVAL.node = yyDollar[1].node } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3134 + //line php5/php5.y:3147 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5941,7 +5945,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3144 + //line php5/php5.y:3157 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5953,7 +5957,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3154 + //line php5/php5.y:3167 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5965,7 +5969,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3167 + //line php5/php5.y:3180 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5977,25 +5981,25 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3177 + //line php5/php5.y:3190 { yyVAL.node = yyDollar[1].node } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3179 + //line php5/php5.y:3192 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3181 + //line php5/php5.y:3194 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3183 + //line php5/php5.y:3196 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6003,7 +6007,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3189 + //line php5/php5.y:3202 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6011,7 +6015,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3195 + //line php5/php5.y:3208 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6019,19 +6023,19 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3204 + //line php5/php5.y:3217 { yyVAL.list = nil } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3206 + //line php5/php5.y:3219 { yyVAL.list = yyDollar[1].list } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3216 + //line php5/php5.y:3229 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -6041,7 +6045,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3224 + //line php5/php5.y:3237 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6051,7 +6055,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3232 + //line php5/php5.y:3245 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6061,7 +6065,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3240 + //line php5/php5.y:3253 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6071,49 +6075,49 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3251 + //line php5/php5.y:3264 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3253 + //line php5/php5.y:3266 { yyVAL.node = yyDollar[1].node } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3258 + //line php5/php5.y:3271 { yyVAL.node = yyDollar[2].node } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3260 + //line php5/php5.y:3273 { yyVAL.node = yyDollar[2].node } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3266 + //line php5/php5.y:3279 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3272 + //line php5/php5.y:3285 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3277 + //line php5/php5.y:3290 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3282 + //line php5/php5.y:3295 { yyVAL.node = yyDollar[1].node @@ -6168,25 +6172,25 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3335 + //line php5/php5.y:3348 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3340 + //line php5/php5.y:3353 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3342 + //line php5/php5.y:3355 { yyVAL.list = []node.Node{} } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3348 + //line php5/php5.y:3361 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -6197,7 +6201,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3360 + //line php5/php5.y:3373 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6206,7 +6210,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3367 + //line php5/php5.y:3380 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6215,38 +6219,38 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3377 + //line php5/php5.y:3390 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3385 + //line php5/php5.y:3398 { yyVAL.list = []node.Node{yyDollar[1].node} } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3387 + //line php5/php5.y:3400 { yyVAL.list = yyDollar[1].list } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3389 + //line php5/php5.y:3402 { yyVAL.list = nil } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3394 + //line php5/php5.y:3407 { yyVAL.node = yyDollar[1].node } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3396 + //line php5/php5.y:3409 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6258,7 +6262,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3409 + //line php5/php5.y:3422 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6266,7 +6270,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3415 + //line php5/php5.y:3428 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6274,13 +6278,13 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3425 + //line php5/php5.y:3438 { yyVAL.node = yyDollar[1].node } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3430 + //line php5/php5.y:3443 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6288,7 +6292,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3436 + //line php5/php5.y:3449 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6296,31 +6300,31 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3444 + //line php5/php5.y:3457 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3445 + //line php5/php5.y:3458 { yyVAL.node = yyDollar[1].node } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3446 + //line php5/php5.y:3459 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3452 + //line php5/php5.y:3465 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3454 + //line php5/php5.y:3467 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6332,13 +6336,13 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3464 + //line php5/php5.y:3477 { yyVAL.node = yyDollar[1].node } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3469 + //line php5/php5.y:3482 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6346,7 +6350,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3475 + //line php5/php5.y:3488 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6354,13 +6358,13 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3481 + //line php5/php5.y:3494 { yyVAL.node = yyDollar[1].node } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3487 + //line php5/php5.y:3500 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6372,7 +6376,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3497 + //line php5/php5.y:3510 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6380,25 +6384,25 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3506 + //line php5/php5.y:3519 { yyVAL.node = nil } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3508 + //line php5/php5.y:3521 { yyVAL.node = yyDollar[1].node } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3514 + //line php5/php5.y:3527 { yyVAL.list = yyDollar[1].list } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3516 + //line php5/php5.y:3529 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6407,7 +6411,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3526 + //line php5/php5.y:3539 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6416,7 +6420,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3533 + //line php5/php5.y:3546 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6425,7 +6429,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3540 + //line php5/php5.y:3553 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6434,7 +6438,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3550 + //line php5/php5.y:3563 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6442,13 +6446,13 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3556 + //line php5/php5.y:3569 { yyVAL.node = yyDollar[2].node } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3561 + //line php5/php5.y:3574 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6458,7 +6462,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3569 + //line php5/php5.y:3582 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6472,13 +6476,13 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3584 + //line php5/php5.y:3597 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3586 + //line php5/php5.y:3599 { if yyDollar[1].node == nil { yyVAL.list = []node.Node{} @@ -6488,7 +6492,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3598 + //line php5/php5.y:3611 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6496,7 +6500,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3604 + //line php5/php5.y:3617 { item := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6508,25 +6512,25 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3614 + //line php5/php5.y:3627 { yyVAL.node = nil } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3620 + //line php5/php5.y:3633 { yyVAL.list = []node.Node{} } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3622 + //line php5/php5.y:3635 { yyVAL.list = yyDollar[1].list } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3627 + //line php5/php5.y:3640 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -6536,7 +6540,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3635 + //line php5/php5.y:3648 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6546,7 +6550,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3643 + //line php5/php5.y:3656 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6556,7 +6560,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3651 + //line php5/php5.y:3664 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6566,7 +6570,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3659 + //line php5/php5.y:3672 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[6].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) @@ -6576,7 +6580,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3667 + //line php5/php5.y:3680 { arrayItem := expr.NewArrayItem(nil, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) @@ -6586,7 +6590,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3675 + //line php5/php5.y:3688 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -6596,7 +6600,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3683 + //line php5/php5.y:3696 { arrayItem := expr.NewArrayItem(nil, yyDollar[2].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6606,13 +6610,13 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3694 + //line php5/php5.y:3707 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3696 + //line php5/php5.y:3709 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6621,13 +6625,13 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3703 + //line php5/php5.y:3716 { yyVAL.list = []node.Node{yyDollar[1].node} } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3705 + //line php5/php5.y:3718 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6636,7 +6640,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3715 + //line php5/php5.y:3728 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6648,7 +6652,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3725 + //line php5/php5.y:3738 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6663,7 +6667,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3738 + //line php5/php5.y:3751 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6681,7 +6685,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3754 + //line php5/php5.y:3767 { yyVAL.node = yyDollar[2].node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6689,7 +6693,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3760 + //line php5/php5.y:3773 { identifier := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6704,13 +6708,13 @@ yydefault: } case 500: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3774 + //line php5/php5.y:3787 { yyVAL.node = yyDollar[2].node } case 501: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3779 + //line php5/php5.y:3792 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6718,7 +6722,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3785 + //line php5/php5.y:3798 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -6732,7 +6736,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3797 + //line php5/php5.y:3810 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6744,7 +6748,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3810 + //line php5/php5.y:3823 { yyVAL.node = expr.NewIsset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6752,7 +6756,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3816 + //line php5/php5.y:3829 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6760,7 +6764,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3822 + //line php5/php5.y:3835 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6768,7 +6772,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3828 + //line php5/php5.y:3841 { yyVAL.node = expr.NewInclude(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6776,7 +6780,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3834 + //line php5/php5.y:3847 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6784,7 +6788,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3840 + //line php5/php5.y:3853 { yyVAL.node = expr.NewEval(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6792,7 +6796,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3846 + //line php5/php5.y:3859 { yyVAL.node = expr.NewRequire(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6800,7 +6804,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3852 + //line php5/php5.y:3865 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6808,31 +6812,31 @@ yydefault: } case 512: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3861 + //line php5/php5.y:3874 { yyVAL.list = []node.Node{yyDollar[1].node} } case 513: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3863 + //line php5/php5.y:3876 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 514: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3868 + //line php5/php5.y:3881 { yyVAL.node = yyDollar[1].node } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3870 + //line php5/php5.y:3883 { yyVAL.node = yyDollar[1].node } case 516: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3875 + //line php5/php5.y:3888 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6844,7 +6848,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3885 + //line php5/php5.y:3898 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6856,7 +6860,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3898 + //line php5/php5.y:3911 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6868,7 +6872,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3911 + //line php5/php5.y:3924 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) diff --git a/php5/php5.y b/php5/php5.y index 073b042..a3e611b 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -24,7 +24,6 @@ import ( boolWithToken boolWithToken list []node.Node foreachVariable foreachVariable - nodesWithEndToken *nodesWithEndToken simpleIndirectReference simpleIndirectReference altSyntaxNode altSyntaxNode } @@ -245,6 +244,7 @@ import ( %type ctor_arguments function_call_parameter_list %type trait_adaptations %type switch_case_list +%type method_body %type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations %type inner_statement_list global_var_list static_var_list encaps_list isset_variables non_empty_array_pair_list @@ -261,7 +261,6 @@ import ( %type simple_indirect_reference %type foreach_variable foreach_optional_arg -%type method_body %type is_reference is_variadic %type while_statement for_statement foreach_statement @@ -1574,8 +1573,14 @@ class_statement: yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).comments.AddComments(name, $4.Comments()) - $$ = stmt.NewClassMethod(name, $1, $3.value, $6, nil, $8.nodes, "") - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $8.endToken)) + $$ = stmt.NewClassMethod(name, $1, $3.value, $6, nil, $8, "") + + if $1 == nil { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $8)) + } else { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListNodePosition($1, $8)) + } + yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) } ; @@ -1711,10 +1716,18 @@ trait_modifiers: ; method_body: - ';' /* abstract method */ - { $$ = &nodesWithEndToken{nil, $1} } + ';' /* abstract method */ + { + $$ = stmt.NewNop() + + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + } | '{' inner_statement_list '}' - { $$ = &nodesWithEndToken{$2, $3} } + { + $$ = stmt.NewStmtList($2) + + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + } ; variable_modifiers: @@ -3926,11 +3939,6 @@ type foreachVariable struct { byRef bool } -type nodesWithEndToken struct { - nodes []node.Node - endToken *scanner.Token -} - type boolWithToken struct { value bool token *scanner.Token diff --git a/php5/php5_test.go b/php5/php5_test.go index 45ee10d..ca6338f 100644 --- a/php5/php5_test.go +++ b/php5/php5_test.go @@ -514,7 +514,9 @@ func TestPhp5(t *testing.T) { MethodName: &node.Identifier{Value: "foo"}, Modifiers: []node.Node{&node.Identifier{Value: "public"}}, Params: expectedParams, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, }, }, @@ -776,7 +778,9 @@ func TestPhp5(t *testing.T) { &stmt.ClassMethod{ PhpDocComment: "", MethodName: &node.Identifier{Value: "bar"}, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, }, }, @@ -791,7 +795,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{Value: "public"}, &node.Identifier{Value: "static"}, }, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, }, }, @@ -806,7 +812,9 @@ func TestPhp5(t *testing.T) { &node.Identifier{Value: "final"}, &node.Identifier{Value: "private"}, }, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, &stmt.ClassMethod{ PhpDocComment: "", @@ -815,7 +823,9 @@ func TestPhp5(t *testing.T) { Modifiers: []node.Node{ &node.Identifier{Value: "protected"}, }, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, }, }, @@ -833,6 +843,7 @@ func TestPhp5(t *testing.T) { &node.Identifier{Value: "abstract"}, &node.Identifier{Value: "public"}, }, + Stmt: &stmt.Nop{}, }, }, }, diff --git a/php7/php7.go b/php7/php7.go index 59f551a..e5ce2c0 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -22,15 +22,14 @@ import ( //line php7/php7.y:22 type yySymType struct { - yys int - node node.Node - token *scanner.Token - boolWithToken boolWithToken - list []node.Node - foreachVariable foreachVariable - nodesWithEndToken *nodesWithEndToken - str string - altSyntaxNode altSyntaxNode + yys int + node node.Node + token *scanner.Token + boolWithToken boolWithToken + list []node.Node + foreachVariable foreachVariable + str string + altSyntaxNode altSyntaxNode } const T_INCLUDE = 57346 @@ -345,18 +344,13 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:4219 +//line php7/php7.y:4241 type foreachVariable struct { node node.Node byRef bool } -type nodesWithEndToken struct { - nodes []node.Node - endToken *scanner.Token -} - type boolWithToken struct { value bool token *scanner.Token @@ -1453,7 +1447,7 @@ var yyPgo = [...]int{ 855, 853, 5, 852, 83, 40, 845, 138, 43, 840, 837, 835, 825, 823, 119, 822, 819, 818, 817, 12, 815, 814, 44, 42, 32, 2, 15, 629, 41, 74, - 812, 809, 8, 686, 20, 807, 536, 806, 121, 803, + 812, 809, 807, 8, 686, 20, 536, 806, 121, 803, 802, 800, 71, 798, 33, 797, 795, 30, 37, 791, 789, 28, 787, 786, 545, 784, 18, 783, 776, 26, 773, 63, 1, 4, 768, 17, 767, 39, 765, 763, @@ -1471,7 +1465,7 @@ var yyR1 = [...]int{ 5, 5, 5, 5, 5, 5, 6, 6, 111, 111, 88, 88, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 83, 83, 16, 16, 18, 18, 7, 7, 98, 98, + 84, 84, 16, 16, 18, 18, 7, 7, 98, 98, 97, 97, 104, 104, 17, 17, 20, 20, 19, 19, 92, 92, 112, 112, 22, 22, 22, 22, 22, 22, 22, 11, 11, 11, 11, 11, 11, 11, 11, 11, @@ -1479,7 +1473,7 @@ var yyR1 = [...]int{ 11, 11, 11, 11, 11, 90, 90, 89, 89, 26, 26, 103, 103, 27, 12, 1, 1, 2, 2, 13, 13, 122, 122, 77, 77, 14, 15, 29, 29, 116, - 116, 117, 117, 84, 84, 84, 84, 125, 125, 126, + 116, 117, 117, 85, 85, 85, 85, 125, 125, 126, 126, 25, 25, 81, 81, 81, 81, 101, 101, 101, 8, 8, 124, 124, 68, 68, 66, 66, 70, 70, 67, 67, 113, 113, 114, 114, 30, 30, 31, 31, @@ -1487,8 +1481,8 @@ var yyR1 = [...]int{ 110, 32, 32, 96, 96, 34, 100, 100, 35, 35, 115, 115, 36, 36, 36, 36, 121, 121, 80, 80, 80, 102, 102, 37, 37, 38, 39, 39, 39, 39, - 41, 41, 40, 85, 85, 119, 119, 118, 118, 120, - 120, 82, 82, 82, 82, 82, 82, 99, 99, 42, + 41, 41, 40, 82, 82, 119, 119, 118, 118, 120, + 120, 83, 83, 83, 83, 83, 83, 99, 99, 42, 42, 91, 91, 69, 21, 93, 93, 43, 94, 94, 95, 95, 45, 44, 44, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, @@ -1576,7 +1570,7 @@ var yyChk = [...]int{ -58, -53, -46, -56, -57, 91, 49, 50, 4, 5, 84, 85, 86, 8, 9, 66, 67, 81, 63, 64, 65, 80, 62, 74, 140, 12, 157, -10, -60, 60, - 18, -88, 82, 146, 82, -88, 142, 10, -18, -83, + 18, -88, 82, 146, 82, -88, 142, 10, -18, -84, -104, -88, 82, 37, 38, -19, -20, -92, -21, 10, -112, 146, -11, 37, 79, 146, 146, -24, -23, 98, -24, -24, -96, -34, -48, -100, 37, -35, 12, -93, @@ -1628,9 +1622,9 @@ var yyChk = [...]int{ 10, 13, 152, 12, 10, 143, 143, 148, 143, -23, 149, -78, -23, -78, -48, -24, -23, -55, -48, -29, -7, 158, 147, 147, 143, -7, 158, -23, 147, 143, - 142, 82, -98, -17, -20, -83, 142, -123, 147, -124, + 142, 82, -98, -17, -20, -84, 142, -123, 147, -124, -11, 145, -23, -94, -23, -81, 142, 145, 146, -23, - 147, -27, -84, -28, 151, 59, 148, -25, -11, 145, + 147, -27, -85, -28, 151, 59, 148, -25, -11, 145, -90, 146, -113, -114, -30, -31, -76, -74, 150, 60, 61, -10, -117, -123, -121, -115, 142, 158, 147, 147, 95, -11, 145, 143, 160, -23, -28, 146, 147, 149, @@ -1639,12 +1633,12 @@ var yyChk = [...]int{ 144, -101, 144, -101, 144, -113, 144, 147, 58, -28, 146, -109, -112, -26, 41, 42, -113, 147, 158, -1, 151, -74, -123, 142, 143, -36, -119, -118, 44, -120, - 47, -82, 103, 102, 101, 98, 99, 100, -115, -10, + 47, -83, 103, 102, 101, 98, 99, 100, -115, -10, -11, 145, 144, -112, -23, -109, 149, -123, -7, 158, -97, 143, -17, -7, 22, 144, -94, 143, 32, 33, - -101, 31, -101, 147, -126, -11, 145, -84, -28, -109, + -101, 31, -101, 147, -126, -11, 145, -85, -28, -109, 149, 28, 146, 142, 147, -106, 44, -30, -2, 83, - 142, -115, -99, -42, 12, 38, 37, -121, -82, 143, + 142, -115, -99, -42, 12, 38, 37, -121, -83, 143, -112, 147, 143, 142, 143, -20, -7, 143, 144, 147, -23, -8, 145, 144, 143, 144, 31, -106, -112, 147, 147, 144, -89, -10, -112, -75, 145, -75, 146, 12, @@ -1656,8 +1650,8 @@ var yyChk = [...]int{ -6, 79, 10, 143, -112, -112, 142, 144, 147, -10, -112, -112, 147, 158, 12, -23, -123, -69, -23, -123, 143, -37, 144, 144, 45, 29, 78, 24, -112, 142, - 143, 143, -52, -123, 146, -121, 10, -4, -82, -6, - 144, 143, -112, -113, -6, 143, 147, -75, -85, 144, + 143, 143, -52, -123, 146, -121, 10, -4, -83, -6, + 144, 143, -112, -113, -6, 143, 147, -75, -82, 144, 142, -112, 143, } var yyDef = [...]int{ @@ -2133,7 +2127,7 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:296 + //line php7/php7.y:295 { yylex.(*Parser).rootNode = node.NewRoot(yyDollar[1].list) @@ -2142,463 +2136,463 @@ yydefault: } case 2: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 3: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 5: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 10: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 11: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 12: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 13: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 14: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 15: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 16: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 17: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 18: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 21: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 22: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 23: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 24: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 27: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 28: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 29: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 30: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 33: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 34: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 35: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 36: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 37: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 38: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 39: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 44: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 46: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 47: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 48: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 49: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 50: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 51: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 52: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 53: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 54: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 55: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 56: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 57: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 58: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 59: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 60: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 61: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 62: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 63: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 64: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 66: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 67: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 68: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 69: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 70: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 72: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 73: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 74: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 75: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:317 + //line php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 76: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:322 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 77: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:324 + //line php7/php7.y:323 { yyVAL.token = yyDollar[1].token } case 78: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:329 + //line php7/php7.y:328 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2606,13 +2600,13 @@ yydefault: } case 79: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:335 + //line php7/php7.y:334 { yyVAL.list = []node.Node{} } case 80: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:340 + //line php7/php7.y:339 { namePart := name.NewNamePart(yyDollar[1].token.Value) yyVAL.list = []node.Node{namePart} @@ -2625,7 +2619,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:351 + //line php7/php7.y:350 { namePart := name.NewNamePart(yyDollar[3].token.Value) yyVAL.list = append(yyDollar[1].list, namePart) @@ -2639,7 +2633,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:366 + //line php7/php7.y:365 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -2648,7 +2642,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:373 + //line php7/php7.y:372 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -2661,7 +2655,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:384 + //line php7/php7.y:383 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -2673,44 +2667,44 @@ yydefault: } case 85: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:397 + //line php7/php7.y:396 { // error yyVAL.node = nil } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:402 + //line php7/php7.y:401 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:404 + //line php7/php7.y:403 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:406 + //line php7/php7.y:405 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:408 + //line php7/php7.y:407 { yyVAL.node = yyDollar[1].node } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:410 + //line php7/php7.y:409 { yyVAL.node = yyDollar[1].node } case 91: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:412 + //line php7/php7.y:411 { yyVAL.node = stmt.NewHaltCompiler() @@ -2725,7 +2719,7 @@ yydefault: } case 92: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:425 + //line php7/php7.y:424 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2740,7 +2734,7 @@ yydefault: } case 93: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:438 + //line php7/php7.y:437 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2756,7 +2750,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:452 + //line php7/php7.y:451 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2770,7 +2764,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:464 + //line php7/php7.y:463 { yyVAL.node = yyDollar[2].node @@ -2783,7 +2777,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:475 + //line php7/php7.y:474 { yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) @@ -2796,7 +2790,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:486 + //line php7/php7.y:485 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2809,7 +2803,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:497 + //line php7/php7.y:496 { yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) @@ -2822,7 +2816,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:508 + //line php7/php7.y:507 { yyVAL.node = stmt.NewConstList(yyDollar[2].list) @@ -2835,7 +2829,7 @@ yydefault: } case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:522 + //line php7/php7.y:521 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2847,7 +2841,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:532 + //line php7/php7.y:531 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2859,7 +2853,7 @@ yydefault: } case 102: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:545 + //line php7/php7.y:544 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2878,7 +2872,7 @@ yydefault: } case 103: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:562 + //line php7/php7.y:561 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2898,7 +2892,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:583 + //line php7/php7.y:582 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2917,7 +2911,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:600 + //line php7/php7.y:599 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2937,19 +2931,19 @@ yydefault: } case 106: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:621 + //line php7/php7.y:620 { yyVAL.token = nil } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:623 + //line php7/php7.y:622 { yyVAL.token = yyDollar[1].token } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:628 + //line php7/php7.y:627 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2958,13 +2952,13 @@ yydefault: } case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:635 + //line php7/php7.y:634 { yyVAL.list = []node.Node{yyDollar[1].node} } case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:640 + //line php7/php7.y:639 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2973,13 +2967,13 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:647 + //line php7/php7.y:646 { yyVAL.list = []node.Node{yyDollar[1].node} } case 112: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:652 + //line php7/php7.y:651 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2988,25 +2982,25 @@ yydefault: } case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:659 + //line php7/php7.y:658 { yyVAL.list = []node.Node{yyDollar[1].node} } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:664 + //line php7/php7.y:663 { yyVAL.node = yyDollar[1].node } case 115: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:666 + //line php7/php7.y:665 { yyVAL.node = yyDollar[2].node.(*stmt.Use).SetUseType(yyDollar[1].node) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:671 + //line php7/php7.y:670 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -3017,7 +3011,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:680 + //line php7/php7.y:679 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -3034,13 +3028,13 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:698 + //line php7/php7.y:697 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:700 + //line php7/php7.y:699 { yyVAL.node = yyDollar[2].node @@ -3049,7 +3043,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:710 + //line php7/php7.y:709 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3058,13 +3052,13 @@ yydefault: } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:717 + //line php7/php7.y:716 { yyVAL.list = []node.Node{yyDollar[1].node} } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:722 + //line php7/php7.y:721 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3072,50 +3066,50 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:728 + //line php7/php7.y:727 { yyVAL.list = []node.Node{} } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:733 + //line php7/php7.y:732 { // error yyVAL.node = nil } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:738 + //line php7/php7.y:737 { yyVAL.node = yyDollar[1].node } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:740 + //line php7/php7.y:739 { yyVAL.node = yyDollar[1].node } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:742 + //line php7/php7.y:741 { yyVAL.node = yyDollar[1].node } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:744 + //line php7/php7.y:743 { yyVAL.node = yyDollar[1].node } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:746 + //line php7/php7.y:745 { yyVAL.node = yyDollar[1].node } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:748 + //line php7/php7.y:747 { yyVAL.node = stmt.NewHaltCompiler() @@ -3130,7 +3124,7 @@ yydefault: } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:763 + //line php7/php7.y:762 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3143,19 +3137,19 @@ yydefault: } case 132: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:774 + //line php7/php7.y:773 { yyVAL.node = yyDollar[1].node } case 133: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:776 + //line php7/php7.y:775 { yyVAL.node = yyDollar[1].node } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:778 + //line php7/php7.y:777 { if yyDollar[5].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltWhile(yyDollar[3].node, yyDollar[5].altSyntaxNode.node) @@ -3173,7 +3167,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:794 + //line php7/php7.y:793 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) @@ -3189,7 +3183,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:808 + //line php7/php7.y:807 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltFor(yyDollar[3].list, yyDollar[5].list, yyDollar[7].list, yyDollar[9].altSyntaxNode.node) @@ -3209,7 +3203,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:826 + //line php7/php7.y:825 { switch n := yyDollar[5].node.(type) { case *stmt.Switch: @@ -3232,7 +3226,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:847 + //line php7/php7.y:846 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3245,7 +3239,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:858 + //line php7/php7.y:857 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3258,7 +3252,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:869 + //line php7/php7.y:868 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3271,7 +3265,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:880 + //line php7/php7.y:879 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3284,7 +3278,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:891 + //line php7/php7.y:890 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3297,7 +3291,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:902 + //line php7/php7.y:901 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3310,7 +3304,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:913 + //line php7/php7.y:912 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3322,7 +3316,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:923 + //line php7/php7.y:922 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3334,7 +3328,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:933 + //line php7/php7.y:932 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3352,7 +3346,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:949 + //line php7/php7.y:948 { if yyDollar[7].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, nil, yyDollar[5].foreachVariable.node, yyDollar[7].altSyntaxNode.node, yyDollar[5].foreachVariable.byRef) @@ -3371,7 +3365,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:966 + //line php7/php7.y:965 { if yyDollar[9].altSyntaxNode.isAlt { yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, yyDollar[5].node, yyDollar[7].foreachVariable.node, yyDollar[9].altSyntaxNode.node, yyDollar[7].foreachVariable.byRef) @@ -3391,7 +3385,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:984 + //line php7/php7.y:983 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) @@ -3405,7 +3399,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:996 + //line php7/php7.y:995 { yyVAL.node = stmt.NewNop() @@ -3417,7 +3411,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1006 + //line php7/php7.y:1005 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3434,7 +3428,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1021 + //line php7/php7.y:1020 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3447,7 +3441,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1032 + //line php7/php7.y:1031 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3463,7 +3457,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1046 + //line php7/php7.y:1045 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -3478,13 +3472,13 @@ yydefault: } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1061 + //line php7/php7.y:1060 { yyVAL.list = []node.Node{} } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1063 + //line php7/php7.y:1062 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[5].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -3506,13 +3500,13 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1085 + //line php7/php7.y:1084 { yyVAL.list = []node.Node{yyDollar[1].node} } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1087 + //line php7/php7.y:1086 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3521,13 +3515,13 @@ yydefault: } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1097 + //line php7/php7.y:1096 { yyVAL.node = nil } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1099 + //line php7/php7.y:1098 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3541,13 +3535,13 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1114 + //line php7/php7.y:1113 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1116 + //line php7/php7.y:1115 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3556,13 +3550,13 @@ yydefault: } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1126 + //line php7/php7.y:1125 { yyVAL.node = yyDollar[1].node } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1131 + //line php7/php7.y:1130 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].boolWithToken.value, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) @@ -3584,31 +3578,31 @@ yydefault: } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1154 + //line php7/php7.y:1153 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1156 + //line php7/php7.y:1155 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1161 + //line php7/php7.y:1160 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1163 + //line php7/php7.y:1162 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1168 + //line php7/php7.y:1167 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].node, yyDollar[5].list, yyDollar[8].list, yyDollar[6].str) @@ -3631,7 +3625,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1189 + //line php7/php7.y:1188 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) @@ -3654,19 +3648,19 @@ yydefault: } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1213 + //line php7/php7.y:1212 { yyVAL.list = []node.Node{yyDollar[1].node} } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1215 + //line php7/php7.y:1214 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1220 + //line php7/php7.y:1219 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3678,7 +3672,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1230 + //line php7/php7.y:1229 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3690,7 +3684,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1243 + //line php7/php7.y:1242 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3707,7 +3701,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1261 + //line php7/php7.y:1260 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].list, yyDollar[6].list, yyDollar[4].str) @@ -3727,13 +3721,13 @@ yydefault: } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1282 + //line php7/php7.y:1281 { yyVAL.node = nil } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1284 + //line php7/php7.y:1283 { yyVAL.node = yyDollar[2].node @@ -3742,13 +3736,13 @@ yydefault: } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1294 + //line php7/php7.y:1293 { yyVAL.list = nil } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1296 + //line php7/php7.y:1295 { yyVAL.list = yyDollar[2].list @@ -3757,13 +3751,13 @@ yydefault: } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1306 + //line php7/php7.y:1305 { yyVAL.list = nil } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1308 + //line php7/php7.y:1307 { yyVAL.list = yyDollar[2].list @@ -3772,13 +3766,13 @@ yydefault: } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1318 + //line php7/php7.y:1317 { yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1320 + //line php7/php7.y:1319 { yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} @@ -3790,7 +3784,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1330 + //line php7/php7.y:1329 { list := expr.NewList(yyDollar[3].list) yyVAL.foreachVariable = foreachVariable{list, false} @@ -3805,7 +3799,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1343 + //line php7/php7.y:1342 { list := expr.NewShortList(yyDollar[2].list) yyVAL.foreachVariable = foreachVariable{list, false} @@ -3819,13 +3813,13 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1358 + //line php7/php7.y:1357 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1360 + //line php7/php7.y:1359 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} @@ -3839,13 +3833,13 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1375 + //line php7/php7.y:1374 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1377 + //line php7/php7.y:1376 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} @@ -3859,13 +3853,13 @@ yydefault: } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1392 + //line php7/php7.y:1391 { yyVAL.node = yyDollar[1].node } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1394 + //line php7/php7.y:1393 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3879,7 +3873,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1409 + //line php7/php7.y:1408 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3894,7 +3888,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1422 + //line php7/php7.y:1421 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3910,7 +3904,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1436 + //line php7/php7.y:1435 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -3926,7 +3920,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1450 + //line php7/php7.y:1449 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -3944,13 +3938,13 @@ yydefault: } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1469 + //line php7/php7.y:1468 { yyVAL.list = []node.Node{} } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1471 + //line php7/php7.y:1470 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -3964,7 +3958,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1483 + //line php7/php7.y:1482 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -3978,25 +3972,25 @@ yydefault: } case 200: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1498 + //line php7/php7.y:1497 { yyVAL.token = yyDollar[1].token } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1500 + //line php7/php7.y:1499 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1505 + //line php7/php7.y:1504 { yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1507 + //line php7/php7.y:1506 { yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} @@ -4010,7 +4004,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1522 + //line php7/php7.y:1521 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -4024,7 +4018,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1534 + //line php7/php7.y:1533 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -4040,13 +4034,13 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1551 + //line php7/php7.y:1550 { yyVAL.node = yyDollar[1].node } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1553 + //line php7/php7.y:1552 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4060,7 +4054,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1568 + //line php7/php7.y:1567 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4077,7 +4071,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1583 + //line php7/php7.y:1582 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4095,7 +4089,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1602 + //line php7/php7.y:1601 { yyVAL.node = yyDollar[1].node @@ -4108,7 +4102,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1613 + //line php7/php7.y:1612 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4127,25 +4121,25 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1633 + //line php7/php7.y:1632 { yyVAL.list = yyDollar[1].list } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1635 + //line php7/php7.y:1634 { yyVAL.list = nil } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1640 + //line php7/php7.y:1639 { yyVAL.list = []node.Node{yyDollar[1].node} } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1642 + //line php7/php7.y:1641 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4154,7 +4148,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1652 + //line php7/php7.y:1651 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4193,7 +4187,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1689 + //line php7/php7.y:1688 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4232,25 +4226,25 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1729 + //line php7/php7.y:1728 { yyVAL.node = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1731 + //line php7/php7.y:1730 { yyVAL.node = yyDollar[1].node } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1736 + //line php7/php7.y:1735 { yyVAL.node = yyDollar[1].node } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1738 + //line php7/php7.y:1737 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4262,7 +4256,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1751 + //line php7/php7.y:1750 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4274,7 +4268,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1761 + //line php7/php7.y:1760 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4286,19 +4280,19 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1771 + //line php7/php7.y:1770 { yyVAL.node = yyDollar[1].node } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1776 + //line php7/php7.y:1775 { yyVAL.node = nil } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1778 + //line php7/php7.y:1777 { yyVAL.node = yyDollar[2].node @@ -4307,7 +4301,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1788 + //line php7/php7.y:1787 { yyVAL.node = node.NewArgumentList(nil) @@ -4316,7 +4310,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1795 + //line php7/php7.y:1794 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4325,13 +4319,13 @@ yydefault: } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1805 + //line php7/php7.y:1804 { yyVAL.list = []node.Node{yyDollar[1].node} } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1807 + //line php7/php7.y:1806 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4340,7 +4334,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1817 + //line php7/php7.y:1816 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4349,7 +4343,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1824 + //line php7/php7.y:1823 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4361,7 +4355,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1837 + //line php7/php7.y:1836 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4370,19 +4364,19 @@ yydefault: } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1844 + //line php7/php7.y:1843 { yyVAL.list = []node.Node{yyDollar[1].node} } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1849 + //line php7/php7.y:1848 { yyVAL.node = yyDollar[1].node } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1854 + //line php7/php7.y:1853 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4391,13 +4385,13 @@ yydefault: } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1861 + //line php7/php7.y:1860 { yyVAL.list = []node.Node{yyDollar[1].node} } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1866 + //line php7/php7.y:1865 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4413,7 +4407,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1880 + //line php7/php7.y:1879 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4430,19 +4424,19 @@ yydefault: } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1898 + //line php7/php7.y:1897 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1900 + //line php7/php7.y:1899 { yyVAL.list = []node.Node{} } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1905 + //line php7/php7.y:1904 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4454,7 +4448,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1915 + //line php7/php7.y:1914 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4467,7 +4461,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1926 + //line php7/php7.y:1925 { var adaptationList *stmt.TraitAdaptationList @@ -4489,14 +4483,18 @@ yydefault: } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:1946 + //line php7/php7.y:1945 { name := node.NewIdentifier(yyDollar[4].token.Value) - yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].boolWithToken.value, yyDollar[7].list, yyDollar[9].node, yyDollar[10].nodesWithEndToken.nodes, yyDollar[5].str) + yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].boolWithToken.value, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) // save position yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[10].nodesWithEndToken.endToken)) + if yyDollar[1].list == nil { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[10].node)) + } else { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListNodePosition(yyDollar[1].list, yyDollar[10].node)) + } // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.FunctionToken) @@ -4509,13 +4507,13 @@ yydefault: } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1967 + //line php7/php7.y:1970 { yyVAL.list = []node.Node{yyDollar[1].node} } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1969 + //line php7/php7.y:1972 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4524,7 +4522,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1979 + //line php7/php7.y:1982 { yyVAL.node = stmt.NewNop() @@ -4536,7 +4534,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1989 + //line php7/php7.y:1992 { yyVAL.node = stmt.NewTraitAdaptationList(nil) @@ -4548,7 +4546,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1999 + //line php7/php7.y:2002 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4560,19 +4558,19 @@ yydefault: } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2012 + //line php7/php7.y:2015 { yyVAL.list = []node.Node{yyDollar[1].node} } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2014 + //line php7/php7.y:2017 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2019 + //line php7/php7.y:2022 { yyVAL.node = yyDollar[1].node @@ -4581,7 +4579,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2026 + //line php7/php7.y:2029 { yyVAL.node = yyDollar[1].node @@ -4590,7 +4588,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2036 + //line php7/php7.y:2039 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4602,7 +4600,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2049 + //line php7/php7.y:2052 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4617,7 +4615,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2062 + //line php7/php7.y:2065 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4632,7 +4630,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2075 + //line php7/php7.y:2078 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -4647,7 +4645,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2088 + //line php7/php7.y:2091 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -4659,7 +4657,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2101 + //line php7/php7.y:2104 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -4673,13 +4671,13 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2113 + //line php7/php7.y:2116 { yyVAL.node = yyDollar[1].node } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2118 + //line php7/php7.y:2121 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -4694,25 +4692,38 @@ yydefault: } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2133 + //line php7/php7.y:2137 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{nil, yyDollar[1].token} + yyVAL.node = stmt.NewNop() + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2134 + //line php7/php7.y:2147 { - yyVAL.nodesWithEndToken = &nodesWithEndToken{yyDollar[2].list, yyDollar[3].token} + yyVAL.node = stmt.NewStmtList(yyDollar[2].list) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2139 + //line php7/php7.y:2161 { yyVAL.list = yyDollar[1].list } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2141 + //line php7/php7.y:2163 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -4725,31 +4736,31 @@ yydefault: } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2155 + //line php7/php7.y:2177 { yyVAL.list = nil } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2157 + //line php7/php7.y:2179 { yyVAL.list = yyDollar[1].list } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2162 + //line php7/php7.y:2184 { yyVAL.list = []node.Node{yyDollar[1].node} } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2164 + //line php7/php7.y:2186 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2169 + //line php7/php7.y:2191 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4761,7 +4772,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2179 + //line php7/php7.y:2201 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4773,7 +4784,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2189 + //line php7/php7.y:2211 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4785,7 +4796,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2199 + //line php7/php7.y:2221 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4797,7 +4808,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2209 + //line php7/php7.y:2231 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4809,7 +4820,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2219 + //line php7/php7.y:2241 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4821,7 +4832,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2232 + //line php7/php7.y:2254 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4830,13 +4841,13 @@ yydefault: } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2239 + //line php7/php7.y:2261 { yyVAL.list = []node.Node{yyDollar[1].node} } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2244 + //line php7/php7.y:2266 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4852,7 +4863,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2258 + //line php7/php7.y:2280 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4869,7 +4880,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2276 + //line php7/php7.y:2298 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4878,13 +4889,13 @@ yydefault: } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2283 + //line php7/php7.y:2305 { yyVAL.list = []node.Node{yyDollar[1].node} } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2288 + //line php7/php7.y:2310 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4899,7 +4910,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2304 + //line php7/php7.y:2326 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4914,7 +4925,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2320 + //line php7/php7.y:2342 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4923,31 +4934,31 @@ yydefault: } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2327 + //line php7/php7.y:2349 { yyVAL.list = []node.Node{yyDollar[1].node} } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2332 + //line php7/php7.y:2354 { yyVAL.node = yyDollar[1].node } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2337 + //line php7/php7.y:2359 { yyVAL.list = nil } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2339 + //line php7/php7.y:2361 { yyVAL.list = yyDollar[1].list } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2344 + //line php7/php7.y:2366 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4956,13 +4967,13 @@ yydefault: } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2351 + //line php7/php7.y:2373 { yyVAL.list = []node.Node{yyDollar[1].node} } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:2356 + //line php7/php7.y:2378 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) @@ -4986,7 +4997,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2381 + //line php7/php7.y:2403 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -5001,7 +5012,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2394 + //line php7/php7.y:2416 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -5013,7 +5024,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2407 + //line php7/php7.y:2429 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5030,7 +5041,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:2422 + //line php7/php7.y:2444 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5046,7 +5057,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2436 + //line php7/php7.y:2458 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5058,7 +5069,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2446 + //line php7/php7.y:2468 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5071,7 +5082,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2457 + //line php7/php7.y:2479 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5083,7 +5094,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2467 + //line php7/php7.y:2489 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5095,7 +5106,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2477 + //line php7/php7.y:2499 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5107,7 +5118,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2487 + //line php7/php7.y:2509 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5119,7 +5130,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2497 + //line php7/php7.y:2519 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5131,7 +5142,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2507 + //line php7/php7.y:2529 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5143,7 +5154,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2517 + //line php7/php7.y:2539 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5155,7 +5166,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2527 + //line php7/php7.y:2549 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5167,7 +5178,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2537 + //line php7/php7.y:2559 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5179,7 +5190,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2547 + //line php7/php7.y:2569 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5191,7 +5202,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2557 + //line php7/php7.y:2579 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5203,7 +5214,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2567 + //line php7/php7.y:2589 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5215,7 +5226,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2577 + //line php7/php7.y:2599 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5227,7 +5238,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2587 + //line php7/php7.y:2609 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5239,7 +5250,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2597 + //line php7/php7.y:2619 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5251,7 +5262,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2607 + //line php7/php7.y:2629 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5263,7 +5274,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2617 + //line php7/php7.y:2639 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5275,7 +5286,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2627 + //line php7/php7.y:2649 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5287,7 +5298,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2637 + //line php7/php7.y:2659 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5299,7 +5310,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2647 + //line php7/php7.y:2669 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5311,7 +5322,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2657 + //line php7/php7.y:2679 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5323,7 +5334,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2667 + //line php7/php7.y:2689 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5335,7 +5346,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2677 + //line php7/php7.y:2699 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5347,7 +5358,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2687 + //line php7/php7.y:2709 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5359,7 +5370,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2697 + //line php7/php7.y:2719 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5371,7 +5382,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2707 + //line php7/php7.y:2729 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5383,7 +5394,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2717 + //line php7/php7.y:2739 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5395,7 +5406,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2727 + //line php7/php7.y:2749 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5407,7 +5418,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2737 + //line php7/php7.y:2759 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5419,7 +5430,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2747 + //line php7/php7.y:2769 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5431,7 +5442,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2757 + //line php7/php7.y:2779 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5443,7 +5454,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2767 + //line php7/php7.y:2789 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5455,7 +5466,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2777 + //line php7/php7.y:2799 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5467,7 +5478,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2787 + //line php7/php7.y:2809 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5479,7 +5490,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2797 + //line php7/php7.y:2819 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -5491,7 +5502,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2807 + //line php7/php7.y:2829 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -5503,7 +5514,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2817 + //line php7/php7.y:2839 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -5515,7 +5526,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2827 + //line php7/php7.y:2849 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -5527,7 +5538,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2837 + //line php7/php7.y:2859 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5539,7 +5550,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2847 + //line php7/php7.y:2869 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5551,7 +5562,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2857 + //line php7/php7.y:2879 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -5563,7 +5574,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2867 + //line php7/php7.y:2889 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -5575,7 +5586,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2877 + //line php7/php7.y:2899 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -5587,7 +5598,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2887 + //line php7/php7.y:2909 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5599,7 +5610,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2897 + //line php7/php7.y:2919 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -5611,7 +5622,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2907 + //line php7/php7.y:2929 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5623,7 +5634,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2917 + //line php7/php7.y:2939 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -5635,7 +5646,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2927 + //line php7/php7.y:2949 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -5647,7 +5658,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2937 + //line php7/php7.y:2959 { yyVAL.node = yyDollar[2].node @@ -5657,13 +5668,13 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2945 + //line php7/php7.y:2967 { yyVAL.node = yyDollar[1].node } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:2947 + //line php7/php7.y:2969 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -5676,7 +5687,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2958 + //line php7/php7.y:2980 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -5689,7 +5700,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2969 + //line php7/php7.y:2991 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -5701,13 +5712,13 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2979 + //line php7/php7.y:3001 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2981 + //line php7/php7.y:3003 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -5719,7 +5730,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2991 + //line php7/php7.y:3013 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -5731,7 +5742,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3001 + //line php7/php7.y:3023 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -5743,7 +5754,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3011 + //line php7/php7.y:3033 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -5755,7 +5766,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3021 + //line php7/php7.y:3043 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -5767,7 +5778,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3031 + //line php7/php7.y:3053 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -5779,7 +5790,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3041 + //line php7/php7.y:3063 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -5791,7 +5802,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3051 + //line php7/php7.y:3073 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -5807,7 +5818,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3065 + //line php7/php7.y:3087 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -5819,13 +5830,13 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3075 + //line php7/php7.y:3097 { yyVAL.node = yyDollar[1].node } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3077 + //line php7/php7.y:3099 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -5838,7 +5849,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3088 + //line php7/php7.y:3110 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -5850,7 +5861,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3098 + //line php7/php7.y:3120 { yyVAL.node = expr.NewYield(nil, nil) @@ -5862,7 +5873,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3108 + //line php7/php7.y:3130 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -5874,7 +5885,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3118 + //line php7/php7.y:3140 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -5887,7 +5898,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3129 + //line php7/php7.y:3151 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -5899,7 +5910,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3139 + //line php7/php7.y:3161 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].boolWithToken.value, yyDollar[3].str) @@ -5918,7 +5929,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:3156 + //line php7/php7.y:3178 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].list, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].boolWithToken.value, yyDollar[4].str) @@ -5938,38 +5949,38 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3177 + //line php7/php7.y:3199 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3185 + //line php7/php7.y:3207 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3187 + //line php7/php7.y:3209 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3192 + //line php7/php7.y:3214 { yyVAL.list = []node.Node{} } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3194 + //line php7/php7.y:3216 { yyVAL.list = yyDollar[3].list } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3199 + //line php7/php7.y:3221 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5978,13 +5989,13 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3206 + //line php7/php7.y:3228 { yyVAL.list = []node.Node{yyDollar[1].node} } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3211 + //line php7/php7.y:3233 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6000,7 +6011,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3225 + //line php7/php7.y:3247 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6017,7 +6028,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3243 + //line php7/php7.y:3265 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6026,7 +6037,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3250 + //line php7/php7.y:3272 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6038,7 +6049,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3260 + //line php7/php7.y:3282 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6050,7 +6061,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3270 + //line php7/php7.y:3292 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6059,7 +6070,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3280 + //line php7/php7.y:3302 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6071,67 +6082,67 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3290 + //line php7/php7.y:3312 { yyVAL.node = yyDollar[1].node } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3295 + //line php7/php7.y:3317 { yyVAL.node = yyDollar[1].node } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3297 + //line php7/php7.y:3319 { yyVAL.node = yyDollar[1].node } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3302 + //line php7/php7.y:3324 { yyVAL.node = nil } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3304 + //line php7/php7.y:3326 { yyVAL.node = yyDollar[2].node } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3309 + //line php7/php7.y:3331 { yyVAL.list = []node.Node{} } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3311 + //line php7/php7.y:3333 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3313 + //line php7/php7.y:3335 { yyVAL.list = yyDollar[1].list } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3318 + //line php7/php7.y:3340 { yyVAL.node = nil } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3320 + //line php7/php7.y:3342 { yyVAL.node = yyDollar[1].node } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3325 + //line php7/php7.y:3347 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6145,7 +6156,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3337 + //line php7/php7.y:3359 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6158,7 +6169,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3348 + //line php7/php7.y:3370 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6170,7 +6181,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3361 + //line php7/php7.y:3383 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6182,7 +6193,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3371 + //line php7/php7.y:3393 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6194,7 +6205,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3381 + //line php7/php7.y:3403 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6206,7 +6217,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3391 + //line php7/php7.y:3413 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6218,7 +6229,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3401 + //line php7/php7.y:3423 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6230,7 +6241,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3411 + //line php7/php7.y:3433 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6242,7 +6253,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3421 + //line php7/php7.y:3443 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6254,7 +6265,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3431 + //line php7/php7.y:3453 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6266,7 +6277,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3441 + //line php7/php7.y:3463 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6278,7 +6289,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3451 + //line php7/php7.y:3473 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6290,7 +6301,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3461 + //line php7/php7.y:3483 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -6304,7 +6315,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3473 + //line php7/php7.y:3495 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -6316,7 +6327,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3483 + //line php7/php7.y:3505 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -6328,7 +6339,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3493 + //line php7/php7.y:3515 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -6340,19 +6351,19 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3503 + //line php7/php7.y:3525 { yyVAL.node = yyDollar[1].node } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3505 + //line php7/php7.y:3527 { yyVAL.node = yyDollar[1].node } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3510 + //line php7/php7.y:3532 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -6361,7 +6372,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3517 + //line php7/php7.y:3539 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6376,7 +6387,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3530 + //line php7/php7.y:3552 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6391,43 +6402,43 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3546 + //line php7/php7.y:3568 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3548 + //line php7/php7.y:3570 { yyVAL.node = yyDollar[1].node } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3553 + //line php7/php7.y:3575 { yyVAL.node = nil } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3555 + //line php7/php7.y:3577 { yyVAL.node = yyDollar[1].node } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3560 + //line php7/php7.y:3582 { yyVAL.node = yyDollar[1].node } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3565 + //line php7/php7.y:3587 { yyVAL.node = yyDollar[1].node } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3567 + //line php7/php7.y:3589 { yyVAL.node = yyDollar[2].node @@ -6437,19 +6448,19 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3575 + //line php7/php7.y:3597 { yyVAL.node = yyDollar[1].node } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3580 + //line php7/php7.y:3602 { yyVAL.node = yyDollar[1].node } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3582 + //line php7/php7.y:3604 { yyVAL.node = yyDollar[2].node @@ -6459,19 +6470,19 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3590 + //line php7/php7.y:3612 { yyVAL.node = yyDollar[1].node } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3595 + //line php7/php7.y:3617 { yyVAL.node = yyDollar[1].node } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3597 + //line php7/php7.y:3619 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6484,7 +6495,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3608 + //line php7/php7.y:3630 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6497,7 +6508,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3619 + //line php7/php7.y:3641 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6510,7 +6521,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3630 + //line php7/php7.y:3652 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6522,25 +6533,25 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3640 + //line php7/php7.y:3662 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3645 + //line php7/php7.y:3667 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3647 + //line php7/php7.y:3669 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3649 + //line php7/php7.y:3671 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6552,7 +6563,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3662 + //line php7/php7.y:3684 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6566,7 +6577,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3674 + //line php7/php7.y:3696 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -6580,7 +6591,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3686 + //line php7/php7.y:3708 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6592,7 +6603,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3699 + //line php7/php7.y:3721 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6604,7 +6615,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3709 + //line php7/php7.y:3731 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6616,13 +6627,13 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3722 + //line php7/php7.y:3744 { yyVAL.node = yyDollar[1].node } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3724 + //line php7/php7.y:3746 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6635,7 +6646,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3735 + //line php7/php7.y:3757 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6648,7 +6659,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3746 + //line php7/php7.y:3768 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6660,7 +6671,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3756 + //line php7/php7.y:3778 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6672,7 +6683,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3766 + //line php7/php7.y:3788 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6684,7 +6695,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3779 + //line php7/php7.y:3801 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6696,7 +6707,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3789 + //line php7/php7.y:3811 { yyVAL.node = yyDollar[2].node @@ -6706,13 +6717,13 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3797 + //line php7/php7.y:3819 { yyVAL.node = yyDollar[1].node } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3802 + //line php7/php7.y:3824 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6724,7 +6735,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3812 + //line php7/php7.y:3834 { yyVAL.node = yyDollar[2].node @@ -6734,13 +6745,13 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3820 + //line php7/php7.y:3842 { yyVAL.node = yyDollar[1].node } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3825 + //line php7/php7.y:3847 { if yyDollar[1].list[len(yyDollar[1].list)-1] == nil { yyVAL.list = yyDollar[1].list[:len(yyDollar[1].list)-1] @@ -6750,19 +6761,19 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3836 + //line php7/php7.y:3858 { yyVAL.node = nil } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3838 + //line php7/php7.y:3860 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3843 + //line php7/php7.y:3865 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6771,13 +6782,13 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3850 + //line php7/php7.y:3872 { yyVAL.list = []node.Node{yyDollar[1].node} } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3855 + //line php7/php7.y:3877 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) @@ -6789,7 +6800,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3865 + //line php7/php7.y:3887 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) @@ -6798,7 +6809,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3872 + //line php7/php7.y:3894 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) @@ -6811,7 +6822,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3883 + //line php7/php7.y:3905 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[2].node, true) @@ -6823,7 +6834,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3893 + //line php7/php7.y:3915 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -6841,7 +6852,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3909 + //line php7/php7.y:3931 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -6858,13 +6869,13 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3927 + //line php7/php7.y:3949 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3929 + //line php7/php7.y:3951 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -6877,13 +6888,13 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3940 + //line php7/php7.y:3962 { yyVAL.list = []node.Node{yyDollar[1].node} } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3942 + //line php7/php7.y:3964 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -6896,7 +6907,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3956 + //line php7/php7.y:3978 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6910,7 +6921,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3968 + //line php7/php7.y:3990 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6928,7 +6939,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3984 + //line php7/php7.y:4006 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6948,7 +6959,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4002 + //line php7/php7.y:4024 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6961,7 +6972,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4013 + //line php7/php7.y:4035 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -6977,7 +6988,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:4027 + //line php7/php7.y:4049 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -6997,13 +7008,13 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4045 + //line php7/php7.y:4067 { yyVAL.node = yyDollar[2].node } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4051 + //line php7/php7.y:4073 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7015,7 +7026,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4061 + //line php7/php7.y:4083 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7032,7 +7043,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4076 + //line php7/php7.y:4098 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -7063,7 +7074,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4105 + //line php7/php7.y:4127 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(identifier) @@ -7077,7 +7088,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:4120 + //line php7/php7.y:4142 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -7094,7 +7105,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4135 + //line php7/php7.y:4157 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -7108,7 +7119,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4147 + //line php7/php7.y:4169 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -7120,7 +7131,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4157 + //line php7/php7.y:4179 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -7132,7 +7143,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4167 + //line php7/php7.y:4189 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -7146,7 +7157,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4179 + //line php7/php7.y:4201 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -7158,7 +7169,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4189 + //line php7/php7.y:4211 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -7170,13 +7181,13 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4202 + //line php7/php7.y:4224 { yyVAL.list = []node.Node{yyDollar[1].node} } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4204 + //line php7/php7.y:4226 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -7185,7 +7196,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4214 + //line php7/php7.y:4236 { yyVAL.node = yyDollar[1].node } diff --git a/php7/php7.y b/php7/php7.y index 6d1e26b..47b09c1 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -25,7 +25,6 @@ import ( boolWithToken boolWithToken list []node.Node foreachVariable foreachVariable - nodesWithEndToken *nodesWithEndToken str string altSyntaxNode altSyntaxNode } @@ -266,12 +265,12 @@ import ( %type argument_list ctor_arguments %type trait_adaptations %type switch_case_list +%type method_body %type member_modifier %type use_type %type foreach_variable -%type method_body %type encaps_list backticks_expr namespace_name catch_name_list catch_list class_const_list %type const_list echo_expr_list for_exprs non_empty_for_exprs global_var_list @@ -1945,11 +1944,15 @@ class_statement: | method_modifiers T_FUNCTION returns_ref identifier backup_doc_comment '(' parameter_list ')' return_type method_body { name := node.NewIdentifier($4.Value) - $$ = stmt.NewClassMethod(name, $1, $3.value, $7, $9, $10.nodes, $5) + $$ = stmt.NewClassMethod(name, $1, $3.value, $7, $9, $10, $5) // save position yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $10.endToken)) + if $1 == nil { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $10)) + } else { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListNodePosition($1, $10)) + } // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.FunctionToken) @@ -2130,8 +2133,27 @@ absolute_trait_method_reference: ; method_body: - ';' /* abstract method */ { $$ = &nodesWithEndToken{nil, $1} } - | '{' inner_statement_list '}' { $$ = &nodesWithEndToken{$2, $3} } + ';' /* abstract method */ + { + $$ = stmt.NewNop() + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) + } + | '{' inner_statement_list '}' + { + $$ = stmt.NewStmtList($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) + } ; variable_modifiers: @@ -4223,11 +4245,6 @@ type foreachVariable struct { byRef bool } -type nodesWithEndToken struct { - nodes []node.Node - endToken *scanner.Token -} - type boolWithToken struct { value bool token *scanner.Token diff --git a/php7/php7_test.go b/php7/php7_test.go index d10d83c..5db2890 100644 --- a/php7/php7_test.go +++ b/php7/php7_test.go @@ -549,7 +549,9 @@ func TestPhp7(t *testing.T) { MethodName: &node.Identifier{Value: "foo"}, Modifiers: []node.Node{&node.Identifier{Value: "public"}}, Params: expectedParams, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, }, }, @@ -866,7 +868,9 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ PhpDocComment: "", MethodName: &node.Identifier{Value: "bar"}, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, }, }, @@ -881,7 +885,9 @@ func TestPhp7(t *testing.T) { &node.Identifier{Value: "public"}, &node.Identifier{Value: "static"}, }, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, }, }, @@ -901,7 +907,9 @@ func TestPhp7(t *testing.T) { &name.NamePart{Value: "void"}, }, }, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, }, }, @@ -2966,7 +2974,9 @@ func TestPhp7(t *testing.T) { &stmt.ClassMethod{ MethodName: &node.Identifier{Value: "class"}, Modifiers: []node.Node{&node.Identifier{Value: "public"}}, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, }, }, @@ -3072,6 +3082,7 @@ func TestPhp7(t *testing.T) { &node.Identifier{Value: "protected"}, &node.Identifier{Value: "static"}, }, + Stmt: &stmt.Nop{}, }, &stmt.ClassMethod{ MethodName: &node.Identifier{Value: "baz"}, @@ -3079,7 +3090,9 @@ func TestPhp7(t *testing.T) { &node.Identifier{Value: "final"}, &node.Identifier{Value: "private"}, }, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, }, }, }, diff --git a/printer/printer.go b/printer/printer.go index dff39fe..df62c20 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1517,13 +1517,18 @@ func (p *Printer) printStmtClassMethod(n node.Node) { p.Print(nn.ReturnType) } - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "{\n") - p.printNodes(nn.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "}") + switch s := nn.Stmt.(type) { + case *stmt.StmtList: + io.WriteString(p.w, "\n") + p.printIndent() + io.WriteString(p.w, "{\n") + p.printNodes(s.Stmts) + io.WriteString(p.w, "\n") + p.printIndent() + io.WriteString(p.w, "}") + default: + p.Print(s) + } } func (p *Printer) printStmtClass(n node.Node) { diff --git a/printer/printer_test.go b/printer/printer_test.go index 44c37b7..a34997e 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -44,10 +44,12 @@ func TestPrintFile(t *testing.T) { &stmt.ClassMethod{ Modifiers: []node.Node{&node.Identifier{Value: "public"}}, MethodName: &node.Identifier{Value: "greet"}, - Stmts: []node.Node{ - &stmt.Echo{ - Exprs: []node.Node{ - &scalar.String{Value: "'Hello world'"}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Echo{ + Exprs: []node.Node{ + &scalar.String{Value: "'Hello world'"}, + }, }, }, }, @@ -2453,8 +2455,10 @@ func TestPrintStmtClassMethod(t *testing.T) { }, }, ReturnType: &name.Name{Parts: []node.Node{&name.NamePart{Value: "void"}}}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + }, }, }) @@ -3387,8 +3391,10 @@ func TestPrintInterface(t *testing.T) { Modifiers: []node.Node{&node.Identifier{Value: "public"}}, MethodName: &node.Identifier{Value: "foo"}, Params: []node.Node{}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + }, }, }, }, @@ -3833,8 +3839,10 @@ func TestPrintTrait(t *testing.T) { Modifiers: []node.Node{&node.Identifier{Value: "public"}}, MethodName: &node.Identifier{Value: "foo"}, Params: []node.Node{}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + }, }, }, }, diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go index 0f79ff4..06ae681 100644 --- a/visitor/dumper_test.go +++ b/visitor/dumper_test.go @@ -63,8 +63,8 @@ func ExampleDumper() { //| "Stmts": //| [*stmt.ClassMethod] //| "Position": Pos{Line: 5-9 Pos: 45-134}; - //| "PhpDocComment": ; //| "ReturnsRef": false; + //| "PhpDocComment": ; //| "MethodName": //| [*node.Identifier] //| "Position": Pos{Line: 5-5 Pos: 61-72}; @@ -104,16 +104,19 @@ func ExampleDumper() { //| [*name.NamePart] //| "Position": Pos{Line: 5-5 Pos: 86-89}; //| "Value": null; - //| "Stmts": - //| [*stmt.Expression] - //| "Position": Pos{Line: 8-8 Pos: 124-128}; - //| "Expr": - //| [*expr.Variable] - //| "Position": Pos{Line: 8-8 Pos: 124-127}; - //| "Comments": - //| "// some comment\n" before "VariableToken" - //| "VarName": - //| [*node.Identifier] + //| "Stmt": + //| [*stmt.StmtList] + //| "Position": Pos{Line: 6-9 Pos: 96-134}; + //| "Stmts": + //| [*stmt.Expression] + //| "Position": Pos{Line: 8-8 Pos: 124-128}; + //| "Expr": + //| [*expr.Variable] //| "Position": Pos{Line: 8-8 Pos: 124-127}; - //| "Value": var; + //| "Comments": + //| "// some comment\n" before "VariableToken" + //| "VarName": + //| [*node.Identifier] + //| "Position": Pos{Line: 8-8 Pos: 124-127}; + //| "Value": var; } diff --git a/visitor/namespace_resolver_test.go b/visitor/namespace_resolver_test.go index e9cbe65..a6f3131 100644 --- a/visitor/namespace_resolver_test.go +++ b/visitor/namespace_resolver_test.go @@ -544,7 +544,9 @@ func TestResolveMethodName(t *testing.T) { }, }, ReturnType: &node.Nullable{Expr: nameBC}, - Stmts: []node.Node{}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, } expected := map[node.Node]string{ From e93874f644c9454401de22f2ccd1927a3c42c52f Mon Sep 17 00:00:00 2001 From: z7zmey Date: Wed, 2 May 2018 03:36:53 +0300 Subject: [PATCH 18/25] remove altSintaxNode type --- php5/php5.go | 1406 ++++++++++++++++++++++++++------------------------ php5/php5.y | 144 ++++-- php7/php7.go | 1285 +++++++++++++++++++++++---------------------- php7/php7.y | 138 +++-- 4 files changed, 1575 insertions(+), 1398 deletions(-) diff --git a/php5/php5.go b/php5/php5.go index ad8d884..0a4c39a 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -28,7 +28,6 @@ type yySymType struct { list []node.Node foreachVariable foreachVariable simpleIndirectReference simpleIndirectReference - altSyntaxNode altSyntaxNode } const T_INCLUDE = 57346 @@ -343,7 +342,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:3935 +//line php5/php5.y:3994 type foreachVariable struct { node node.Node @@ -360,11 +359,6 @@ type simpleIndirectReference struct { last *expr.Variable } -type altSyntaxNode struct { - node node.Node - isAlt bool -} - //line yacctab:1 var yyExca = [...]int{ -1, 1, @@ -706,18 +700,18 @@ var yyAct = [...]int{ 531, 922, 481, 259, 283, 908, 449, 395, 256, 39, 446, 324, 521, 936, 203, 285, 260, 261, 469, 260, 261, 232, 202, 199, 136, 879, 909, 531, 260, 261, - 944, 519, 521, 335, 231, 521, 873, 829, 521, 747, - 572, 962, 572, 970, 39, 753, 39, 812, 703, 704, - 706, 703, 704, 863, 39, 445, 39, 39, 608, 589, - 521, 590, 591, 260, 261, 572, 970, 260, 261, 956, - 982, 684, 958, 39, 255, 961, 839, 39, 39, 521, - 994, 572, 964, 963, 993, 902, 572, 995, 483, 997, - 403, 895, 838, 835, 914, 575, 916, 979, 566, 448, - 1005, 1004, 39, 572, 1011, 531, 924, 724, 926, 927, - 1012, 531, 531, 394, 572, 1015, 992, 389, 164, 919, - 39, 232, 919, 232, 341, 558, 697, 538, 928, 290, - 460, 943, 161, 157, 231, 947, 231, 318, 948, 531, - 314, 127, 1008, 343, 39, 938, 528, 607, 996, 969, + 829, 519, 521, 747, 231, 521, 873, 753, 521, 863, + 572, 962, 572, 970, 39, 445, 39, 812, 703, 704, + 706, 703, 704, 608, 39, 589, 39, 39, 590, 591, + 521, 684, 255, 260, 261, 572, 970, 260, 261, 956, + 982, 839, 958, 39, 994, 961, 964, 39, 39, 521, + 963, 572, 902, 483, 993, 403, 572, 995, 895, 997, + 838, 835, 575, 566, 914, 1005, 916, 979, 1004, 448, + 724, 394, 39, 572, 1011, 531, 924, 389, 926, 927, + 1012, 531, 531, 164, 572, 1015, 992, 341, 697, 919, + 39, 232, 919, 232, 538, 558, 928, 290, 460, 161, + 157, 943, 318, 314, 231, 947, 231, 127, 948, 531, + 335, 944, 1008, 343, 39, 938, 528, 607, 996, 969, 39, 968, 945, 967, 966, 837, 836, 834, 401, 40, 568, 15, 14, 822, 972, 719, 801, 694, 11, 249, 75, 232, 76, 116, 266, 64, 89, 598, 90, 520, @@ -1632,41 +1626,41 @@ var yyPgo = [...]int{ 73, 68, 61, 1068, 1067, 1066, 35, 1065, 1063, 4, 1062, 1061, 1060, 17, 1059, 1058, 1057, 1056, 1055, 51, 5, 1054, 1053, 1051, 1049, 1048, 2, 1047, 631, 1046, - 18, 22, 1045, 1043, 1042, 39, 0, 1041, 1040, 1037, - 117, 1033, 1032, 553, 1030, 1029, 42, 8, 1028, 9, - 1027, 1026, 1024, 14, 49, 1018, 1017, 1013, 1007, 1001, - 1000, 3, 998, 16, 995, 993, 992, 991, 990, 28, - 988, 985, 983, 982, 980, 976, 974, 21, 971, 962, - 961, 25, 959, 23, 12, 958, 40, 955, 953, 945, - 939, 41, 6, 19, 13, 937, 933, 930, 15, 853, + 18, 22, 1045, 1043, 1042, 15, 1041, 1040, 39, 0, + 1037, 1033, 1032, 117, 1030, 1029, 553, 1028, 1027, 42, + 8, 1026, 9, 1024, 1018, 1017, 14, 49, 1013, 1007, + 1001, 1000, 998, 995, 3, 993, 16, 992, 991, 990, + 988, 985, 28, 983, 982, 980, 976, 974, 971, 962, + 21, 961, 959, 958, 25, 955, 23, 12, 953, 40, + 945, 939, 937, 933, 41, 6, 19, 13, 930, 853, 7, 20, } var yyR1 = [...]int{ - 0, 149, 85, 85, 86, 86, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 87, 87, - 4, 4, 4, 4, 88, 88, 5, 5, 5, 5, - 89, 89, 6, 6, 6, 6, 53, 53, 90, 90, + 0, 149, 88, 88, 89, 89, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 90, 90, + 4, 4, 4, 4, 91, 91, 5, 5, 5, 5, + 92, 92, 6, 6, 6, 6, 53, 53, 93, 93, 24, 24, 24, 24, 24, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 108, 108, 58, 58, 109, - 109, 110, 110, 59, 106, 106, 56, 51, 52, 144, - 144, 145, 145, 60, 61, 61, 64, 64, 64, 64, - 65, 65, 2, 118, 118, 114, 114, 119, 119, 143, - 143, 142, 142, 142, 147, 147, 148, 148, 57, 57, - 107, 107, 83, 83, 83, 83, 104, 104, 104, 150, - 150, 146, 146, 100, 100, 101, 101, 54, 54, 55, - 55, 111, 111, 112, 112, 63, 63, 62, 62, 62, - 62, 81, 81, 81, 120, 120, 69, 69, 69, 69, - 91, 91, 27, 27, 27, 92, 92, 92, 92, 113, - 113, 66, 66, 66, 66, 68, 121, 121, 82, 82, - 122, 122, 123, 123, 70, 70, 71, 124, 124, 74, - 74, 73, 72, 72, 75, 75, 84, 84, 115, 115, - 116, 116, 125, 125, 76, 76, 76, 76, 76, 76, - 117, 117, 117, 117, 67, 67, 105, 105, 103, 103, - 102, 102, 131, 131, 129, 129, 130, 130, 130, 132, - 132, 42, 15, 15, 15, 15, 15, 15, 15, 15, + 26, 26, 26, 26, 26, 111, 111, 58, 58, 112, + 112, 113, 113, 59, 109, 109, 56, 51, 52, 147, + 147, 148, 148, 60, 61, 61, 64, 64, 64, 64, + 65, 65, 2, 121, 121, 117, 117, 122, 122, 146, + 146, 145, 145, 145, 86, 86, 85, 85, 57, 57, + 110, 110, 83, 83, 83, 83, 107, 107, 107, 150, + 150, 87, 87, 103, 103, 104, 104, 54, 54, 55, + 55, 114, 114, 115, 115, 63, 63, 62, 62, 62, + 62, 81, 81, 81, 123, 123, 69, 69, 69, 69, + 94, 94, 27, 27, 27, 95, 95, 95, 95, 116, + 116, 66, 66, 66, 66, 68, 124, 124, 82, 82, + 125, 125, 126, 126, 70, 70, 71, 127, 127, 74, + 74, 73, 72, 72, 75, 75, 84, 84, 118, 118, + 119, 119, 128, 128, 76, 76, 76, 76, 76, 76, + 120, 120, 120, 120, 67, 67, 108, 108, 106, 106, + 105, 105, 134, 134, 132, 132, 133, 133, 133, 135, + 135, 42, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, @@ -1674,27 +1668,27 @@ var yyR1 = [...]int{ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 50, 50, 50, 50, - 47, 47, 47, 47, 46, 46, 1, 99, 99, 98, - 98, 98, 98, 23, 23, 23, 23, 23, 23, 23, + 47, 47, 47, 47, 46, 46, 1, 102, 102, 101, + 101, 101, 101, 23, 23, 23, 23, 23, 23, 23, 23, 11, 11, 11, 11, 45, 45, 45, 43, 43, - 41, 41, 139, 139, 138, 49, 49, 49, 126, 126, - 126, 80, 80, 7, 7, 7, 7, 7, 7, 7, + 41, 41, 142, 142, 141, 49, 49, 49, 129, 129, + 129, 80, 80, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 28, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 35, 35, 35, 35, 29, 29, 29, 29, 29, 29, - 29, 127, 127, 151, 151, 128, 128, 128, 128, 14, - 14, 48, 48, 16, 17, 18, 19, 19, 140, 140, - 133, 135, 135, 77, 134, 134, 134, 40, 40, 44, + 29, 130, 130, 151, 151, 131, 131, 131, 131, 14, + 14, 48, 48, 16, 17, 18, 19, 19, 143, 143, + 136, 138, 138, 77, 137, 137, 137, 40, 40, 44, 44, 12, 22, 22, 20, 20, 20, 21, 21, 21, - 10, 10, 10, 9, 9, 13, 13, 136, 136, 137, - 137, 137, 39, 39, 141, 141, 97, 97, 38, 38, - 38, 96, 96, 95, 95, 95, 95, 95, 95, 95, - 95, 93, 93, 93, 93, 33, 33, 33, 33, 33, + 10, 10, 10, 9, 9, 13, 13, 139, 139, 140, + 140, 140, 39, 39, 144, 144, 100, 100, 38, 38, + 38, 99, 99, 98, 98, 98, 98, 98, 98, 98, + 98, 96, 96, 96, 96, 33, 33, 33, 33, 33, 33, 34, 34, 34, 37, 37, 37, 37, 37, 37, - 37, 37, 94, 94, 36, 36, 30, 30, 31, 32, + 37, 37, 97, 97, 36, 36, 30, 30, 31, 32, } var yyR2 = [...]int{ @@ -1753,7 +1747,7 @@ var yyR2 = [...]int{ } var yyChk = [...]int{ - -1000, -149, -85, -3, 2, -25, -51, -52, 51, 79, + -1000, -149, -88, -3, 2, -25, -51, -52, 51, 79, 44, -53, -26, 10, -60, -61, 38, 142, 7, 21, 20, 23, 30, 34, 35, 39, -50, 46, 98, 19, 14, -14, 48, 25, 27, 144, 40, 43, 36, -1, @@ -1763,99 +1757,99 @@ var yyChk = [...]int{ 112, 113, 6, 156, -29, -47, -46, 141, 96, -20, 91, 49, 50, 4, 5, 84, 85, 86, 11, -35, -32, -7, 140, 74, 62, 18, 60, 148, -21, -22, - -23, -30, -86, 82, -11, 8, 9, 66, 67, 81, - 63, 64, 65, 80, -10, -141, -44, -12, -40, -9, - 157, 12, 146, -86, 142, 82, 10, -87, 37, 38, - -4, -86, 82, 144, 158, 145, 10, -90, -48, 146, + -23, -30, -89, 82, -11, 8, 9, 66, 67, 81, + 63, 64, 65, 80, -10, -144, -44, -12, -40, -9, + 157, 12, 146, -89, 142, 82, 10, -90, 37, 38, + -4, -89, 82, 144, 158, 145, 10, -93, -48, 146, -48, -25, -1, 79, 146, -48, 144, -14, 97, 98, - 144, -14, 144, -15, -19, -14, 144, -91, -27, 12, - 157, -92, -1, 12, -105, -14, 144, 129, 130, 87, + 144, -14, 144, -15, -19, -14, 144, -94, -27, 12, + 157, -95, -1, 12, -108, -14, 144, 129, 130, 87, 89, 88, 159, 151, 161, 167, 153, 152, 162, 131, 163, 164, 132, 133, 134, 135, 136, 137, 165, 138, 166, 139, 90, 150, 146, 146, 146, 142, -14, 10, - -144, 151, 10, 10, -15, -19, -14, 52, 52, 160, + -147, 151, 10, 10, -15, -19, -14, 52, 52, 160, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 146, -14, 104, 105, -18, -19, -86, 79, + 127, 128, 146, -14, 104, 105, -18, -19, -89, 79, 82, -11, -12, 98, -18, -14, -14, -14, -14, -42, -14, -50, -14, -14, -14, -14, -14, -14, -14, -49, - 146, -48, -14, 148, 148, -126, 17, -93, -33, 12, - 76, 77, -14, 57, -43, -11, -41, -86, 79, 82, - -21, -10, -141, -12, 146, 146, -14, -14, 146, -14, - -14, 148, -93, 17, 17, 75, -93, 148, 146, -96, - -95, -14, 151, 148, 148, 82, -81, 146, -86, 78, + 146, -48, -14, 148, 148, -129, 17, -96, -33, 12, + 76, 77, -14, 57, -43, -11, -41, -89, 79, 82, + -21, -10, -144, -12, 146, 146, -14, -14, 146, -14, + -14, 148, -96, 17, 17, 75, -96, 148, 146, -99, + -98, -14, 151, 148, 148, 82, -81, 146, -89, 78, 148, 142, -10, 157, 78, -81, 142, 147, 144, 142, - -85, -86, 144, 158, -88, -5, -86, 82, -89, -6, - -86, 82, 29, -86, 10, 160, -24, 143, 2, -25, - -51, -52, 51, -25, 145, -146, -25, 145, 21, -144, - -103, -102, -14, -83, 142, 145, 144, 144, 144, 144, - 144, 158, -16, 142, -19, 144, 158, -144, 160, 144, + -88, -89, 144, 158, -91, -5, -89, 82, -92, -6, + -89, 82, 29, -89, 10, 160, -24, 143, 2, -25, + -51, -52, 51, -25, 145, -87, -25, 145, 21, -147, + -106, -105, -14, -83, 142, 145, 144, 144, 144, 144, + 144, 158, -16, 142, -19, 144, 158, -147, 160, 144, 158, -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, -43, -14, 145, -106, - -56, -19, -19, -15, -107, 10, -90, 144, 144, 10, - 146, -65, 55, -118, 55, 58, -14, 151, -14, -14, + -14, -14, -14, -14, -14, -14, -43, -14, 145, -109, + -56, -19, -19, -15, -110, 10, -93, 144, 144, 10, + 146, -65, 55, -121, 55, 58, -14, 151, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -97, -38, -19, 59, 82, -86, 78, 78, 147, 147, + -100, -38, -19, 59, 82, -89, 78, 78, 147, 147, 147, 147, -13, -14, -13, 141, -33, -33, 17, 148, - 57, -14, 11, -19, -136, -137, -40, -39, -10, -141, - 10, 142, -80, -81, 78, 82, -86, 57, -10, 78, - -94, -36, -19, -15, -19, -15, -14, -13, 140, 75, - 75, -13, -96, 149, -151, 158, 58, -17, -19, -13, - -13, 10, 147, -120, -50, -69, -15, -19, 151, 83, + 57, -14, 11, -19, -139, -140, -40, -39, -10, -144, + 10, 142, -80, -81, 78, 82, -89, 57, -10, 78, + -97, -36, -19, -15, -19, -15, -14, -13, 140, 75, + 75, -13, -99, 149, -151, 158, 58, -17, -19, -13, + -13, 10, 147, -123, -50, -69, -15, -19, 151, 83, -81, -39, -40, 10, 52, -13, -14, -39, -40, 10, - -14, 144, -85, 143, -81, -4, 144, 158, 29, -86, - 144, 158, 29, -86, 10, 29, 160, -28, -78, -7, - -31, -86, 79, 82, 60, 148, -8, 62, -79, 18, - 74, -11, 154, 155, 153, 152, 146, 146, -100, -90, - -90, -48, 144, 158, -104, 144, -104, 144, -27, -14, + -14, 144, -88, 143, -81, -4, 144, 158, 29, -89, + 144, 158, 29, -89, 10, 29, 160, -28, -78, -7, + -31, -89, 79, 82, 60, 148, -8, 62, -79, 18, + 74, -11, 154, 155, 153, 152, 146, 146, -103, -93, + -93, -48, 144, 158, -107, 144, -107, 144, -27, -14, 12, 146, -28, -14, 145, -14, 147, 158, 29, 29, - 147, 158, 160, 143, 146, -111, -112, -63, -62, 60, - 61, -45, -86, 79, 82, -114, 56, -45, 142, -119, - -45, -15, -19, -19, 91, 147, 158, 146, -86, -132, - -130, -129, -131, 148, -133, 57, 149, 149, -34, 10, - 13, 12, 10, 143, 148, 143, -134, -77, -135, -81, - 148, 142, -10, -14, -40, -86, -136, -40, 147, 158, + 147, 158, 160, 143, 146, -114, -115, -63, -62, 60, + 61, -45, -89, 79, 82, -117, 56, -45, 142, -122, + -45, -15, -19, -19, 91, 147, 158, 146, -89, -135, + -133, -132, -134, 148, -136, 57, 149, 149, -34, 10, + 13, 12, 10, 143, 148, 143, -137, -77, -138, -81, + 148, 142, -10, -14, -40, -89, -139, -40, 147, 158, 147, 147, 147, 149, 149, 147, -14, 151, -14, 151, 149, 149, 147, 158, 147, -17, -14, -81, -81, 149, 143, -81, -81, 143, 143, -5, 10, 29, -6, 10, 29, 10, -28, 148, 153, 152, 162, 131, 163, 164, 159, 151, 161, 132, 133, 167, 88, 89, 87, 130, 129, 134, 135, 136, 137, 165, 166, 138, 139, 150, - 82, -86, 146, -127, -128, -78, 17, 78, -78, -78, - -78, -78, -78, 147, -54, 93, 94, -101, 22, 144, - -103, -14, 143, 32, 33, -104, 31, -104, 143, 160, - -111, -14, 144, -56, -142, -19, 151, 59, -142, -57, - -25, 145, 10, -28, -108, 41, -111, 147, 158, -144, - 82, -86, 142, -119, -113, 158, -43, 160, -38, -97, - 148, -131, -133, -13, -136, 149, -14, -140, 148, 148, - -13, -14, 143, -139, -36, 58, -17, -17, -69, 10, + 82, -89, 146, -130, -131, -78, 17, 78, -78, -78, + -78, -78, -78, 147, -54, 93, 94, -104, 22, 144, + -106, -14, 143, 32, 33, -107, 31, -107, 143, 160, + -114, -14, 144, -56, -145, -19, 151, 59, -145, -57, + -25, 145, 10, -28, -111, 41, -114, 147, 158, -147, + 82, -89, 142, -122, -116, 158, -43, 160, -38, -100, + 148, -134, -136, -13, -139, 149, -14, -143, 148, 148, + -13, -14, 143, -142, -36, 58, -17, -17, -69, 10, 10, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, 145, -78, -86, - -127, 149, -151, 158, 58, 10, 52, 147, 144, -48, + -78, -78, -78, -78, -78, -78, -78, 145, -78, -89, + -130, 149, -151, 158, 58, 10, 52, 147, 144, -48, -25, -55, 93, 94, 144, 144, -14, -150, 145, 144, - 143, 144, 31, -28, 147, -143, 58, -19, 146, -143, - -90, 160, -58, 42, 146, 147, -99, 44, -63, -145, - 83, -86, -113, 143, -66, -115, -67, -68, -116, -125, + 143, 144, 31, -28, 147, -146, 58, -19, 146, -146, + -93, 160, -58, 42, 146, 147, -102, 44, -63, -148, + 83, -89, -116, 143, -66, -118, -67, -68, -119, -128, 47, 38, 44, -76, 103, 102, 101, 98, 99, 100, - -45, -80, -14, 147, -13, 149, -134, 149, -133, -13, - -13, 149, 143, -138, 57, -14, 151, 149, -78, 145, - 147, -78, -78, -25, 95, -48, 145, -103, -150, -90, - 144, -99, 147, -142, -97, 147, 28, -28, 142, -45, - 142, 142, 146, 12, 143, -117, 12, 144, 158, -1, - -76, 10, -121, -45, 149, 143, 149, 149, -136, -17, - -78, 58, 144, 145, -90, 147, -90, 142, -148, -25, - 145, 147, -148, 144, -90, 12, -90, -90, -98, 12, - 151, 160, 144, 158, 160, 10, -144, 160, -82, 158, - 144, 142, -78, -90, -147, -25, 145, -90, -90, 143, + -45, -80, -14, 147, -13, 149, -137, 149, -136, -13, + -13, 149, 143, -141, 57, -14, 151, 149, -78, 145, + 147, -78, -78, -25, 95, -48, 145, -106, -150, -93, + 144, -102, 147, -145, -100, 147, 28, -28, 142, -45, + 142, 142, 146, 12, 143, -120, 12, 144, 158, -1, + -76, 10, -124, -45, 149, 143, 149, 149, -139, -17, + -78, 58, 144, 145, -93, 147, -93, 142, -85, -25, + 145, 147, -85, 144, -93, 12, -93, -93, -101, 12, + 151, 160, 144, 158, 160, 10, -147, 160, -82, 158, + 144, 142, -78, -93, -86, -25, 145, -93, -93, 143, 147, 143, 143, 147, 158, 12, -28, 12, -28, 160, - 10, -28, -45, -122, -123, -70, -71, -72, -73, -74, - -45, 10, -90, 143, 26, 142, 12, 151, 160, -28, + 10, -28, -45, -125, -126, -70, -71, -72, -73, -74, + -45, 10, -93, 143, 26, 142, 12, 151, 160, -28, 146, 143, -70, 144, 144, 45, 29, 78, 24, 144, - -90, 12, -28, -111, -124, -45, -75, -76, 10, 144, - 143, 147, 158, 10, -109, -110, -59, 41, -84, 144, - 142, -45, -59, 146, -90, -45, 143, 12, 147, 142, - -90, 143, + -93, 12, -28, -114, -127, -45, -75, -76, 10, 144, + 143, 147, 158, 10, -112, -113, -59, 41, -84, 144, + 142, -45, -59, 146, -93, -45, 143, 12, 147, 142, + -93, 143, } var yyDef = [...]int{ @@ -2339,14 +2333,14 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:271 + //line php5/php5.y:270 { yylex.(*Parser).rootNode = node.NewRoot(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) } case 2: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:279 + //line php5/php5.y:278 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2354,13 +2348,13 @@ yydefault: } case 3: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:284 + //line php5/php5.y:283 { yyVAL.list = []node.Node{} } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:289 + //line php5/php5.y:288 { namePart := name.NewNamePart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2369,7 +2363,7 @@ yydefault: } case 5: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:296 + //line php5/php5.y:295 { namePart := name.NewNamePart(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2378,32 +2372,32 @@ yydefault: } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:306 + //line php5/php5.y:305 { // error yyVAL.node = nil } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:311 + //line php5/php5.y:310 { yyVAL.node = yyDollar[1].node } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:313 + //line php5/php5.y:312 { yyVAL.node = yyDollar[1].node } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:315 + //line php5/php5.y:314 { yyVAL.node = yyDollar[1].node } case 10: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:317 + //line php5/php5.y:316 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2411,7 +2405,7 @@ yydefault: } case 11: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:323 + //line php5/php5.y:322 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2423,7 +2417,7 @@ yydefault: } case 12: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:333 + //line php5/php5.y:332 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2435,7 +2429,7 @@ yydefault: } case 13: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:343 + //line php5/php5.y:342 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2443,7 +2437,7 @@ yydefault: } case 14: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:349 + //line php5/php5.y:348 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2451,7 +2445,7 @@ yydefault: } case 15: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:355 + //line php5/php5.y:354 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2463,7 +2457,7 @@ yydefault: } case 16: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:365 + //line php5/php5.y:364 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2475,25 +2469,25 @@ yydefault: } case 17: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:375 + //line php5/php5.y:374 { yyVAL.node = yyDollar[1].node } case 18: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:380 + //line php5/php5.y:379 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:382 + //line php5/php5.y:381 { yyVAL.list = []node.Node{yyDollar[1].node} } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:387 + //line php5/php5.y:386 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2505,7 +2499,7 @@ yydefault: } case 21: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:397 + //line php5/php5.y:396 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2520,7 +2514,7 @@ yydefault: } case 22: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:410 + //line php5/php5.y:409 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2532,7 +2526,7 @@ yydefault: } case 23: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:420 + //line php5/php5.y:419 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2547,19 +2541,19 @@ yydefault: } case 24: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:436 + //line php5/php5.y:435 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:438 + //line php5/php5.y:437 { yyVAL.list = []node.Node{yyDollar[1].node} } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:443 + //line php5/php5.y:442 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2571,7 +2565,7 @@ yydefault: } case 27: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:453 + //line php5/php5.y:452 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2586,7 +2580,7 @@ yydefault: } case 28: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:466 + //line php5/php5.y:465 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2598,7 +2592,7 @@ yydefault: } case 29: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:476 + //line php5/php5.y:475 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2613,19 +2607,19 @@ yydefault: } case 30: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:492 + //line php5/php5.y:491 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:494 + //line php5/php5.y:493 { yyVAL.list = []node.Node{yyDollar[1].node} } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:499 + //line php5/php5.y:498 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2637,7 +2631,7 @@ yydefault: } case 33: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:509 + //line php5/php5.y:508 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2652,7 +2646,7 @@ yydefault: } case 34: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:522 + //line php5/php5.y:521 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2664,7 +2658,7 @@ yydefault: } case 35: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:532 + //line php5/php5.y:531 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2679,7 +2673,7 @@ yydefault: } case 36: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:548 + //line php5/php5.y:547 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2697,7 +2691,7 @@ yydefault: } case 37: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:564 + //line php5/php5.y:563 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2715,7 +2709,7 @@ yydefault: } case 38: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:583 + //line php5/php5.y:582 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2723,38 +2717,38 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:589 + //line php5/php5.y:588 { yyVAL.list = []node.Node{} } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:595 + //line php5/php5.y:594 { // error yyVAL.node = nil } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:600 + //line php5/php5.y:599 { yyVAL.node = yyDollar[1].node } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:602 + //line php5/php5.y:601 { yyVAL.node = yyDollar[1].node } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:604 + //line php5/php5.y:603 { yyVAL.node = yyDollar[1].node } case 44: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:606 + //line php5/php5.y:605 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2762,13 +2756,13 @@ yydefault: } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:616 + //line php5/php5.y:615 { yyVAL.node = yyDollar[1].node } case 46: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:618 + //line php5/php5.y:617 { label := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2780,7 +2774,7 @@ yydefault: } case 47: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:631 + //line php5/php5.y:630 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2788,7 +2782,7 @@ yydefault: } case 48: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:637 + //line php5/php5.y:636 { yyVAL.node = stmt.NewIf(yyDollar[2].node, yyDollar[3].node, yyDollar[4].list, yyDollar[5].node) @@ -2804,7 +2798,7 @@ yydefault: } case 49: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:651 + //line php5/php5.y:650 { stmts := stmt.NewStmtList(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) @@ -2815,19 +2809,23 @@ yydefault: } case 50: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:660 + //line php5/php5.y:659 { - if yyDollar[3].altSyntaxNode.isAlt { - yyVAL.node = stmt.NewAltWhile(yyDollar[2].node, yyDollar[3].altSyntaxNode.node) - } else { - yyVAL.node = stmt.NewWhile(yyDollar[2].node, yyDollar[3].altSyntaxNode.node) + switch n := yyDollar[3].node.(type) { + case *stmt.While: + n.Cond = yyDollar[2].node + case *stmt.AltWhile: + n.Cond = yyDollar[2].node } - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].altSyntaxNode.node)) + + yyVAL.node = yyDollar[3].node + + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 51: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:670 + //line php5/php5.y:673 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2835,19 +2833,27 @@ yydefault: } case 52: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:676 + //line php5/php5.y:679 { - if yyDollar[9].altSyntaxNode.isAlt { - yyVAL.node = stmt.NewAltFor(yyDollar[3].list, yyDollar[5].list, yyDollar[7].list, yyDollar[9].altSyntaxNode.node) - } else { - yyVAL.node = stmt.NewFor(yyDollar[3].list, yyDollar[5].list, yyDollar[7].list, yyDollar[9].altSyntaxNode.node) + switch n := yyDollar[9].node.(type) { + case *stmt.For: + n.Init = yyDollar[3].list + n.Cond = yyDollar[5].list + n.Loop = yyDollar[7].list + case *stmt.AltFor: + n.Init = yyDollar[3].list + n.Cond = yyDollar[5].list + n.Loop = yyDollar[7].list } - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].altSyntaxNode.node)) + + yyVAL.node = yyDollar[9].node + + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 53: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:686 + //line php5/php5.y:697 { switch n := yyDollar[3].node.(type) { case *stmt.Switch: @@ -2865,7 +2871,7 @@ yydefault: } case 54: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:702 + //line php5/php5.y:713 { yyVAL.node = stmt.NewBreak(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2873,7 +2879,7 @@ yydefault: } case 55: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:708 + //line php5/php5.y:719 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2881,7 +2887,7 @@ yydefault: } case 56: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:714 + //line php5/php5.y:725 { yyVAL.node = stmt.NewContinue(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2889,7 +2895,7 @@ yydefault: } case 57: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:720 + //line php5/php5.y:731 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2897,7 +2903,7 @@ yydefault: } case 58: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:726 + //line php5/php5.y:737 { yyVAL.node = stmt.NewReturn(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2905,7 +2911,7 @@ yydefault: } case 59: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:732 + //line php5/php5.y:743 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2913,7 +2919,7 @@ yydefault: } case 60: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:738 + //line php5/php5.y:749 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2921,7 +2927,7 @@ yydefault: } case 61: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:744 + //line php5/php5.y:755 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2929,7 +2935,7 @@ yydefault: } case 62: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:750 + //line php5/php5.y:761 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2937,7 +2943,7 @@ yydefault: } case 63: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:756 + //line php5/php5.y:767 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2945,7 +2951,7 @@ yydefault: } case 64: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:762 + //line php5/php5.y:773 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2953,7 +2959,7 @@ yydefault: } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:768 + //line php5/php5.y:779 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2961,7 +2967,7 @@ yydefault: } case 66: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:774 + //line php5/php5.y:785 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2969,7 +2975,7 @@ yydefault: } case 67: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:780 + //line php5/php5.y:791 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2977,47 +2983,77 @@ yydefault: } case 68: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:786 + //line php5/php5.y:797 { if yyDollar[6].foreachVariable.node == nil { - if yyDollar[8].altSyntaxNode.isAlt { - yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, nil, yyDollar[5].foreachVariable.node, yyDollar[8].altSyntaxNode.node, yyDollar[5].foreachVariable.byRef) - } else { - yyVAL.node = stmt.NewForeach(yyDollar[3].node, nil, yyDollar[5].foreachVariable.node, yyDollar[8].altSyntaxNode.node, yyDollar[5].foreachVariable.byRef) + switch n := yyDollar[8].node.(type) { + case *stmt.Foreach: + n.Expr = yyDollar[3].node + n.ByRef = yyDollar[5].foreachVariable.byRef + n.Variable = yyDollar[5].foreachVariable.node + case *stmt.AltForeach: + n.Expr = yyDollar[3].node + n.ByRef = yyDollar[5].foreachVariable.byRef + n.Variable = yyDollar[5].foreachVariable.node } } else { - if yyDollar[8].altSyntaxNode.isAlt { - yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, yyDollar[5].foreachVariable.node, yyDollar[6].foreachVariable.node, yyDollar[8].altSyntaxNode.node, yyDollar[6].foreachVariable.byRef) - } else { - yyVAL.node = stmt.NewForeach(yyDollar[3].node, yyDollar[5].foreachVariable.node, yyDollar[6].foreachVariable.node, yyDollar[8].altSyntaxNode.node, yyDollar[6].foreachVariable.byRef) + switch n := yyDollar[8].node.(type) { + case *stmt.Foreach: + n.Expr = yyDollar[3].node + n.Key = yyDollar[5].foreachVariable.node + n.ByRef = yyDollar[6].foreachVariable.byRef + n.Variable = yyDollar[6].foreachVariable.node + case *stmt.AltForeach: + n.Expr = yyDollar[3].node + n.Key = yyDollar[5].foreachVariable.node + n.ByRef = yyDollar[6].foreachVariable.byRef + n.Variable = yyDollar[6].foreachVariable.node } } - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].altSyntaxNode.node)) + + yyVAL.node = yyDollar[8].node + + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 69: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:804 + //line php5/php5.y:830 { if yyDollar[6].foreachVariable.node == nil { - if yyDollar[8].altSyntaxNode.isAlt { - yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, nil, yyDollar[5].foreachVariable.node, yyDollar[8].altSyntaxNode.node, yyDollar[5].foreachVariable.byRef) - } else { - yyVAL.node = stmt.NewForeach(yyDollar[3].node, nil, yyDollar[5].foreachVariable.node, yyDollar[8].altSyntaxNode.node, yyDollar[5].foreachVariable.byRef) + switch n := yyDollar[8].node.(type) { + case *stmt.Foreach: + n.Expr = yyDollar[3].node + n.ByRef = yyDollar[5].foreachVariable.byRef + n.Variable = yyDollar[5].foreachVariable.node + case *stmt.AltForeach: + n.Expr = yyDollar[3].node + n.ByRef = yyDollar[5].foreachVariable.byRef + n.Variable = yyDollar[5].foreachVariable.node } } else { - if yyDollar[8].altSyntaxNode.isAlt { - yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, yyDollar[5].foreachVariable.node, yyDollar[6].foreachVariable.node, yyDollar[8].altSyntaxNode.node, yyDollar[6].foreachVariable.byRef) - } else { - yyVAL.node = stmt.NewForeach(yyDollar[3].node, yyDollar[5].foreachVariable.node, yyDollar[6].foreachVariable.node, yyDollar[8].altSyntaxNode.node, yyDollar[6].foreachVariable.byRef) + switch n := yyDollar[8].node.(type) { + case *stmt.Foreach: + n.Expr = yyDollar[3].node + n.Key = yyDollar[5].foreachVariable.node + n.ByRef = yyDollar[6].foreachVariable.byRef + n.Variable = yyDollar[6].foreachVariable.node + case *stmt.AltForeach: + n.Expr = yyDollar[3].node + n.Key = yyDollar[5].foreachVariable.node + n.ByRef = yyDollar[6].foreachVariable.byRef + n.Variable = yyDollar[6].foreachVariable.node } } - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].altSyntaxNode.node)) + + yyVAL.node = yyDollar[8].node + + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 70: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:822 + //line php5/php5.y:863 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) @@ -3025,7 +3061,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:828 + //line php5/php5.y:869 { yyVAL.node = stmt.NewNop() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3033,7 +3069,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:834 + //line php5/php5.y:875 { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3047,7 +3083,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:846 + //line php5/php5.y:887 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -3055,7 +3091,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:852 + //line php5/php5.y:893 { label := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3067,13 +3103,13 @@ yydefault: } case 75: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:865 + //line php5/php5.y:906 { yyVAL.list = []node.Node{} } case 76: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:867 + //line php5/php5.y:908 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3091,13 +3127,13 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:885 + //line php5/php5.y:926 { yyVAL.node = nil } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:887 + //line php5/php5.y:928 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3105,31 +3141,31 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:896 + //line php5/php5.y:937 { yyVAL.list = yyDollar[1].list } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:898 + //line php5/php5.y:939 { yyVAL.list = []node.Node{} } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:903 + //line php5/php5.y:944 { yyVAL.list = []node.Node{yyDollar[1].node} } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:905 + //line php5/php5.y:946 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:910 + //line php5/php5.y:951 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3145,61 +3181,61 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:927 + //line php5/php5.y:968 { yyVAL.list = []node.Node{yyDollar[1].node} } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:929 + //line php5/php5.y:970 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:934 + //line php5/php5.y:975 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:939 + //line php5/php5.y:980 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:944 + //line php5/php5.y:985 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:949 + //line php5/php5.y:990 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:951 + //line php5/php5.y:992 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:956 + //line php5/php5.y:997 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:958 + //line php5/php5.y:999 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:963 + //line php5/php5.y:1004 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3211,7 +3247,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:976 + //line php5/php5.y:1017 { switch n := yyDollar[1].node.(type) { case *stmt.Class: @@ -3234,7 +3270,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:997 + //line php5/php5.y:1038 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3246,7 +3282,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1011 + //line php5/php5.y:1052 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3254,7 +3290,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1017 + //line php5/php5.y:1058 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3266,7 +3302,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1027 + //line php5/php5.y:1068 { yyVAL.node = stmt.NewTrait(nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3274,7 +3310,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1033 + //line php5/php5.y:1074 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3286,85 +3322,85 @@ yydefault: } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1046 + //line php5/php5.y:1087 { yyVAL.node = nil } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1048 + //line php5/php5.y:1089 { yyVAL.node = yyDollar[2].node } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1053 + //line php5/php5.y:1094 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1058 + //line php5/php5.y:1099 { yyVAL.list = nil } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1060 + //line php5/php5.y:1101 { yyVAL.list = yyDollar[2].list } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1065 + //line php5/php5.y:1106 { yyVAL.list = nil } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1067 + //line php5/php5.y:1108 { yyVAL.list = yyDollar[2].list } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1072 + //line php5/php5.y:1113 { yyVAL.list = []node.Node{yyDollar[1].node} } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1074 + //line php5/php5.y:1115 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1079 + //line php5/php5.y:1120 { yyVAL.foreachVariable = foreachVariable{nil, false} } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1081 + //line php5/php5.y:1122 { yyVAL.foreachVariable = yyDollar[2].foreachVariable } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1086 + //line php5/php5.y:1127 { yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1088 + //line php5/php5.y:1129 { yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1090 + //line php5/php5.y:1131 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3373,39 +3409,47 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1100 + //line php5/php5.y:1141 { - yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} + yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1102 + //line php5/php5.y:1146 { - yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} - yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + stmtList := stmt.NewStmtList(yyDollar[2].list) + yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) + + yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1111 + //line php5/php5.y:1158 { - yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} + yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node, false) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1113 + //line php5/php5.y:1163 { - yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} - yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + stmtList := stmt.NewStmtList(yyDollar[2].list) + yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList, false) + + yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1122 + //line php5/php5.y:1175 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1124 + //line php5/php5.y:1177 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3413,7 +3457,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1134 + //line php5/php5.y:1187 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3427,7 +3471,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1146 + //line php5/php5.y:1199 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3441,7 +3485,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1162 + //line php5/php5.y:1215 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3451,7 +3495,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1170 + //line php5/php5.y:1223 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3461,7 +3505,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1178 + //line php5/php5.y:1231 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -3471,7 +3515,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1186 + //line php5/php5.y:1239 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -3482,13 +3526,13 @@ yydefault: } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1199 + //line php5/php5.y:1252 { yyVAL.list = []node.Node{} } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1201 + //line php5/php5.y:1254 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) @@ -3497,7 +3541,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1208 + //line php5/php5.y:1261 { _default := stmt.NewDefault(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) @@ -3506,26 +3550,30 @@ yydefault: } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1225 + //line php5/php5.y:1278 { - yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} + yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1227 + //line php5/php5.y:1283 { - yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} - yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + stmtList := stmt.NewStmtList(yyDollar[2].list) + yyVAL.node = stmt.NewAltWhile(nil, stmtList) + + yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1237 + //line php5/php5.y:1296 { yyVAL.list = nil } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1239 + //line php5/php5.y:1298 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) @@ -3535,13 +3583,13 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1251 + //line php5/php5.y:1310 { yyVAL.list = nil } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1253 + //line php5/php5.y:1312 { stmts := stmt.NewStmtList(yyDollar[5].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[5].list)) @@ -3554,13 +3602,13 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1268 + //line php5/php5.y:1327 { yyVAL.node = nil } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1270 + //line php5/php5.y:1329 { yyVAL.node = stmt.NewElse(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3568,13 +3616,13 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1280 + //line php5/php5.y:1339 { yyVAL.node = nil } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1282 + //line php5/php5.y:1341 { stmts := stmt.NewStmtList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) @@ -3585,31 +3633,31 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1295 + //line php5/php5.y:1354 { yyVAL.list = yyDollar[1].list } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1297 + //line php5/php5.y:1356 { yyVAL.list = nil } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1302 + //line php5/php5.y:1361 { yyVAL.list = []node.Node{yyDollar[1].node} } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1304 + //line php5/php5.y:1363 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1309 + //line php5/php5.y:1368 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3637,7 +3685,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1335 + //line php5/php5.y:1394 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3665,13 +3713,13 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1365 + //line php5/php5.y:1424 { yyVAL.node = nil } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1367 + //line php5/php5.y:1426 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3679,7 +3727,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1373 + //line php5/php5.y:1432 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3687,13 +3735,13 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1379 + //line php5/php5.y:1438 { yyVAL.node = yyDollar[1].node } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1385 + //line php5/php5.y:1444 { yyVAL.node = node.NewArgumentList(nil) @@ -3702,7 +3750,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1392 + //line php5/php5.y:1451 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -3711,7 +3759,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1399 + //line php5/php5.y:1458 { arg := node.NewArgument(yyDollar[2].node, false, false) yyVAL.node = node.NewArgumentList([]node.Node{arg}) @@ -3722,19 +3770,19 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1412 + //line php5/php5.y:1471 { yyVAL.list = []node.Node{yyDollar[1].node} } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1414 + //line php5/php5.y:1473 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1419 + //line php5/php5.y:1478 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3742,7 +3790,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1425 + //line php5/php5.y:1484 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3750,7 +3798,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1431 + //line php5/php5.y:1490 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -3758,7 +3806,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1437 + //line php5/php5.y:1496 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3766,19 +3814,19 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1446 + //line php5/php5.y:1505 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1448 + //line php5/php5.y:1507 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1454 + //line php5/php5.y:1513 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3790,7 +3838,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1464 + //line php5/php5.y:1523 { yyVAL.node = expr.NewVariable(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3798,7 +3846,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1470 + //line php5/php5.y:1529 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3806,7 +3854,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1480 + //line php5/php5.y:1539 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3825,7 +3873,7 @@ yydefault: } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1497 + //line php5/php5.y:1556 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3844,7 +3892,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1514 + //line php5/php5.y:1573 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3863,7 +3911,7 @@ yydefault: } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1531 + //line php5/php5.y:1590 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3882,19 +3930,19 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1553 + //line php5/php5.y:1612 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1555 + //line php5/php5.y:1614 { yyVAL.list = []node.Node{} } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1561 + //line php5/php5.y:1620 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) @@ -3902,19 +3950,19 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1567 + //line php5/php5.y:1626 { yyVAL.node = yyDollar[1].node } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1569 + //line php5/php5.y:1628 { yyVAL.node = yyDollar[1].node } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1571 + //line php5/php5.y:1630 { name := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3932,7 +3980,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1590 + //line php5/php5.y:1649 { var adaptationList *stmt.TraitAdaptationList switch n := yyDollar[3].node.(type) { @@ -3948,19 +3996,19 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1607 + //line php5/php5.y:1666 { yyVAL.list = []node.Node{yyDollar[1].node} } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1609 + //line php5/php5.y:1668 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1614 + //line php5/php5.y:1673 { yyVAL.node = stmt.NewNop() @@ -3968,7 +4016,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1620 + //line php5/php5.y:1679 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -3976,43 +4024,43 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1629 + //line php5/php5.y:1688 { yyVAL.list = nil } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1631 + //line php5/php5.y:1690 { yyVAL.list = yyDollar[1].list } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1636 + //line php5/php5.y:1695 { yyVAL.list = []node.Node{yyDollar[1].node} } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1638 + //line php5/php5.y:1697 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1643 + //line php5/php5.y:1702 { yyVAL.node = yyDollar[1].node } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1645 + //line php5/php5.y:1704 { yyVAL.node = yyDollar[1].node } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1650 + //line php5/php5.y:1709 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) @@ -4020,19 +4068,19 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1659 + //line php5/php5.y:1718 { yyVAL.list = []node.Node{yyDollar[1].node} } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1661 + //line php5/php5.y:1720 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1666 + //line php5/php5.y:1725 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4044,13 +4092,13 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1676 + //line php5/php5.y:1735 { yyVAL.node = yyDollar[1].node } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1681 + //line php5/php5.y:1740 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4062,7 +4110,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1694 + //line php5/php5.y:1753 { alias := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -4074,7 +4122,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1704 + //line php5/php5.y:1763 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4082,19 +4130,19 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1713 + //line php5/php5.y:1772 { yyVAL.node = nil } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1715 + //line php5/php5.y:1774 { yyVAL.node = yyDollar[1].node } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1720 + //line php5/php5.y:1779 { yyVAL.node = stmt.NewNop() @@ -4102,7 +4150,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1726 + //line php5/php5.y:1785 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -4110,13 +4158,13 @@ yydefault: } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1735 + //line php5/php5.y:1794 { yyVAL.list = yyDollar[1].list } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1737 + //line php5/php5.y:1796 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4126,31 +4174,31 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1748 + //line php5/php5.y:1807 { yyVAL.list = nil } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1750 + //line php5/php5.y:1809 { yyVAL.list = yyDollar[1].list } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1755 + //line php5/php5.y:1814 { yyVAL.list = []node.Node{yyDollar[1].node} } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1757 + //line php5/php5.y:1816 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 204: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1762 + //line php5/php5.y:1821 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4158,7 +4206,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1768 + //line php5/php5.y:1827 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4166,7 +4214,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1774 + //line php5/php5.y:1833 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4174,7 +4222,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1780 + //line php5/php5.y:1839 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4182,7 +4230,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1786 + //line php5/php5.y:1845 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4190,7 +4238,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1792 + //line php5/php5.y:1851 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4198,7 +4246,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1801 + //line php5/php5.y:1860 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4216,7 +4264,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1817 + //line php5/php5.y:1876 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4234,7 +4282,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1833 + //line php5/php5.y:1892 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4252,7 +4300,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1849 + //line php5/php5.y:1908 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4270,7 +4318,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1868 + //line php5/php5.y:1927 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4287,7 +4335,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1883 + //line php5/php5.y:1942 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -4303,55 +4351,55 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1900 + //line php5/php5.y:1959 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1902 + //line php5/php5.y:1961 { yyVAL.list = []node.Node{yyDollar[1].node} } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1908 + //line php5/php5.y:1967 { yyVAL.list = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1910 + //line php5/php5.y:1969 { yyVAL.list = yyDollar[1].list } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1915 + //line php5/php5.y:1974 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1917 + //line php5/php5.y:1976 { yyVAL.list = []node.Node{yyDollar[1].node} } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1922 + //line php5/php5.y:1981 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1924 + //line php5/php5.y:1983 { yyVAL.list = yyDollar[1].list } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1929 + //line php5/php5.y:1988 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -4360,7 +4408,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1936 + //line php5/php5.y:1995 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -4369,37 +4417,37 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1946 + //line php5/php5.y:2005 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1948 + //line php5/php5.y:2007 { yyVAL.list = yyDollar[1].list } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1950 + //line php5/php5.y:2009 { yyVAL.list = yyDollar[1].list } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1955 + //line php5/php5.y:2014 { yyVAL.list = nil } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1957 + //line php5/php5.y:2016 { yyVAL.list = yyDollar[1].list } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1962 + //line php5/php5.y:2021 { if yyDollar[3].node != nil { @@ -4414,7 +4462,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1978 + //line php5/php5.y:2037 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -4426,7 +4474,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1988 + //line php5/php5.y:2047 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4434,7 +4482,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1994 + //line php5/php5.y:2053 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4442,7 +4490,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:2000 + //line php5/php5.y:2059 { var _new *expr.New @@ -4461,7 +4509,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2017 + //line php5/php5.y:2076 { yyVAL.node = expr.NewClone(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4469,7 +4517,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2023 + //line php5/php5.y:2082 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4477,7 +4525,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2029 + //line php5/php5.y:2088 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4485,7 +4533,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2035 + //line php5/php5.y:2094 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4493,7 +4541,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2041 + //line php5/php5.y:2100 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4501,7 +4549,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2047 + //line php5/php5.y:2106 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4509,7 +4557,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2053 + //line php5/php5.y:2112 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4517,7 +4565,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2059 + //line php5/php5.y:2118 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4525,7 +4573,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2065 + //line php5/php5.y:2124 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4533,7 +4581,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2071 + //line php5/php5.y:2130 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4541,7 +4589,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2077 + //line php5/php5.y:2136 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4549,7 +4597,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2083 + //line php5/php5.y:2142 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4557,7 +4605,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2089 + //line php5/php5.y:2148 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4565,7 +4613,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2095 + //line php5/php5.y:2154 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4573,7 +4621,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2101 + //line php5/php5.y:2160 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4581,7 +4629,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2107 + //line php5/php5.y:2166 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4589,7 +4637,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2113 + //line php5/php5.y:2172 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4597,7 +4645,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2119 + //line php5/php5.y:2178 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4605,7 +4653,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2125 + //line php5/php5.y:2184 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4613,7 +4661,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2131 + //line php5/php5.y:2190 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4621,7 +4669,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2137 + //line php5/php5.y:2196 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4629,7 +4677,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2143 + //line php5/php5.y:2202 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4637,7 +4685,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2149 + //line php5/php5.y:2208 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4645,7 +4693,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2155 + //line php5/php5.y:2214 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4653,7 +4701,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2161 + //line php5/php5.y:2220 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4661,7 +4709,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2167 + //line php5/php5.y:2226 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4669,7 +4717,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2173 + //line php5/php5.y:2232 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4677,7 +4725,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2179 + //line php5/php5.y:2238 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4685,7 +4733,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2185 + //line php5/php5.y:2244 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4693,7 +4741,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2191 + //line php5/php5.y:2250 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4701,7 +4749,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2197 + //line php5/php5.y:2256 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4709,7 +4757,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2203 + //line php5/php5.y:2262 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4717,7 +4765,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2209 + //line php5/php5.y:2268 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4725,7 +4773,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2215 + //line php5/php5.y:2274 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4733,7 +4781,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2221 + //line php5/php5.y:2280 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4741,7 +4789,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2227 + //line php5/php5.y:2286 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4749,7 +4797,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2233 + //line php5/php5.y:2292 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4757,7 +4805,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2239 + //line php5/php5.y:2298 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4765,7 +4813,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2245 + //line php5/php5.y:2304 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4773,7 +4821,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2251 + //line php5/php5.y:2310 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4781,7 +4829,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2257 + //line php5/php5.y:2316 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4789,7 +4837,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2263 + //line php5/php5.y:2322 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4797,7 +4845,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2269 + //line php5/php5.y:2328 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4805,7 +4853,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2275 + //line php5/php5.y:2334 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4813,7 +4861,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2281 + //line php5/php5.y:2340 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4821,7 +4869,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2287 + //line php5/php5.y:2346 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4829,7 +4877,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2293 + //line php5/php5.y:2352 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4837,19 +4885,19 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2299 + //line php5/php5.y:2358 { yyVAL.node = yyDollar[1].node } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2301 + //line php5/php5.y:2360 { yyVAL.node = yyDollar[1].node } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2303 + //line php5/php5.y:2362 { yyVAL.node = yyDollar[2].node @@ -4877,7 +4925,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2329 + //line php5/php5.y:2388 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -4885,7 +4933,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2335 + //line php5/php5.y:2394 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4893,13 +4941,13 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2341 + //line php5/php5.y:2400 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2343 + //line php5/php5.y:2402 { yyVAL.node = cast.NewInt(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4907,7 +4955,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2349 + //line php5/php5.y:2408 { yyVAL.node = cast.NewDouble(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4915,7 +4963,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2355 + //line php5/php5.y:2414 { yyVAL.node = cast.NewString(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4923,7 +4971,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2361 + //line php5/php5.y:2420 { yyVAL.node = cast.NewArray(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4931,7 +4979,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2367 + //line php5/php5.y:2426 { yyVAL.node = cast.NewObject(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4939,7 +4987,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2373 + //line php5/php5.y:2432 { yyVAL.node = cast.NewBool(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4947,7 +4995,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2379 + //line php5/php5.y:2438 { yyVAL.node = cast.NewUnset(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4955,7 +5003,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2385 + //line php5/php5.y:2444 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -4967,7 +5015,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2395 + //line php5/php5.y:2454 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4975,25 +5023,25 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2401 + //line php5/php5.y:2460 { yyVAL.node = yyDollar[1].node } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2403 + //line php5/php5.y:2462 { yyVAL.node = yyDollar[1].node } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2405 + //line php5/php5.y:2464 { yyVAL.node = yyDollar[1].node } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2407 + //line php5/php5.y:2466 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5001,7 +5049,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2413 + //line php5/php5.y:2472 { yyVAL.node = expr.NewPrint(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5009,7 +5057,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2419 + //line php5/php5.y:2478 { yyVAL.node = expr.NewYield(nil, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5017,7 +5065,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:2425 + //line php5/php5.y:2484 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].list, nil, yyDollar[8].list, false, yyDollar[2].boolWithToken.value, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) @@ -5026,7 +5074,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:2432 + //line php5/php5.y:2491 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, nil, yyDollar[9].list, true, yyDollar[3].boolWithToken.value, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) @@ -5035,7 +5083,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2442 + //line php5/php5.y:2501 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5043,7 +5091,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2448 + //line php5/php5.y:2507 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5051,7 +5099,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2454 + //line php5/php5.y:2513 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5059,7 +5107,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2460 + //line php5/php5.y:2519 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5067,7 +5115,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2469 + //line php5/php5.y:2528 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5075,7 +5123,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2475 + //line php5/php5.y:2534 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5083,7 +5131,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2481 + //line php5/php5.y:2540 { str := scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(str, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5095,7 +5143,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2491 + //line php5/php5.y:2550 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5103,7 +5151,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2500 + //line php5/php5.y:2559 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5111,7 +5159,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2506 + //line php5/php5.y:2565 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5119,25 +5167,25 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2515 + //line php5/php5.y:2574 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2520 + //line php5/php5.y:2579 { yyVAL.list = []node.Node{} } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2522 + //line php5/php5.y:2581 { yyVAL.list = yyDollar[3].list } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2527 + //line php5/php5.y:2586 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5155,7 +5203,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2543 + //line php5/php5.y:2602 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -5173,7 +5221,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2559 + //line php5/php5.y:2618 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5191,7 +5239,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2575 + //line php5/php5.y:2634 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5209,7 +5257,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2594 + //line php5/php5.y:2653 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5221,7 +5269,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2604 + //line php5/php5.y:2663 { funcName := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5233,7 +5281,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2614 + //line php5/php5.y:2673 { funcName := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5245,7 +5293,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2624 + //line php5/php5.y:2683 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5253,7 +5301,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2630 + //line php5/php5.y:2689 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5261,7 +5309,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2636 + //line php5/php5.y:2695 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5269,7 +5317,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2642 + //line php5/php5.y:2701 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5277,7 +5325,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2648 + //line php5/php5.y:2707 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) @@ -5285,7 +5333,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2657 + //line php5/php5.y:2716 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5293,7 +5341,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2663 + //line php5/php5.y:2722 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5301,7 +5349,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2669 + //line php5/php5.y:2728 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5309,7 +5357,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2675 + //line php5/php5.y:2734 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5317,7 +5365,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2684 + //line php5/php5.y:2743 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5325,7 +5373,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2690 + //line php5/php5.y:2749 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5333,7 +5381,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2696 + //line php5/php5.y:2755 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5341,19 +5389,19 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2705 + //line php5/php5.y:2764 { yyVAL.node = yyDollar[1].node } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2707 + //line php5/php5.y:2766 { yyVAL.node = yyDollar[1].node } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2712 + //line php5/php5.y:2771 { yyVAL.node = yyDollar[1].node @@ -5391,79 +5439,79 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2748 + //line php5/php5.y:2807 { yyVAL.node = yyDollar[1].node } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2754 + //line php5/php5.y:2813 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2756 + //line php5/php5.y:2815 { yyVAL.list = []node.Node{} } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2762 + //line php5/php5.y:2821 { yyVAL.list = yyDollar[2].list } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2767 + //line php5/php5.y:2826 { yyVAL.node = nil } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2769 + //line php5/php5.y:2828 { yyVAL.node = nil } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2771 + //line php5/php5.y:2830 { yyVAL.node = yyDollar[1].node } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2776 + //line php5/php5.y:2835 { yyVAL.list = []node.Node{} } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2778 + //line php5/php5.y:2837 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2780 + //line php5/php5.y:2839 { yyVAL.list = yyDollar[1].list } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2785 + //line php5/php5.y:2844 { yyVAL.node = nil } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2787 + //line php5/php5.y:2846 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2792 + //line php5/php5.y:2851 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5471,7 +5519,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2798 + //line php5/php5.y:2857 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5479,7 +5527,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2804 + //line php5/php5.y:2863 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5487,7 +5535,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2810 + //line php5/php5.y:2869 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5495,7 +5543,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2816 + //line php5/php5.y:2875 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5503,7 +5551,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2822 + //line php5/php5.y:2881 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5511,7 +5559,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2828 + //line php5/php5.y:2887 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5519,7 +5567,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2834 + //line php5/php5.y:2893 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5527,7 +5575,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2840 + //line php5/php5.y:2899 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5535,7 +5583,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2846 + //line php5/php5.y:2905 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5543,7 +5591,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2852 + //line php5/php5.y:2911 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5555,7 +5603,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2862 + //line php5/php5.y:2921 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -5563,7 +5611,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2871 + //line php5/php5.y:2930 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5575,25 +5623,25 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2884 + //line php5/php5.y:2943 { yyVAL.node = yyDollar[1].node } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2889 + //line php5/php5.y:2948 { yyVAL.node = yyDollar[1].node } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2891 + //line php5/php5.y:2950 { yyVAL.node = yyDollar[1].node } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2893 + //line php5/php5.y:2952 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5605,7 +5653,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2903 + //line php5/php5.y:2962 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5617,7 +5665,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2913 + //line php5/php5.y:2972 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5629,7 +5677,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2923 + //line php5/php5.y:2982 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5637,7 +5685,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2929 + //line php5/php5.y:2988 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5645,13 +5693,13 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2935 + //line php5/php5.y:2994 { yyVAL.node = yyDollar[1].node } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2937 + //line php5/php5.y:2996 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5659,13 +5707,13 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2943 + //line php5/php5.y:3002 { yyVAL.node = yyDollar[1].node } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2948 + //line php5/php5.y:3007 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5673,7 +5721,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2954 + //line php5/php5.y:3013 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5681,7 +5729,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2960 + //line php5/php5.y:3019 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5689,7 +5737,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2966 + //line php5/php5.y:3025 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5697,7 +5745,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2972 + //line php5/php5.y:3031 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5705,7 +5753,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2978 + //line php5/php5.y:3037 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5713,7 +5761,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2984 + //line php5/php5.y:3043 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5721,7 +5769,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2990 + //line php5/php5.y:3049 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5729,7 +5777,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2996 + //line php5/php5.y:3055 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5737,7 +5785,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3002 + //line php5/php5.y:3061 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5745,7 +5793,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3008 + //line php5/php5.y:3067 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5753,7 +5801,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3014 + //line php5/php5.y:3073 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5761,7 +5809,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3020 + //line php5/php5.y:3079 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5769,7 +5817,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3026 + //line php5/php5.y:3085 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5777,7 +5825,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3032 + //line php5/php5.y:3091 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5785,7 +5833,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3038 + //line php5/php5.y:3097 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5793,7 +5841,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3044 + //line php5/php5.y:3103 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5801,7 +5849,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3050 + //line php5/php5.y:3109 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5809,7 +5857,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3056 + //line php5/php5.y:3115 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5817,7 +5865,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3062 + //line php5/php5.y:3121 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5825,7 +5873,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3068 + //line php5/php5.y:3127 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5833,7 +5881,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3074 + //line php5/php5.y:3133 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5841,7 +5889,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3080 + //line php5/php5.y:3139 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5849,7 +5897,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3086 + //line php5/php5.y:3145 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5857,7 +5905,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3092 + //line php5/php5.y:3151 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5865,7 +5913,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3098 + //line php5/php5.y:3157 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5873,7 +5921,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3104 + //line php5/php5.y:3163 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5881,7 +5929,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3110 + //line php5/php5.y:3169 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5889,7 +5937,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3116 + //line php5/php5.y:3175 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5897,7 +5945,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3122 + //line php5/php5.y:3181 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -5905,7 +5953,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3128 + //line php5/php5.y:3187 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5913,7 +5961,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3134 + //line php5/php5.y:3193 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5921,19 +5969,19 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3140 + //line php5/php5.y:3199 { yyVAL.node = yyDollar[2].node } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3145 + //line php5/php5.y:3204 { yyVAL.node = yyDollar[1].node } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3147 + //line php5/php5.y:3206 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5945,7 +5993,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3157 + //line php5/php5.y:3216 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5957,7 +6005,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3167 + //line php5/php5.y:3226 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5969,7 +6017,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3180 + //line php5/php5.y:3239 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5981,25 +6029,25 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3190 + //line php5/php5.y:3249 { yyVAL.node = yyDollar[1].node } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3192 + //line php5/php5.y:3251 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3194 + //line php5/php5.y:3253 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3196 + //line php5/php5.y:3255 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6007,7 +6055,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3202 + //line php5/php5.y:3261 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6015,7 +6063,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3208 + //line php5/php5.y:3267 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6023,19 +6071,19 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3217 + //line php5/php5.y:3276 { yyVAL.list = nil } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3219 + //line php5/php5.y:3278 { yyVAL.list = yyDollar[1].list } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3229 + //line php5/php5.y:3288 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -6045,7 +6093,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3237 + //line php5/php5.y:3296 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6055,7 +6103,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3245 + //line php5/php5.y:3304 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6065,7 +6113,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3253 + //line php5/php5.y:3312 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6075,49 +6123,49 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3264 + //line php5/php5.y:3323 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3266 + //line php5/php5.y:3325 { yyVAL.node = yyDollar[1].node } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3271 + //line php5/php5.y:3330 { yyVAL.node = yyDollar[2].node } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3273 + //line php5/php5.y:3332 { yyVAL.node = yyDollar[2].node } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3279 + //line php5/php5.y:3338 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3285 + //line php5/php5.y:3344 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3290 + //line php5/php5.y:3349 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3295 + //line php5/php5.y:3354 { yyVAL.node = yyDollar[1].node @@ -6172,25 +6220,25 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3348 + //line php5/php5.y:3407 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3353 + //line php5/php5.y:3412 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3355 + //line php5/php5.y:3414 { yyVAL.list = []node.Node{} } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3361 + //line php5/php5.y:3420 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -6201,7 +6249,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3373 + //line php5/php5.y:3432 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6210,7 +6258,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3380 + //line php5/php5.y:3439 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6219,38 +6267,38 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3390 + //line php5/php5.y:3449 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3398 + //line php5/php5.y:3457 { yyVAL.list = []node.Node{yyDollar[1].node} } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3400 + //line php5/php5.y:3459 { yyVAL.list = yyDollar[1].list } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3402 + //line php5/php5.y:3461 { yyVAL.list = nil } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3407 + //line php5/php5.y:3466 { yyVAL.node = yyDollar[1].node } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3409 + //line php5/php5.y:3468 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6262,7 +6310,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3422 + //line php5/php5.y:3481 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6270,7 +6318,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3428 + //line php5/php5.y:3487 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6278,13 +6326,13 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3438 + //line php5/php5.y:3497 { yyVAL.node = yyDollar[1].node } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3443 + //line php5/php5.y:3502 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6292,7 +6340,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3449 + //line php5/php5.y:3508 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6300,31 +6348,31 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3457 + //line php5/php5.y:3516 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3458 + //line php5/php5.y:3517 { yyVAL.node = yyDollar[1].node } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3459 + //line php5/php5.y:3518 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3465 + //line php5/php5.y:3524 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3467 + //line php5/php5.y:3526 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6336,13 +6384,13 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3477 + //line php5/php5.y:3536 { yyVAL.node = yyDollar[1].node } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3482 + //line php5/php5.y:3541 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6350,7 +6398,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3488 + //line php5/php5.y:3547 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6358,13 +6406,13 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3494 + //line php5/php5.y:3553 { yyVAL.node = yyDollar[1].node } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3500 + //line php5/php5.y:3559 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6376,7 +6424,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3510 + //line php5/php5.y:3569 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6384,25 +6432,25 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3519 + //line php5/php5.y:3578 { yyVAL.node = nil } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3521 + //line php5/php5.y:3580 { yyVAL.node = yyDollar[1].node } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3527 + //line php5/php5.y:3586 { yyVAL.list = yyDollar[1].list } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3529 + //line php5/php5.y:3588 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6411,7 +6459,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3539 + //line php5/php5.y:3598 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6420,7 +6468,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3546 + //line php5/php5.y:3605 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6429,7 +6477,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3553 + //line php5/php5.y:3612 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6438,7 +6486,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3563 + //line php5/php5.y:3622 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6446,13 +6494,13 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3569 + //line php5/php5.y:3628 { yyVAL.node = yyDollar[2].node } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3574 + //line php5/php5.y:3633 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6462,7 +6510,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3582 + //line php5/php5.y:3641 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6476,13 +6524,13 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3597 + //line php5/php5.y:3656 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3599 + //line php5/php5.y:3658 { if yyDollar[1].node == nil { yyVAL.list = []node.Node{} @@ -6492,7 +6540,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3611 + //line php5/php5.y:3670 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6500,7 +6548,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3617 + //line php5/php5.y:3676 { item := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6512,25 +6560,25 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3627 + //line php5/php5.y:3686 { yyVAL.node = nil } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3633 + //line php5/php5.y:3692 { yyVAL.list = []node.Node{} } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3635 + //line php5/php5.y:3694 { yyVAL.list = yyDollar[1].list } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3640 + //line php5/php5.y:3699 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -6540,7 +6588,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3648 + //line php5/php5.y:3707 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6550,7 +6598,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3656 + //line php5/php5.y:3715 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6560,7 +6608,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3664 + //line php5/php5.y:3723 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6570,7 +6618,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3672 + //line php5/php5.y:3731 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[6].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) @@ -6580,7 +6628,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3680 + //line php5/php5.y:3739 { arrayItem := expr.NewArrayItem(nil, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) @@ -6590,7 +6638,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3688 + //line php5/php5.y:3747 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -6600,7 +6648,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3696 + //line php5/php5.y:3755 { arrayItem := expr.NewArrayItem(nil, yyDollar[2].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6610,13 +6658,13 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3707 + //line php5/php5.y:3766 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3709 + //line php5/php5.y:3768 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6625,13 +6673,13 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3716 + //line php5/php5.y:3775 { yyVAL.list = []node.Node{yyDollar[1].node} } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3718 + //line php5/php5.y:3777 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6640,7 +6688,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3728 + //line php5/php5.y:3787 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6652,7 +6700,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3738 + //line php5/php5.y:3797 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6667,7 +6715,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3751 + //line php5/php5.y:3810 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6685,7 +6733,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3767 + //line php5/php5.y:3826 { yyVAL.node = yyDollar[2].node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6693,7 +6741,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3773 + //line php5/php5.y:3832 { identifier := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6708,13 +6756,13 @@ yydefault: } case 500: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3787 + //line php5/php5.y:3846 { yyVAL.node = yyDollar[2].node } case 501: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3792 + //line php5/php5.y:3851 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6722,7 +6770,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3798 + //line php5/php5.y:3857 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -6736,7 +6784,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3810 + //line php5/php5.y:3869 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6748,7 +6796,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3823 + //line php5/php5.y:3882 { yyVAL.node = expr.NewIsset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6756,7 +6804,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3829 + //line php5/php5.y:3888 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6764,7 +6812,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3835 + //line php5/php5.y:3894 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6772,7 +6820,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3841 + //line php5/php5.y:3900 { yyVAL.node = expr.NewInclude(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6780,7 +6828,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3847 + //line php5/php5.y:3906 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6788,7 +6836,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3853 + //line php5/php5.y:3912 { yyVAL.node = expr.NewEval(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6796,7 +6844,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3859 + //line php5/php5.y:3918 { yyVAL.node = expr.NewRequire(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6804,7 +6852,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3865 + //line php5/php5.y:3924 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6812,31 +6860,31 @@ yydefault: } case 512: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3874 + //line php5/php5.y:3933 { yyVAL.list = []node.Node{yyDollar[1].node} } case 513: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3876 + //line php5/php5.y:3935 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 514: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3881 + //line php5/php5.y:3940 { yyVAL.node = yyDollar[1].node } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3883 + //line php5/php5.y:3942 { yyVAL.node = yyDollar[1].node } case 516: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3888 + //line php5/php5.y:3947 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6848,7 +6896,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3898 + //line php5/php5.y:3957 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6860,7 +6908,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3911 + //line php5/php5.y:3970 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6872,7 +6920,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3924 + //line php5/php5.y:3983 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) diff --git a/php5/php5.y b/php5/php5.y index a3e611b..ea530f5 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -25,7 +25,6 @@ import ( list []node.Node foreachVariable foreachVariable simpleIndirectReference simpleIndirectReference - altSyntaxNode altSyntaxNode } %type $unk @@ -245,6 +244,7 @@ import ( %type trait_adaptations %type switch_case_list %type method_body +%type foreach_statement for_statement while_statement %type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations %type inner_statement_list global_var_list static_var_list encaps_list isset_variables non_empty_array_pair_list @@ -262,7 +262,6 @@ import ( %type simple_indirect_reference %type foreach_variable foreach_optional_arg %type is_reference is_variadic -%type while_statement for_statement foreach_statement %% @@ -658,12 +657,16 @@ unticked_statement: } | T_WHILE parenthesis_expr while_statement { - if ($3.isAlt) { - $$ = stmt.NewAltWhile($2, $3.node) - } else { - $$ = stmt.NewWhile($2, $3.node) + switch n := $3.(type) { + case *stmt.While : + n.Cond = $2 + case *stmt.AltWhile : + n.Cond = $2 } - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3.node)) + + $$ = $3 + + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) yylex.(*Parser).comments.AddComments($$, $1.Comments()) } | T_DO statement T_WHILE parenthesis_expr ';' @@ -674,12 +677,20 @@ unticked_statement: } | T_FOR '(' for_expr ';' for_expr ';' for_expr ')' for_statement { - if ($9.isAlt) { - $$ = stmt.NewAltFor($3, $5, $7, $9.node) - } else { - $$ = stmt.NewFor($3, $5, $7, $9.node) + switch n := $9.(type) { + case *stmt.For : + n.Init = $3 + n.Cond = $5 + n.Loop = $7 + case *stmt.AltFor : + n.Init = $3 + n.Cond = $5 + n.Loop = $7 } - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9.node)) + + $$ = $9 + + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) yylex.(*Parser).comments.AddComments($$, $1.Comments()) } | T_SWITCH parenthesis_expr switch_case_list @@ -785,37 +796,67 @@ unticked_statement: | T_FOREACH '(' variable T_AS foreach_variable foreach_optional_arg ')' foreach_statement { if $6.node == nil { - if ($8.isAlt) { - $$ = stmt.NewAltForeach($3, nil, $5.node, $8.node, $5.byRef) - } else { - $$ = stmt.NewForeach($3, nil, $5.node, $8.node, $5.byRef) + switch n := $8.(type) { + case *stmt.Foreach : + n.Expr = $3 + n.ByRef = $5.byRef + n.Variable = $5.node + case *stmt.AltForeach : + n.Expr = $3 + n.ByRef = $5.byRef + n.Variable = $5.node } } else { - if ($8.isAlt) { - $$ = stmt.NewAltForeach($3, $5.node, $6.node, $8.node, $6.byRef) - } else { - $$ = stmt.NewForeach($3, $5.node, $6.node, $8.node, $6.byRef) + switch n := $8.(type) { + case *stmt.Foreach : + n.Expr = $3 + n.Key = $5.node + n.ByRef = $6.byRef + n.Variable = $6.node + case *stmt.AltForeach : + n.Expr = $3 + n.Key = $5.node + n.ByRef = $6.byRef + n.Variable = $6.node } } - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8.node)) + + $$ = $8 + + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) yylex.(*Parser).comments.AddComments($$, $1.Comments()) } | T_FOREACH '(' expr_without_variable T_AS foreach_variable foreach_optional_arg ')' foreach_statement { if $6.node == nil { - if ($8.isAlt) { - $$ = stmt.NewAltForeach($3, nil, $5.node, $8.node, $5.byRef) - } else { - $$ = stmt.NewForeach($3, nil, $5.node, $8.node, $5.byRef) + switch n := $8.(type) { + case *stmt.Foreach : + n.Expr = $3 + n.ByRef = $5.byRef + n.Variable = $5.node + case *stmt.AltForeach : + n.Expr = $3 + n.ByRef = $5.byRef + n.Variable = $5.node } } else { - if ($8.isAlt) { - $$ = stmt.NewAltForeach($3, $5.node, $6.node, $8.node, $6.byRef) - } else { - $$ = stmt.NewForeach($3, $5.node, $6.node, $8.node, $6.byRef) + switch n := $8.(type) { + case *stmt.Foreach : + n.Expr = $3 + n.Key = $5.node + n.ByRef = $6.byRef + n.Variable = $6.node + case *stmt.AltForeach : + n.Expr = $3 + n.Key = $5.node + n.ByRef = $6.byRef + n.Variable = $6.node } } - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8.node)) + + $$ = $8 + + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) yylex.(*Parser).comments.AddComments($$, $1.Comments()) } | T_DECLARE '(' declare_list ')' declare_statement @@ -868,7 +909,7 @@ catch_statement: identifier := node.NewIdentifier(strings.TrimLeft($4.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).comments.AddComments(identifier, $4.Comments()) - + variable := expr.NewVariable(identifier) yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).comments.AddComments(variable, $4.Comments()) @@ -1097,22 +1138,34 @@ foreach_variable: for_statement: statement - { $$ = altSyntaxNode{$1, false} } + { + $$ = stmt.NewFor(nil, nil, nil, $1) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + } | ':' inner_statement_list T_ENDFOR ';' { - $$ = altSyntaxNode{stmt.NewStmtList($2), true} - yylex.(*Parser).positions.AddPosition($$.node, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + stmtList := stmt.NewStmtList($2) + $$ = stmt.NewAltFor(nil, nil, nil, stmtList) + + yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) } ; foreach_statement: statement - { $$ = altSyntaxNode{$1, false} } + { + $$ = stmt.NewForeach(nil, nil, nil, $1, false) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + } | ':' inner_statement_list T_ENDFOREACH ';' { - $$ = altSyntaxNode{stmt.NewStmtList($2), true} - yylex.(*Parser).positions.AddPosition($$.node, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + stmtList := stmt.NewStmtList($2) + $$ = stmt.NewAltForeach(nil, nil, nil, stmtList, false) + + yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) } ; @@ -1222,11 +1275,17 @@ case_separator: while_statement: statement - { $$ = altSyntaxNode{$1, false} } + { + $$ = stmt.NewWhile(nil, $1) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + } | ':' inner_statement_list T_ENDWHILE ';' { - $$ = altSyntaxNode{stmt.NewStmtList($2), true} - yylex.(*Parser).positions.AddPosition($$.node, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + stmtList := stmt.NewStmtList($2) + $$ = stmt.NewAltWhile(nil, stmtList) + + yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) } ; @@ -3948,8 +4007,3 @@ type simpleIndirectReference struct { all []*expr.Variable last *expr.Variable } - -type altSyntaxNode struct { - node node.Node - isAlt bool -} diff --git a/php7/php7.go b/php7/php7.go index e5ce2c0..53daa2b 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -29,7 +29,6 @@ type yySymType struct { list []node.Node foreachVariable foreachVariable str string - altSyntaxNode altSyntaxNode } const T_INCLUDE = 57346 @@ -344,7 +343,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:4241 +//line php7/php7.y:4286 type foreachVariable struct { node node.Node @@ -356,11 +355,6 @@ type boolWithToken struct { token *scanner.Token } -type altSyntaxNode struct { - node node.Node - isAlt bool -} - //line yacctab:1 var yyExca = [...]int{ -1, 1, @@ -632,13 +626,13 @@ var yyAct = [...]int{ 750, 324, 422, 377, 755, 614, 233, 255, 408, 618, 375, 225, 701, 195, 634, 194, 762, 771, 768, 769, 758, 193, 232, 760, 187, 686, 763, 669, 670, 777, - 671, 770, 1, 772, 766, 845, 797, 779, 798, 775, - 579, 791, 546, 800, 787, 639, 134, 546, 546, 112, - 38, 739, 230, 736, 231, 737, 234, 381, 663, 810, - 527, 256, 257, 531, 738, 106, 222, 740, 818, 805, - 526, 256, 257, 521, 860, 824, 367, 873, 827, 145, - 806, 792, 817, 232, 823, 142, 719, 323, 149, 255, - 836, 834, 660, 822, 278, 255, 251, 928, 830, 645, + 671, 770, 1, 772, 766, 38, 797, 779, 798, 775, + 579, 791, 546, 800, 787, 739, 134, 546, 546, 112, + 736, 737, 230, 381, 231, 663, 234, 531, 222, 810, + 527, 256, 257, 521, 738, 106, 860, 740, 818, 805, + 526, 256, 257, 367, 873, 824, 145, 792, 827, 142, + 806, 323, 817, 232, 823, 149, 719, 836, 660, 255, + 822, 834, 251, 639, 278, 255, 845, 928, 830, 645, 422, 255, 840, 849, 224, 43, 282, 42, 16, 15, 851, 843, 599, 267, 546, 49, 546, 848, 745, 746, 747, 744, 743, 742, 853, 48, 867, 108, 671, 255, @@ -1447,11 +1441,11 @@ var yyPgo = [...]int{ 855, 853, 5, 852, 83, 40, 845, 138, 43, 840, 837, 835, 825, 823, 119, 822, 819, 818, 817, 12, 815, 814, 44, 42, 32, 2, 15, 629, 41, 74, - 812, 809, 807, 8, 686, 20, 536, 806, 121, 803, - 802, 800, 71, 798, 33, 797, 795, 30, 37, 791, - 789, 28, 787, 786, 545, 784, 18, 783, 776, 26, - 773, 63, 1, 4, 768, 17, 767, 39, 765, 763, - 761, 7, 760, 6, 755, 745, 14, 742, + 812, 809, 807, 14, 806, 803, 8, 686, 20, 536, + 802, 121, 800, 798, 797, 71, 795, 33, 791, 789, + 30, 37, 787, 786, 28, 784, 783, 545, 776, 18, + 773, 768, 26, 767, 63, 1, 4, 765, 17, 763, + 39, 761, 760, 755, 7, 745, 6, 742, } var yyR1 = [...]int{ @@ -1462,29 +1456,29 @@ var yyR1 = [...]int{ 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, 5, - 5, 5, 5, 5, 5, 5, 6, 6, 111, 111, - 88, 88, 10, 10, 10, 9, 9, 9, 9, 9, + 5, 5, 5, 5, 5, 5, 6, 6, 114, 114, + 91, 91, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 84, 84, 16, 16, 18, 18, 7, 7, 98, 98, - 97, 97, 104, 104, 17, 17, 20, 20, 19, 19, - 92, 92, 112, 112, 22, 22, 22, 22, 22, 22, + 87, 87, 16, 16, 18, 18, 7, 7, 101, 101, + 100, 100, 107, 107, 17, 17, 20, 20, 19, 19, + 95, 95, 115, 115, 22, 22, 22, 22, 22, 22, 22, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 90, 90, 89, 89, 26, - 26, 103, 103, 27, 12, 1, 1, 2, 2, 13, - 13, 122, 122, 77, 77, 14, 15, 29, 29, 116, - 116, 117, 117, 85, 85, 85, 85, 125, 125, 126, - 126, 25, 25, 81, 81, 81, 81, 101, 101, 101, - 8, 8, 124, 124, 68, 68, 66, 66, 70, 70, - 67, 67, 113, 113, 114, 114, 30, 30, 31, 31, - 76, 76, 74, 74, 74, 75, 75, 78, 78, 110, - 110, 32, 32, 96, 96, 34, 100, 100, 35, 35, - 115, 115, 36, 36, 36, 36, 121, 121, 80, 80, - 80, 102, 102, 37, 37, 38, 39, 39, 39, 39, - 41, 41, 40, 82, 82, 119, 119, 118, 118, 120, - 120, 83, 83, 83, 83, 83, 83, 99, 99, 42, - 42, 91, 91, 69, 21, 93, 93, 43, 94, 94, - 95, 95, 45, 44, 44, 33, 33, 33, 33, 33, + 11, 11, 11, 11, 11, 93, 93, 92, 92, 26, + 26, 106, 106, 27, 12, 1, 1, 2, 2, 13, + 13, 125, 125, 77, 77, 14, 15, 29, 29, 119, + 119, 120, 120, 88, 88, 88, 88, 84, 84, 83, + 83, 25, 25, 81, 81, 81, 81, 104, 104, 104, + 8, 8, 85, 85, 68, 68, 66, 66, 70, 70, + 67, 67, 116, 116, 117, 117, 30, 30, 31, 31, + 76, 76, 74, 74, 74, 75, 75, 78, 78, 113, + 113, 32, 32, 99, 99, 34, 103, 103, 35, 35, + 118, 118, 36, 36, 36, 36, 124, 124, 80, 80, + 80, 105, 105, 37, 37, 38, 39, 39, 39, 39, + 41, 41, 40, 82, 82, 122, 122, 121, 121, 123, + 123, 86, 86, 86, 86, 86, 86, 102, 102, 42, + 42, 94, 94, 69, 21, 96, 96, 43, 97, 97, + 98, 98, 45, 44, 44, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, @@ -1492,18 +1486,18 @@ var yyR1 = [...]int{ 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 123, 3, 3, 106, 106, 105, 105, 52, 52, + 33, 126, 3, 3, 109, 109, 108, 108, 52, 52, 53, 53, 53, 53, 46, 46, 47, 47, 50, 50, - 87, 87, 87, 79, 79, 57, 57, 57, 51, 51, + 90, 90, 90, 79, 79, 57, 57, 57, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 58, 58, 58, 23, 23, 24, 24, 56, 59, 59, 59, 60, 60, 60, 61, 61, 61, 61, 61, 61, 28, 28, 28, 48, 48, 48, 62, 62, 63, 63, 63, 63, 63, 63, 54, 54, - 54, 55, 55, 55, 109, 72, 72, 108, 108, 71, - 71, 71, 71, 71, 71, 86, 86, 86, 86, 64, + 54, 55, 55, 55, 112, 72, 72, 111, 111, 71, + 71, 71, 71, 71, 71, 89, 89, 89, 89, 64, 64, 64, 64, 64, 64, 64, 65, 65, 65, 65, - 49, 49, 49, 49, 49, 49, 49, 107, 107, 73, + 49, 49, 49, 49, 49, 49, 49, 110, 110, 73, } var yyR2 = [...]int{ @@ -1559,10 +1553,10 @@ var yyR2 = [...]int{ } var yyChk = [...]int{ - -1000, -127, -111, -9, 2, -11, -12, -13, -14, -15, + -1000, -127, -114, -9, 2, -11, -12, -13, -14, -15, 51, 79, 44, 38, 142, -66, -67, 21, 20, 23, 30, 34, 35, 39, 46, 98, 19, 14, -23, 48, - 25, 27, 144, 40, 43, 36, 10, 37, -122, 52, + 25, 27, 144, 40, 43, 36, 10, 37, -125, 52, 53, 54, -68, -70, -28, -33, -77, 7, -61, -62, -59, 59, 148, 92, 104, 105, 153, 152, 154, 155, 146, -44, -49, 107, 108, 109, 110, 111, 112, 113, @@ -1570,10 +1564,10 @@ var yyChk = [...]int{ -58, -53, -46, -56, -57, 91, 49, 50, 4, 5, 84, 85, 86, 8, 9, 66, 67, 81, 63, 64, 65, 80, 62, 74, 140, 12, 157, -10, -60, 60, - 18, -88, 82, 146, 82, -88, 142, 10, -18, -84, - -104, -88, 82, 37, 38, -19, -20, -92, -21, 10, - -112, 146, -11, 37, 79, 146, 146, -24, -23, 98, - -24, -24, -96, -34, -48, -100, 37, -35, 12, -93, + 18, -91, 82, 146, 82, -91, 142, 10, -18, -87, + -107, -91, 82, 37, 38, -19, -20, -95, -21, 10, + -115, 146, -11, 37, 79, 146, 146, -24, -23, 98, + -24, -24, -99, -34, -48, -103, 37, -35, 12, -96, -43, -23, 144, 129, 130, 87, 89, 88, 159, 151, 161, 167, 153, 152, 162, 131, 163, 164, 132, 133, 134, 135, 136, 137, 165, 138, 166, 139, 115, 90, @@ -1581,26 +1575,26 @@ var yyChk = [...]int{ 151, 52, -77, 10, 10, 10, 93, 94, 93, 95, 94, 160, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 104, 105, 146, 148, 142, 57, - 146, -109, -108, -72, -71, -23, 151, 59, -23, -28, + 146, -112, -111, -72, -71, -23, 151, 59, -23, -28, -58, 146, -57, 98, 148, -28, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -50, 146, - -23, -87, 17, -86, -64, 12, 76, 77, -23, -23, + -23, -90, 17, -89, -64, 12, 76, 77, -23, -23, -23, 148, 78, 78, -47, -45, -46, -63, 52, -10, -48, 146, 146, -23, -23, 146, -23, -23, 17, 75, - -86, -86, 17, 142, -48, -78, 146, -78, 146, 82, - -88, 147, -88, 144, 142, -111, 144, -16, -104, -88, - 82, 144, 158, 82, 29, -88, -20, 144, 158, 160, + -89, -89, 17, 142, -48, -78, 146, -78, 146, 82, + -91, 147, -91, 144, 142, -114, 144, -16, -107, -91, + 82, 144, 158, 82, 29, -91, -20, 144, 158, 160, -22, 143, 2, -11, -12, -13, -14, -15, 51, -23, - 21, -3, -94, -95, -23, -23, 144, 144, 144, 144, + 21, -3, -97, -98, -23, -23, 144, 144, 144, 144, 158, 144, 158, -3, 160, 144, 158, -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, -47, -23, 145, -23, -103, -27, -28, - -23, -92, -112, 144, 144, 10, -123, 10, -29, 55, - -123, -116, 55, 146, -11, 146, 144, 145, -23, 151, + -23, -23, -23, -47, -23, 145, -23, -106, -27, -28, + -23, -95, -115, 144, 144, 10, -126, 10, -29, 55, + -126, -119, 55, 146, -11, 146, 144, 145, -23, 151, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -24, -23, -55, 10, 142, -48, -109, - 149, 158, 58, -28, 146, -23, -109, 147, -24, 141, + -23, -23, -23, -24, -23, -55, 10, 142, -48, -112, + 149, 158, 58, -28, 146, -23, -112, 147, -24, 141, -64, -64, 17, 148, 57, -23, 11, -28, 58, -24, -54, -6, -48, 142, 10, -5, -4, 98, 99, 100, 101, 102, 103, 4, 5, 84, 85, 86, 87, 88, @@ -1611,48 +1605,48 @@ var yyChk = [...]int{ 31, 32, 33, 34, 60, 61, 55, 56, 79, 53, 54, 52, 62, 63, 65, 64, 66, 67, 81, 80, -54, -6, -48, -79, -78, 78, 148, 142, 57, 78, - -79, -107, -73, -23, -23, -23, 75, 75, 140, -23, - 147, -110, -32, -23, 83, -109, 10, 144, -111, 143, - 144, 144, 82, -88, -19, 82, -88, 142, 10, 82, + -79, -110, -73, -23, -23, -23, 75, 75, 140, -23, + 147, -113, -32, -23, 83, -112, 10, 144, -114, 143, + 144, 144, 82, -91, -19, 82, -91, 142, 10, 82, -21, -23, 146, 147, 146, 144, 158, 147, -34, -35, - -123, -23, -43, 145, -23, -7, 158, 29, 147, 143, - -123, 146, -29, -117, 56, -10, 142, -123, -121, -10, - -23, -23, -112, -23, 147, 149, 143, -78, -23, 147, - 160, -72, -23, 151, 59, -109, 147, 149, 147, -65, + -126, -23, -43, 145, -23, -7, 158, 29, 147, 143, + -126, 146, -29, -120, 56, -10, 142, -126, -124, -10, + -23, -23, -115, -23, 147, 149, 143, -78, -23, 147, + 160, -72, -23, 151, 59, -112, 147, 149, 147, -65, 10, 13, 152, 12, 10, 143, 143, 148, 143, -23, 149, -78, -23, -78, -48, -24, -23, -55, -48, -29, -7, 158, 147, 147, 143, -7, 158, -23, 147, 143, - 142, 82, -98, -17, -20, -84, 142, -123, 147, -124, - -11, 145, -23, -94, -23, -81, 142, 145, 146, -23, - 147, -27, -85, -28, 151, 59, 148, -25, -11, 145, - -90, 146, -113, -114, -30, -31, -76, -74, 150, 60, - 61, -10, -117, -123, -121, -115, 142, 158, 147, 147, + 142, 82, -101, -17, -20, -87, 142, -126, 147, -85, + -11, 145, -23, -97, -23, -81, 142, 145, 146, -23, + 147, -27, -88, -28, 151, 59, 148, -25, -11, 145, + -93, 146, -116, -117, -30, -31, -76, -74, 150, 60, + 61, -10, -120, -126, -124, -118, 142, 158, 147, 147, 95, -11, 145, 143, 160, -23, -28, 146, 147, 149, - 13, -23, 143, 149, 143, -117, 147, -73, 147, -32, - -97, -20, 142, -7, 158, -20, -98, 144, -112, 147, - 144, -101, 144, -101, 144, -113, 144, 147, 58, -28, - 146, -109, -112, -26, 41, 42, -113, 147, 158, -1, - 151, -74, -123, 142, 143, -36, -119, -118, 44, -120, - 47, -83, 103, 102, 101, 98, 99, 100, -115, -10, - -11, 145, 144, -112, -23, -109, 149, -123, -7, 158, - -97, 143, -17, -7, 22, 144, -94, 143, 32, 33, - -101, 31, -101, 147, -126, -11, 145, -85, -28, -109, - 149, 28, 146, 142, 147, -106, 44, -30, -2, 83, - 142, -115, -99, -42, 12, 38, 37, -121, -83, 143, - -112, 147, 143, 142, 143, -20, -7, 143, 144, 147, - -23, -8, 145, 144, 143, 144, 31, -106, -112, 147, - 147, 144, -89, -10, -112, -75, 145, -75, 146, 12, - -115, 143, 144, 158, -123, 160, -91, -69, -6, -3, - -80, 144, 142, -115, 143, -125, -11, 145, -8, -112, - 144, -75, 26, -126, 12, 159, 143, 142, -76, 142, - -105, -52, 12, 151, 160, 143, -42, -23, 144, 158, - 160, -6, 143, -102, -37, -38, -39, -40, -41, -10, - -6, 79, 10, 143, -112, -112, 142, 144, 147, -10, - -112, -112, 147, 158, 12, -23, -123, -69, -23, -123, - 143, -37, 144, 144, 45, 29, 78, 24, -112, 142, - 143, 143, -52, -123, 146, -121, 10, -4, -83, -6, - 144, 143, -112, -113, -6, 143, 147, -75, -82, 144, - 142, -112, 143, + 13, -23, 143, 149, 143, -120, 147, -73, 147, -32, + -100, -20, 142, -7, 158, -20, -101, 144, -115, 147, + 144, -104, 144, -104, 144, -116, 144, 147, 58, -28, + 146, -112, -115, -26, 41, 42, -116, 147, 158, -1, + 151, -74, -126, 142, 143, -36, -122, -121, 44, -123, + 47, -86, 103, 102, 101, 98, 99, 100, -118, -10, + -11, 145, 144, -115, -23, -112, 149, -126, -7, 158, + -100, 143, -17, -7, 22, 144, -97, 143, 32, 33, + -104, 31, -104, 147, -83, -11, 145, -88, -28, -112, + 149, 28, 146, 142, 147, -109, 44, -30, -2, 83, + 142, -118, -102, -42, 12, 38, 37, -124, -86, 143, + -115, 147, 143, 142, 143, -20, -7, 143, 144, 147, + -23, -8, 145, 144, 143, 144, 31, -109, -115, 147, + 147, 144, -92, -10, -115, -75, 145, -75, 146, 12, + -118, 143, 144, 158, -126, 160, -94, -69, -6, -3, + -80, 144, 142, -118, 143, -84, -11, 145, -8, -115, + 144, -75, 26, -83, 12, 159, 143, 142, -76, 142, + -108, -52, 12, 151, 160, 143, -42, -23, 144, 158, + 160, -6, 143, -105, -37, -38, -39, -40, -41, -10, + -6, 79, 10, 143, -115, -115, 142, 144, 147, -10, + -115, -115, 147, 158, 12, -23, -126, -69, -23, -126, + 143, -37, 144, 144, 45, 29, 78, 24, -115, 142, + 143, 143, -52, -126, 146, -124, 10, -4, -86, -6, + 144, 143, -115, -116, -6, 143, 147, -75, -82, 144, + 142, -115, 143, } var yyDef = [...]int{ @@ -2127,7 +2121,7 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:295 + //line php7/php7.y:293 { yylex.(*Parser).rootNode = node.NewRoot(yyDollar[1].list) @@ -2136,463 +2130,463 @@ yydefault: } case 2: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 3: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 5: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 10: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 11: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 12: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 13: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 14: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 15: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 16: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 17: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 18: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 21: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 22: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 23: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 24: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 27: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 28: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 29: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 30: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 33: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 34: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 35: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 36: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 37: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 38: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 39: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 44: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 46: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 47: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 48: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 49: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 50: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 51: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 52: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 53: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 54: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 55: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 56: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 57: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 58: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 59: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 60: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 61: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 62: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 63: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 64: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 66: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 67: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 68: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 69: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:315 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 70: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 72: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 73: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 74: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 75: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:316 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 76: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:321 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 77: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:323 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 78: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:328 + //line php7/php7.y:326 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2600,13 +2594,13 @@ yydefault: } case 79: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:334 + //line php7/php7.y:332 { yyVAL.list = []node.Node{} } case 80: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:339 + //line php7/php7.y:337 { namePart := name.NewNamePart(yyDollar[1].token.Value) yyVAL.list = []node.Node{namePart} @@ -2619,7 +2613,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:350 + //line php7/php7.y:348 { namePart := name.NewNamePart(yyDollar[3].token.Value) yyVAL.list = append(yyDollar[1].list, namePart) @@ -2633,7 +2627,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:365 + //line php7/php7.y:363 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -2642,7 +2636,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:372 + //line php7/php7.y:370 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -2655,7 +2649,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:383 + //line php7/php7.y:381 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -2667,44 +2661,44 @@ yydefault: } case 85: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:396 + //line php7/php7.y:394 { // error yyVAL.node = nil } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:401 + //line php7/php7.y:399 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:403 + //line php7/php7.y:401 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:405 + //line php7/php7.y:403 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:407 + //line php7/php7.y:405 { yyVAL.node = yyDollar[1].node } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:409 + //line php7/php7.y:407 { yyVAL.node = yyDollar[1].node } case 91: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:411 + //line php7/php7.y:409 { yyVAL.node = stmt.NewHaltCompiler() @@ -2719,7 +2713,7 @@ yydefault: } case 92: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:424 + //line php7/php7.y:422 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2734,7 +2728,7 @@ yydefault: } case 93: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:437 + //line php7/php7.y:435 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2750,7 +2744,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:451 + //line php7/php7.y:449 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2764,7 +2758,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:463 + //line php7/php7.y:461 { yyVAL.node = yyDollar[2].node @@ -2777,7 +2771,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:474 + //line php7/php7.y:472 { yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) @@ -2790,7 +2784,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:485 + //line php7/php7.y:483 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2803,7 +2797,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:496 + //line php7/php7.y:494 { yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) @@ -2816,7 +2810,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:507 + //line php7/php7.y:505 { yyVAL.node = stmt.NewConstList(yyDollar[2].list) @@ -2829,7 +2823,7 @@ yydefault: } case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:521 + //line php7/php7.y:519 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2841,7 +2835,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:531 + //line php7/php7.y:529 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2853,7 +2847,7 @@ yydefault: } case 102: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:544 + //line php7/php7.y:542 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2872,7 +2866,7 @@ yydefault: } case 103: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:561 + //line php7/php7.y:559 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2892,7 +2886,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:582 + //line php7/php7.y:580 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2911,7 +2905,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:599 + //line php7/php7.y:597 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2931,19 +2925,19 @@ yydefault: } case 106: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:620 + //line php7/php7.y:618 { yyVAL.token = nil } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:622 + //line php7/php7.y:620 { yyVAL.token = yyDollar[1].token } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:627 + //line php7/php7.y:625 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2952,13 +2946,13 @@ yydefault: } case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:634 + //line php7/php7.y:632 { yyVAL.list = []node.Node{yyDollar[1].node} } case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:639 + //line php7/php7.y:637 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2967,13 +2961,13 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:646 + //line php7/php7.y:644 { yyVAL.list = []node.Node{yyDollar[1].node} } case 112: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:651 + //line php7/php7.y:649 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2982,25 +2976,25 @@ yydefault: } case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:658 + //line php7/php7.y:656 { yyVAL.list = []node.Node{yyDollar[1].node} } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:663 + //line php7/php7.y:661 { yyVAL.node = yyDollar[1].node } case 115: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:665 + //line php7/php7.y:663 { yyVAL.node = yyDollar[2].node.(*stmt.Use).SetUseType(yyDollar[1].node) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:670 + //line php7/php7.y:668 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -3011,7 +3005,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:679 + //line php7/php7.y:677 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -3028,13 +3022,13 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:697 + //line php7/php7.y:695 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:699 + //line php7/php7.y:697 { yyVAL.node = yyDollar[2].node @@ -3043,7 +3037,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:709 + //line php7/php7.y:707 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3052,13 +3046,13 @@ yydefault: } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:716 + //line php7/php7.y:714 { yyVAL.list = []node.Node{yyDollar[1].node} } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:721 + //line php7/php7.y:719 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3066,50 +3060,50 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:727 + //line php7/php7.y:725 { yyVAL.list = []node.Node{} } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:732 + //line php7/php7.y:730 { // error yyVAL.node = nil } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:737 + //line php7/php7.y:735 { yyVAL.node = yyDollar[1].node } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:739 + //line php7/php7.y:737 { yyVAL.node = yyDollar[1].node } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:741 + //line php7/php7.y:739 { yyVAL.node = yyDollar[1].node } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:743 + //line php7/php7.y:741 { yyVAL.node = yyDollar[1].node } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:745 + //line php7/php7.y:743 { yyVAL.node = yyDollar[1].node } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:747 + //line php7/php7.y:745 { yyVAL.node = stmt.NewHaltCompiler() @@ -3124,7 +3118,7 @@ yydefault: } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:762 + //line php7/php7.y:760 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3137,28 +3131,31 @@ yydefault: } case 132: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:773 + //line php7/php7.y:771 { yyVAL.node = yyDollar[1].node } case 133: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:775 + //line php7/php7.y:773 { yyVAL.node = yyDollar[1].node } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:777 + //line php7/php7.y:775 { - if yyDollar[5].altSyntaxNode.isAlt { - yyVAL.node = stmt.NewAltWhile(yyDollar[3].node, yyDollar[5].altSyntaxNode.node) - } else { - yyVAL.node = stmt.NewWhile(yyDollar[3].node, yyDollar[5].altSyntaxNode.node) + switch n := yyDollar[5].node.(type) { + case *stmt.While: + n.Cond = yyDollar[3].node + case *stmt.AltWhile: + n.Cond = yyDollar[3].node } + yyVAL.node = yyDollar[5].node + // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].altSyntaxNode.node)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.WhileToken) @@ -3167,7 +3164,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:793 + //line php7/php7.y:794 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) @@ -3183,16 +3180,23 @@ yydefault: } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:807 + //line php7/php7.y:808 { - if yyDollar[9].altSyntaxNode.isAlt { - yyVAL.node = stmt.NewAltFor(yyDollar[3].list, yyDollar[5].list, yyDollar[7].list, yyDollar[9].altSyntaxNode.node) - } else { - yyVAL.node = stmt.NewFor(yyDollar[3].list, yyDollar[5].list, yyDollar[7].list, yyDollar[9].altSyntaxNode.node) + switch n := yyDollar[9].node.(type) { + case *stmt.For: + n.Init = yyDollar[3].list + n.Cond = yyDollar[5].list + n.Loop = yyDollar[7].list + case *stmt.AltFor: + n.Init = yyDollar[3].list + n.Cond = yyDollar[5].list + n.Loop = yyDollar[7].list } + yyVAL.node = yyDollar[9].node + // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].altSyntaxNode.node)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForToken) @@ -3203,7 +3207,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:825 + //line php7/php7.y:833 { switch n := yyDollar[5].node.(type) { case *stmt.Switch: @@ -3226,7 +3230,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:846 + //line php7/php7.y:854 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3239,7 +3243,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:857 + //line php7/php7.y:865 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3252,7 +3256,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:868 + //line php7/php7.y:876 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3265,7 +3269,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:879 + //line php7/php7.y:887 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3278,7 +3282,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:890 + //line php7/php7.y:898 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3291,7 +3295,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:901 + //line php7/php7.y:909 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3304,7 +3308,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:912 + //line php7/php7.y:920 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3316,7 +3320,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:922 + //line php7/php7.y:930 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3328,7 +3332,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:932 + //line php7/php7.y:940 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3346,16 +3350,23 @@ yydefault: } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:948 + //line php7/php7.y:956 { - if yyDollar[7].altSyntaxNode.isAlt { - yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, nil, yyDollar[5].foreachVariable.node, yyDollar[7].altSyntaxNode.node, yyDollar[5].foreachVariable.byRef) - } else { - yyVAL.node = stmt.NewForeach(yyDollar[3].node, nil, yyDollar[5].foreachVariable.node, yyDollar[7].altSyntaxNode.node, yyDollar[5].foreachVariable.byRef) + switch n := yyDollar[7].node.(type) { + case *stmt.Foreach: + n.Expr = yyDollar[3].node + n.ByRef = yyDollar[5].foreachVariable.byRef + n.Variable = yyDollar[5].foreachVariable.node + case *stmt.AltForeach: + n.Expr = yyDollar[3].node + n.ByRef = yyDollar[5].foreachVariable.byRef + n.Variable = yyDollar[5].foreachVariable.node } + yyVAL.node = yyDollar[7].node + // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[7].altSyntaxNode.node)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[7].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForeachToken) @@ -3365,16 +3376,25 @@ yydefault: } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:965 + //line php7/php7.y:980 { - if yyDollar[9].altSyntaxNode.isAlt { - yyVAL.node = stmt.NewAltForeach(yyDollar[3].node, yyDollar[5].node, yyDollar[7].foreachVariable.node, yyDollar[9].altSyntaxNode.node, yyDollar[7].foreachVariable.byRef) - } else { - yyVAL.node = stmt.NewForeach(yyDollar[3].node, yyDollar[5].node, yyDollar[7].foreachVariable.node, yyDollar[9].altSyntaxNode.node, yyDollar[7].foreachVariable.byRef) + switch n := yyDollar[9].node.(type) { + case *stmt.Foreach: + n.Expr = yyDollar[3].node + n.Key = yyDollar[5].node + n.ByRef = yyDollar[7].foreachVariable.byRef + n.Variable = yyDollar[7].foreachVariable.node + case *stmt.AltForeach: + n.Expr = yyDollar[3].node + n.Key = yyDollar[5].node + n.ByRef = yyDollar[7].foreachVariable.byRef + n.Variable = yyDollar[7].foreachVariable.node } + yyVAL.node = yyDollar[9].node + // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].altSyntaxNode.node)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForeachToken) @@ -3385,7 +3405,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:983 + //line php7/php7.y:1007 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) @@ -3399,7 +3419,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:995 + //line php7/php7.y:1019 { yyVAL.node = stmt.NewNop() @@ -3411,7 +3431,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1005 + //line php7/php7.y:1029 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3428,7 +3448,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1020 + //line php7/php7.y:1044 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3441,7 +3461,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1031 + //line php7/php7.y:1055 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3457,7 +3477,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1045 + //line php7/php7.y:1069 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -3472,13 +3492,13 @@ yydefault: } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1060 + //line php7/php7.y:1084 { yyVAL.list = []node.Node{} } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1062 + //line php7/php7.y:1086 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[5].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -3500,13 +3520,13 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1084 + //line php7/php7.y:1108 { yyVAL.list = []node.Node{yyDollar[1].node} } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1086 + //line php7/php7.y:1110 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3515,13 +3535,13 @@ yydefault: } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1096 + //line php7/php7.y:1120 { yyVAL.node = nil } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1098 + //line php7/php7.y:1122 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3535,13 +3555,13 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1113 + //line php7/php7.y:1137 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1115 + //line php7/php7.y:1139 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3550,13 +3570,13 @@ yydefault: } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1125 + //line php7/php7.y:1149 { yyVAL.node = yyDollar[1].node } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1130 + //line php7/php7.y:1154 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].boolWithToken.value, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) @@ -3578,31 +3598,31 @@ yydefault: } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1153 + //line php7/php7.y:1177 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1155 + //line php7/php7.y:1179 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1160 + //line php7/php7.y:1184 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1162 + //line php7/php7.y:1186 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1167 + //line php7/php7.y:1191 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].node, yyDollar[5].list, yyDollar[8].list, yyDollar[6].str) @@ -3625,7 +3645,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1188 + //line php7/php7.y:1212 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) @@ -3648,19 +3668,19 @@ yydefault: } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1212 + //line php7/php7.y:1236 { yyVAL.list = []node.Node{yyDollar[1].node} } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1214 + //line php7/php7.y:1238 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1219 + //line php7/php7.y:1243 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3672,7 +3692,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1229 + //line php7/php7.y:1253 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3684,7 +3704,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1242 + //line php7/php7.y:1266 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3701,7 +3721,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1260 + //line php7/php7.y:1284 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].list, yyDollar[6].list, yyDollar[4].str) @@ -3721,13 +3741,13 @@ yydefault: } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1281 + //line php7/php7.y:1305 { yyVAL.node = nil } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1283 + //line php7/php7.y:1307 { yyVAL.node = yyDollar[2].node @@ -3736,13 +3756,13 @@ yydefault: } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1293 + //line php7/php7.y:1317 { yyVAL.list = nil } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1295 + //line php7/php7.y:1319 { yyVAL.list = yyDollar[2].list @@ -3751,13 +3771,13 @@ yydefault: } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1305 + //line php7/php7.y:1329 { yyVAL.list = nil } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1307 + //line php7/php7.y:1331 { yyVAL.list = yyDollar[2].list @@ -3766,13 +3786,13 @@ yydefault: } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1317 + //line php7/php7.y:1341 { yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1319 + //line php7/php7.y:1343 { yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} @@ -3784,7 +3804,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1329 + //line php7/php7.y:1353 { list := expr.NewList(yyDollar[3].list) yyVAL.foreachVariable = foreachVariable{list, false} @@ -3799,7 +3819,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1342 + //line php7/php7.y:1366 { list := expr.NewShortList(yyDollar[2].list) yyVAL.foreachVariable = foreachVariable{list, false} @@ -3813,53 +3833,63 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1357 + //line php7/php7.y:1381 { - yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} + yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1359 + //line php7/php7.y:1388 { - yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} + stmtList := stmt.NewStmtList(yyDollar[2].list) + yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[1].token, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[3].token, comment.EndforToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[4].token, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EndforToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1374 + //line php7/php7.y:1405 { - yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} + yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node, false) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1376 + //line php7/php7.y:1412 { - yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} + stmtList := stmt.NewStmtList(yyDollar[2].list) + yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList, false) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[1].token, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[3].token, comment.EndforeachToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[4].token, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EndforeachToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1391 + //line php7/php7.y:1429 { yyVAL.node = yyDollar[1].node } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1393 + //line php7/php7.y:1431 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3873,7 +3903,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1408 + //line php7/php7.y:1446 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3888,7 +3918,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1421 + //line php7/php7.y:1459 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3904,7 +3934,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1435 + //line php7/php7.y:1473 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -3920,7 +3950,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1449 + //line php7/php7.y:1487 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -3938,13 +3968,13 @@ yydefault: } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1468 + //line php7/php7.y:1506 { yyVAL.list = []node.Node{} } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1470 + //line php7/php7.y:1508 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -3958,7 +3988,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1482 + //line php7/php7.y:1520 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -3972,39 +4002,44 @@ yydefault: } case 200: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1497 + //line php7/php7.y:1535 { yyVAL.token = yyDollar[1].token } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1499 + //line php7/php7.y:1537 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1504 + //line php7/php7.y:1542 { - yyVAL.altSyntaxNode = altSyntaxNode{yyDollar[1].node, false} + yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1506 + //line php7/php7.y:1549 { - yyVAL.altSyntaxNode = altSyntaxNode{stmt.NewStmtList(yyDollar[2].list), true} + stmtList := stmt.NewStmtList(yyDollar[2].list) + yyVAL.node = stmt.NewAltWhile(nil, stmtList) // save position - yylex.(*Parser).positions.AddPosition(yyVAL.altSyntaxNode.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[1].token, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[3].token, comment.EndwhileToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.altSyntaxNode.node, yyDollar[4].token, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EndwhileToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1521 + //line php7/php7.y:1566 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -4018,7 +4053,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1533 + //line php7/php7.y:1578 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -4034,13 +4069,13 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1550 + //line php7/php7.y:1595 { yyVAL.node = yyDollar[1].node } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1552 + //line php7/php7.y:1597 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4054,7 +4089,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1567 + //line php7/php7.y:1612 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4071,7 +4106,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1582 + //line php7/php7.y:1627 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4089,7 +4124,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1601 + //line php7/php7.y:1646 { yyVAL.node = yyDollar[1].node @@ -4102,7 +4137,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1612 + //line php7/php7.y:1657 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4121,25 +4156,25 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1632 + //line php7/php7.y:1677 { yyVAL.list = yyDollar[1].list } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1634 + //line php7/php7.y:1679 { yyVAL.list = nil } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1639 + //line php7/php7.y:1684 { yyVAL.list = []node.Node{yyDollar[1].node} } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1641 + //line php7/php7.y:1686 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4148,7 +4183,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1651 + //line php7/php7.y:1696 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4187,7 +4222,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1688 + //line php7/php7.y:1733 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4226,25 +4261,25 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1728 + //line php7/php7.y:1773 { yyVAL.node = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1730 + //line php7/php7.y:1775 { yyVAL.node = yyDollar[1].node } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1735 + //line php7/php7.y:1780 { yyVAL.node = yyDollar[1].node } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1737 + //line php7/php7.y:1782 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4256,7 +4291,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1750 + //line php7/php7.y:1795 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4268,7 +4303,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1760 + //line php7/php7.y:1805 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4280,19 +4315,19 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1770 + //line php7/php7.y:1815 { yyVAL.node = yyDollar[1].node } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1775 + //line php7/php7.y:1820 { yyVAL.node = nil } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1777 + //line php7/php7.y:1822 { yyVAL.node = yyDollar[2].node @@ -4301,7 +4336,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1787 + //line php7/php7.y:1832 { yyVAL.node = node.NewArgumentList(nil) @@ -4310,7 +4345,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1794 + //line php7/php7.y:1839 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4319,13 +4354,13 @@ yydefault: } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1804 + //line php7/php7.y:1849 { yyVAL.list = []node.Node{yyDollar[1].node} } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1806 + //line php7/php7.y:1851 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4334,7 +4369,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1816 + //line php7/php7.y:1861 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4343,7 +4378,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1823 + //line php7/php7.y:1868 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4355,7 +4390,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1836 + //line php7/php7.y:1881 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4364,19 +4399,19 @@ yydefault: } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1843 + //line php7/php7.y:1888 { yyVAL.list = []node.Node{yyDollar[1].node} } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1848 + //line php7/php7.y:1893 { yyVAL.node = yyDollar[1].node } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1853 + //line php7/php7.y:1898 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4385,13 +4420,13 @@ yydefault: } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1860 + //line php7/php7.y:1905 { yyVAL.list = []node.Node{yyDollar[1].node} } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1865 + //line php7/php7.y:1910 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4407,7 +4442,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1879 + //line php7/php7.y:1924 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4424,19 +4459,19 @@ yydefault: } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1897 + //line php7/php7.y:1942 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1899 + //line php7/php7.y:1944 { yyVAL.list = []node.Node{} } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1904 + //line php7/php7.y:1949 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4448,7 +4483,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1914 + //line php7/php7.y:1959 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4461,7 +4496,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1925 + //line php7/php7.y:1970 { var adaptationList *stmt.TraitAdaptationList @@ -4483,7 +4518,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:1945 + //line php7/php7.y:1990 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].boolWithToken.value, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) @@ -4507,13 +4542,13 @@ yydefault: } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1970 + //line php7/php7.y:2015 { yyVAL.list = []node.Node{yyDollar[1].node} } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1972 + //line php7/php7.y:2017 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4522,7 +4557,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1982 + //line php7/php7.y:2027 { yyVAL.node = stmt.NewNop() @@ -4534,7 +4569,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1992 + //line php7/php7.y:2037 { yyVAL.node = stmt.NewTraitAdaptationList(nil) @@ -4546,7 +4581,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2002 + //line php7/php7.y:2047 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4558,19 +4593,19 @@ yydefault: } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2015 + //line php7/php7.y:2060 { yyVAL.list = []node.Node{yyDollar[1].node} } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2017 + //line php7/php7.y:2062 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2022 + //line php7/php7.y:2067 { yyVAL.node = yyDollar[1].node @@ -4579,7 +4614,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2029 + //line php7/php7.y:2074 { yyVAL.node = yyDollar[1].node @@ -4588,7 +4623,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2039 + //line php7/php7.y:2084 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4600,7 +4635,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2052 + //line php7/php7.y:2097 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4615,7 +4650,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2065 + //line php7/php7.y:2110 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4630,7 +4665,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2078 + //line php7/php7.y:2123 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -4645,7 +4680,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2091 + //line php7/php7.y:2136 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -4657,7 +4692,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2104 + //line php7/php7.y:2149 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -4671,13 +4706,13 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2116 + //line php7/php7.y:2161 { yyVAL.node = yyDollar[1].node } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2121 + //line php7/php7.y:2166 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -4692,7 +4727,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2137 + //line php7/php7.y:2182 { yyVAL.node = stmt.NewNop() @@ -4704,7 +4739,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2147 + //line php7/php7.y:2192 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -4717,13 +4752,13 @@ yydefault: } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2161 + //line php7/php7.y:2206 { yyVAL.list = yyDollar[1].list } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2163 + //line php7/php7.y:2208 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -4736,31 +4771,31 @@ yydefault: } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2177 + //line php7/php7.y:2222 { yyVAL.list = nil } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2179 + //line php7/php7.y:2224 { yyVAL.list = yyDollar[1].list } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2184 + //line php7/php7.y:2229 { yyVAL.list = []node.Node{yyDollar[1].node} } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2186 + //line php7/php7.y:2231 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2191 + //line php7/php7.y:2236 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4772,7 +4807,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2201 + //line php7/php7.y:2246 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4784,7 +4819,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2211 + //line php7/php7.y:2256 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4796,7 +4831,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2221 + //line php7/php7.y:2266 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4808,7 +4843,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2231 + //line php7/php7.y:2276 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4820,7 +4855,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2241 + //line php7/php7.y:2286 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4832,7 +4867,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2254 + //line php7/php7.y:2299 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4841,13 +4876,13 @@ yydefault: } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2261 + //line php7/php7.y:2306 { yyVAL.list = []node.Node{yyDollar[1].node} } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2266 + //line php7/php7.y:2311 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4863,7 +4898,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2280 + //line php7/php7.y:2325 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4880,7 +4915,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2298 + //line php7/php7.y:2343 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4889,13 +4924,13 @@ yydefault: } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2305 + //line php7/php7.y:2350 { yyVAL.list = []node.Node{yyDollar[1].node} } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2310 + //line php7/php7.y:2355 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4910,7 +4945,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2326 + //line php7/php7.y:2371 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4925,7 +4960,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2342 + //line php7/php7.y:2387 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4934,31 +4969,31 @@ yydefault: } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2349 + //line php7/php7.y:2394 { yyVAL.list = []node.Node{yyDollar[1].node} } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2354 + //line php7/php7.y:2399 { yyVAL.node = yyDollar[1].node } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2359 + //line php7/php7.y:2404 { yyVAL.list = nil } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2361 + //line php7/php7.y:2406 { yyVAL.list = yyDollar[1].list } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2366 + //line php7/php7.y:2411 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4967,13 +5002,13 @@ yydefault: } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2373 + //line php7/php7.y:2418 { yyVAL.list = []node.Node{yyDollar[1].node} } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:2378 + //line php7/php7.y:2423 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) @@ -4997,7 +5032,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2403 + //line php7/php7.y:2448 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -5012,7 +5047,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2416 + //line php7/php7.y:2461 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -5024,7 +5059,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2429 + //line php7/php7.y:2474 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5041,7 +5076,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:2444 + //line php7/php7.y:2489 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5057,7 +5092,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2458 + //line php7/php7.y:2503 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5069,7 +5104,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2468 + //line php7/php7.y:2513 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5082,7 +5117,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2479 + //line php7/php7.y:2524 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5094,7 +5129,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2489 + //line php7/php7.y:2534 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5106,7 +5141,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2499 + //line php7/php7.y:2544 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5118,7 +5153,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2509 + //line php7/php7.y:2554 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5130,7 +5165,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2519 + //line php7/php7.y:2564 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5142,7 +5177,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2529 + //line php7/php7.y:2574 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5154,7 +5189,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2539 + //line php7/php7.y:2584 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5166,7 +5201,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2549 + //line php7/php7.y:2594 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5178,7 +5213,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2559 + //line php7/php7.y:2604 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5190,7 +5225,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2569 + //line php7/php7.y:2614 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5202,7 +5237,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2579 + //line php7/php7.y:2624 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5214,7 +5249,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2589 + //line php7/php7.y:2634 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5226,7 +5261,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2599 + //line php7/php7.y:2644 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5238,7 +5273,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2609 + //line php7/php7.y:2654 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5250,7 +5285,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2619 + //line php7/php7.y:2664 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5262,7 +5297,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2629 + //line php7/php7.y:2674 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5274,7 +5309,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2639 + //line php7/php7.y:2684 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5286,7 +5321,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2649 + //line php7/php7.y:2694 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5298,7 +5333,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2659 + //line php7/php7.y:2704 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5310,7 +5345,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2669 + //line php7/php7.y:2714 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5322,7 +5357,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2679 + //line php7/php7.y:2724 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5334,7 +5369,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2689 + //line php7/php7.y:2734 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5346,7 +5381,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2699 + //line php7/php7.y:2744 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5358,7 +5393,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2709 + //line php7/php7.y:2754 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5370,7 +5405,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2719 + //line php7/php7.y:2764 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5382,7 +5417,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2729 + //line php7/php7.y:2774 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5394,7 +5429,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2739 + //line php7/php7.y:2784 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5406,7 +5441,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2749 + //line php7/php7.y:2794 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5418,7 +5453,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2759 + //line php7/php7.y:2804 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5430,7 +5465,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2769 + //line php7/php7.y:2814 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5442,7 +5477,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2779 + //line php7/php7.y:2824 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5454,7 +5489,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2789 + //line php7/php7.y:2834 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5466,7 +5501,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2799 + //line php7/php7.y:2844 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5478,7 +5513,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2809 + //line php7/php7.y:2854 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5490,7 +5525,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2819 + //line php7/php7.y:2864 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -5502,7 +5537,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2829 + //line php7/php7.y:2874 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -5514,7 +5549,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2839 + //line php7/php7.y:2884 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -5526,7 +5561,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2849 + //line php7/php7.y:2894 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -5538,7 +5573,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2859 + //line php7/php7.y:2904 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5550,7 +5585,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2869 + //line php7/php7.y:2914 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5562,7 +5597,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2879 + //line php7/php7.y:2924 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -5574,7 +5609,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2889 + //line php7/php7.y:2934 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -5586,7 +5621,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2899 + //line php7/php7.y:2944 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -5598,7 +5633,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2909 + //line php7/php7.y:2954 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5610,7 +5645,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2919 + //line php7/php7.y:2964 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -5622,7 +5657,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2929 + //line php7/php7.y:2974 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5634,7 +5669,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2939 + //line php7/php7.y:2984 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -5646,7 +5681,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2949 + //line php7/php7.y:2994 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -5658,7 +5693,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2959 + //line php7/php7.y:3004 { yyVAL.node = yyDollar[2].node @@ -5668,13 +5703,13 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2967 + //line php7/php7.y:3012 { yyVAL.node = yyDollar[1].node } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:2969 + //line php7/php7.y:3014 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -5687,7 +5722,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2980 + //line php7/php7.y:3025 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -5700,7 +5735,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2991 + //line php7/php7.y:3036 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -5712,13 +5747,13 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3001 + //line php7/php7.y:3046 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3003 + //line php7/php7.y:3048 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -5730,7 +5765,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3013 + //line php7/php7.y:3058 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -5742,7 +5777,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3023 + //line php7/php7.y:3068 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -5754,7 +5789,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3033 + //line php7/php7.y:3078 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -5766,7 +5801,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3043 + //line php7/php7.y:3088 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -5778,7 +5813,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3053 + //line php7/php7.y:3098 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -5790,7 +5825,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3063 + //line php7/php7.y:3108 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -5802,7 +5837,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3073 + //line php7/php7.y:3118 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -5818,7 +5853,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3087 + //line php7/php7.y:3132 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -5830,13 +5865,13 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3097 + //line php7/php7.y:3142 { yyVAL.node = yyDollar[1].node } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3099 + //line php7/php7.y:3144 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -5849,7 +5884,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3110 + //line php7/php7.y:3155 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -5861,7 +5896,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3120 + //line php7/php7.y:3165 { yyVAL.node = expr.NewYield(nil, nil) @@ -5873,7 +5908,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3130 + //line php7/php7.y:3175 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -5885,7 +5920,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3140 + //line php7/php7.y:3185 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -5898,7 +5933,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3151 + //line php7/php7.y:3196 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -5910,7 +5945,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3161 + //line php7/php7.y:3206 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].boolWithToken.value, yyDollar[3].str) @@ -5929,7 +5964,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:3178 + //line php7/php7.y:3223 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].list, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].boolWithToken.value, yyDollar[4].str) @@ -5949,38 +5984,38 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3199 + //line php7/php7.y:3244 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3207 + //line php7/php7.y:3252 { yyVAL.boolWithToken = boolWithToken{false, nil} } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3209 + //line php7/php7.y:3254 { yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3214 + //line php7/php7.y:3259 { yyVAL.list = []node.Node{} } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3216 + //line php7/php7.y:3261 { yyVAL.list = yyDollar[3].list } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3221 + //line php7/php7.y:3266 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5989,13 +6024,13 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3228 + //line php7/php7.y:3273 { yyVAL.list = []node.Node{yyDollar[1].node} } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3233 + //line php7/php7.y:3278 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6011,7 +6046,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3247 + //line php7/php7.y:3292 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6028,7 +6063,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3265 + //line php7/php7.y:3310 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6037,7 +6072,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3272 + //line php7/php7.y:3317 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6049,7 +6084,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3282 + //line php7/php7.y:3327 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6061,7 +6096,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3292 + //line php7/php7.y:3337 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6070,7 +6105,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3302 + //line php7/php7.y:3347 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6082,67 +6117,67 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3312 + //line php7/php7.y:3357 { yyVAL.node = yyDollar[1].node } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3317 + //line php7/php7.y:3362 { yyVAL.node = yyDollar[1].node } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3319 + //line php7/php7.y:3364 { yyVAL.node = yyDollar[1].node } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3324 + //line php7/php7.y:3369 { yyVAL.node = nil } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3326 + //line php7/php7.y:3371 { yyVAL.node = yyDollar[2].node } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3331 + //line php7/php7.y:3376 { yyVAL.list = []node.Node{} } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3333 + //line php7/php7.y:3378 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3335 + //line php7/php7.y:3380 { yyVAL.list = yyDollar[1].list } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3340 + //line php7/php7.y:3385 { yyVAL.node = nil } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3342 + //line php7/php7.y:3387 { yyVAL.node = yyDollar[1].node } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3347 + //line php7/php7.y:3392 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6156,7 +6191,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3359 + //line php7/php7.y:3404 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6169,7 +6204,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3370 + //line php7/php7.y:3415 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6181,7 +6216,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3383 + //line php7/php7.y:3428 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6193,7 +6228,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3393 + //line php7/php7.y:3438 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6205,7 +6240,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3403 + //line php7/php7.y:3448 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6217,7 +6252,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3413 + //line php7/php7.y:3458 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6229,7 +6264,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3423 + //line php7/php7.y:3468 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6241,7 +6276,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3433 + //line php7/php7.y:3478 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6253,7 +6288,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3443 + //line php7/php7.y:3488 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6265,7 +6300,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3453 + //line php7/php7.y:3498 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6277,7 +6312,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3463 + //line php7/php7.y:3508 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6289,7 +6324,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3473 + //line php7/php7.y:3518 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6301,7 +6336,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3483 + //line php7/php7.y:3528 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -6315,7 +6350,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3495 + //line php7/php7.y:3540 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -6327,7 +6362,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3505 + //line php7/php7.y:3550 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -6339,7 +6374,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3515 + //line php7/php7.y:3560 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -6351,19 +6386,19 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3525 + //line php7/php7.y:3570 { yyVAL.node = yyDollar[1].node } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3527 + //line php7/php7.y:3572 { yyVAL.node = yyDollar[1].node } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3532 + //line php7/php7.y:3577 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -6372,7 +6407,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3539 + //line php7/php7.y:3584 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6387,7 +6422,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3552 + //line php7/php7.y:3597 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6402,43 +6437,43 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3568 + //line php7/php7.y:3613 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3570 + //line php7/php7.y:3615 { yyVAL.node = yyDollar[1].node } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3575 + //line php7/php7.y:3620 { yyVAL.node = nil } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3577 + //line php7/php7.y:3622 { yyVAL.node = yyDollar[1].node } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3582 + //line php7/php7.y:3627 { yyVAL.node = yyDollar[1].node } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3587 + //line php7/php7.y:3632 { yyVAL.node = yyDollar[1].node } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3589 + //line php7/php7.y:3634 { yyVAL.node = yyDollar[2].node @@ -6448,19 +6483,19 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3597 + //line php7/php7.y:3642 { yyVAL.node = yyDollar[1].node } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3602 + //line php7/php7.y:3647 { yyVAL.node = yyDollar[1].node } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3604 + //line php7/php7.y:3649 { yyVAL.node = yyDollar[2].node @@ -6470,19 +6505,19 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3612 + //line php7/php7.y:3657 { yyVAL.node = yyDollar[1].node } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3617 + //line php7/php7.y:3662 { yyVAL.node = yyDollar[1].node } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3619 + //line php7/php7.y:3664 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6495,7 +6530,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3630 + //line php7/php7.y:3675 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6508,7 +6543,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3641 + //line php7/php7.y:3686 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6521,7 +6556,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3652 + //line php7/php7.y:3697 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6533,25 +6568,25 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3662 + //line php7/php7.y:3707 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3667 + //line php7/php7.y:3712 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3669 + //line php7/php7.y:3714 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3671 + //line php7/php7.y:3716 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6563,7 +6598,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3684 + //line php7/php7.y:3729 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6577,7 +6612,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3696 + //line php7/php7.y:3741 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -6591,7 +6626,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3708 + //line php7/php7.y:3753 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6603,7 +6638,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3721 + //line php7/php7.y:3766 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6615,7 +6650,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3731 + //line php7/php7.y:3776 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6627,13 +6662,13 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3744 + //line php7/php7.y:3789 { yyVAL.node = yyDollar[1].node } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3746 + //line php7/php7.y:3791 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6646,7 +6681,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3757 + //line php7/php7.y:3802 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6659,7 +6694,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3768 + //line php7/php7.y:3813 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6671,7 +6706,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3778 + //line php7/php7.y:3823 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6683,7 +6718,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3788 + //line php7/php7.y:3833 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6695,7 +6730,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3801 + //line php7/php7.y:3846 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6707,7 +6742,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3811 + //line php7/php7.y:3856 { yyVAL.node = yyDollar[2].node @@ -6717,13 +6752,13 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3819 + //line php7/php7.y:3864 { yyVAL.node = yyDollar[1].node } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3824 + //line php7/php7.y:3869 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6735,7 +6770,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3834 + //line php7/php7.y:3879 { yyVAL.node = yyDollar[2].node @@ -6745,13 +6780,13 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3842 + //line php7/php7.y:3887 { yyVAL.node = yyDollar[1].node } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3847 + //line php7/php7.y:3892 { if yyDollar[1].list[len(yyDollar[1].list)-1] == nil { yyVAL.list = yyDollar[1].list[:len(yyDollar[1].list)-1] @@ -6761,19 +6796,19 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3858 + //line php7/php7.y:3903 { yyVAL.node = nil } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3860 + //line php7/php7.y:3905 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3865 + //line php7/php7.y:3910 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6782,13 +6817,13 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3872 + //line php7/php7.y:3917 { yyVAL.list = []node.Node{yyDollar[1].node} } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3877 + //line php7/php7.y:3922 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) @@ -6800,7 +6835,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3887 + //line php7/php7.y:3932 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) @@ -6809,7 +6844,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3894 + //line php7/php7.y:3939 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) @@ -6822,7 +6857,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3905 + //line php7/php7.y:3950 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[2].node, true) @@ -6834,7 +6869,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3915 + //line php7/php7.y:3960 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -6852,7 +6887,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3931 + //line php7/php7.y:3976 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -6869,13 +6904,13 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3949 + //line php7/php7.y:3994 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3951 + //line php7/php7.y:3996 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -6888,13 +6923,13 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3962 + //line php7/php7.y:4007 { yyVAL.list = []node.Node{yyDollar[1].node} } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3964 + //line php7/php7.y:4009 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -6907,7 +6942,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3978 + //line php7/php7.y:4023 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6921,7 +6956,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3990 + //line php7/php7.y:4035 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6939,7 +6974,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4006 + //line php7/php7.y:4051 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6959,7 +6994,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4024 + //line php7/php7.y:4069 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6972,7 +7007,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4035 + //line php7/php7.y:4080 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -6988,7 +7023,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:4049 + //line php7/php7.y:4094 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -7008,13 +7043,13 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4067 + //line php7/php7.y:4112 { yyVAL.node = yyDollar[2].node } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4073 + //line php7/php7.y:4118 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7026,7 +7061,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4083 + //line php7/php7.y:4128 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7043,7 +7078,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4098 + //line php7/php7.y:4143 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -7074,7 +7109,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4127 + //line php7/php7.y:4172 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(identifier) @@ -7088,7 +7123,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:4142 + //line php7/php7.y:4187 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -7105,7 +7140,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4157 + //line php7/php7.y:4202 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -7119,7 +7154,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4169 + //line php7/php7.y:4214 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -7131,7 +7166,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4179 + //line php7/php7.y:4224 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -7143,7 +7178,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4189 + //line php7/php7.y:4234 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -7157,7 +7192,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4201 + //line php7/php7.y:4246 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -7169,7 +7204,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4211 + //line php7/php7.y:4256 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -7181,13 +7216,13 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4224 + //line php7/php7.y:4269 { yyVAL.list = []node.Node{yyDollar[1].node} } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4226 + //line php7/php7.y:4271 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -7196,7 +7231,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4236 + //line php7/php7.y:4281 { yyVAL.node = yyDollar[1].node } diff --git a/php7/php7.y b/php7/php7.y index 47b09c1..71a13a8 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -26,7 +26,6 @@ import ( list []node.Node foreachVariable foreachVariable str string - altSyntaxNode altSyntaxNode } %type $unk @@ -266,6 +265,7 @@ import ( %type trait_adaptations %type switch_case_list %type method_body +%type foreach_statement for_statement while_statement %type member_modifier %type use_type @@ -284,8 +284,6 @@ import ( %type backup_doc_comment -%type while_statement for_statement foreach_statement - %% ///////////////////////////////////////////////////////////////////////// @@ -775,14 +773,17 @@ statement: { $$ = $1; } | T_WHILE '(' expr ')' while_statement { - if ($5.isAlt) { - $$ = stmt.NewAltWhile($3, $5.node) - } else { - $$ = stmt.NewWhile($3, $5.node) + switch n := $5.(type) { + case *stmt.While : + n.Cond = $3 + case *stmt.AltWhile : + n.Cond = $3 } + $$ = $5 + // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5.node)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.WhileToken) @@ -805,14 +806,21 @@ statement: } | T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement { - if ($9.isAlt) { - $$ = stmt.NewAltFor($3, $5, $7, $9.node) - } else { - $$ = stmt.NewFor($3, $5, $7, $9.node) + switch n := $9.(type) { + case *stmt.For : + n.Init = $3 + n.Cond = $5 + n.Loop = $7 + case *stmt.AltFor : + n.Init = $3 + n.Cond = $5 + n.Loop = $7 } + $$ = $9 + // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9.node)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForToken) @@ -946,14 +954,21 @@ statement: } | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement { - if ($7.isAlt) { - $$ = stmt.NewAltForeach($3, nil, $5.node, $7.node, $5.byRef) - } else { - $$ = stmt.NewForeach($3, nil, $5.node, $7.node, $5.byRef) + switch n := $7.(type) { + case *stmt.Foreach : + n.Expr = $3 + n.ByRef = $5.byRef + n.Variable = $5.node + case *stmt.AltForeach : + n.Expr = $3 + n.ByRef = $5.byRef + n.Variable = $5.node } + $$ = $7 + // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7.node)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForeachToken) @@ -963,14 +978,23 @@ statement: } | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement { - if ($9.isAlt) { - $$ = stmt.NewAltForeach($3, $5, $7.node, $9.node, $7.byRef) - } else { - $$ = stmt.NewForeach($3, $5, $7.node, $9.node, $7.byRef) + switch n := $9.(type) { + case *stmt.Foreach : + n.Expr = $3 + n.Key = $5 + n.ByRef = $7.byRef + n.Variable = $7.node + case *stmt.AltForeach : + n.Expr = $3 + n.Key = $5 + n.ByRef = $7.byRef + n.Variable = $7.node } + $$ = $9 + // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9.node)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForeachToken) @@ -1354,35 +1378,49 @@ foreach_variable: for_statement: statement - { $$ = altSyntaxNode{$1, false} } - | ':' inner_statement_list T_ENDFOR ';' { - $$ = altSyntaxNode{stmt.NewStmtList($2), true} + $$ = stmt.NewFor(nil, nil, nil, $1) // save position - yylex.(*Parser).positions.AddPosition($$.node, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + } + | ':' inner_statement_list T_ENDFOR ';' + { + stmtList := stmt.NewStmtList($2) + $$ = stmt.NewAltFor(nil, nil, nil, stmtList) + + // save position + yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$.node, $1, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken($$.node, $3, comment.EndforToken) - yylex.(*Parser).comments.AddFromToken($$.node, $4, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.EndforToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } ; foreach_statement: statement - { $$ = altSyntaxNode{$1, false} } - | ':' inner_statement_list T_ENDFOREACH ';' { - $$ = altSyntaxNode{stmt.NewStmtList($2), true} + $$ = stmt.NewForeach(nil, nil, nil, $1, false) // save position - yylex.(*Parser).positions.AddPosition($$.node, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + } + | ':' inner_statement_list T_ENDFOREACH ';' + { + stmtList := stmt.NewStmtList($2) + $$ = stmt.NewAltForeach(nil, nil, nil, stmtList, false) + + // save position + yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$.node, $1, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken($$.node, $3, comment.EndforeachToken) - yylex.(*Parser).comments.AddFromToken($$.node, $4, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.EndforeachToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } ; @@ -1501,18 +1539,25 @@ case_separator: while_statement: statement - { $$ = altSyntaxNode{$1, false} } - | ':' inner_statement_list T_ENDWHILE ';' { - $$ = altSyntaxNode{stmt.NewStmtList($2), true} + $$ = stmt.NewWhile(nil, $1) // save position - yylex.(*Parser).positions.AddPosition($$.node, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + } + | ':' inner_statement_list T_ENDWHILE ';' + { + stmtList := stmt.NewStmtList($2) + $$ = stmt.NewAltWhile(nil, stmtList) + + // save position + yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken($$.node, $1, comment.ColonToken) - yylex.(*Parser).comments.AddFromToken($$.node, $3, comment.EndwhileToken) - yylex.(*Parser).comments.AddFromToken($$.node, $4, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.EndwhileToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } ; @@ -4249,8 +4294,3 @@ type boolWithToken struct { value bool token *scanner.Token } - -type altSyntaxNode struct { - node node.Node - isAlt bool -} \ No newline at end of file From cf4fb267648c4fc71860f47ab0b066cf2980c137 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Fri, 11 May 2018 23:23:57 +0300 Subject: [PATCH 19/25] remove boolWithToken type --- php5/php5.go | 1082 +++++++++++++++++++++++++------------------------- php5/php5.y | 62 ++- php7/php7.go | 426 ++++++++++---------- php7/php7.y | 101 +++-- 4 files changed, 824 insertions(+), 847 deletions(-) diff --git a/php5/php5.go b/php5/php5.go index 0a4c39a..5509d4f 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -24,7 +24,6 @@ type yySymType struct { yys int node node.Node token *scanner.Token - boolWithToken boolWithToken list []node.Node foreachVariable foreachVariable simpleIndirectReference simpleIndirectReference @@ -342,18 +341,13 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:3994 +//line php5/php5.y:3993 type foreachVariable struct { node node.Node byRef bool } -type boolWithToken struct { - value bool - token *scanner.Token -} - type simpleIndirectReference struct { all []*expr.Variable last *expr.Variable @@ -2333,14 +2327,14 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:270 + //line php5/php5.y:269 { yylex.(*Parser).rootNode = node.NewRoot(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) } case 2: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:278 + //line php5/php5.y:277 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2348,13 +2342,13 @@ yydefault: } case 3: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:283 + //line php5/php5.y:282 { yyVAL.list = []node.Node{} } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:288 + //line php5/php5.y:287 { namePart := name.NewNamePart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2363,7 +2357,7 @@ yydefault: } case 5: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:295 + //line php5/php5.y:294 { namePart := name.NewNamePart(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2372,32 +2366,32 @@ yydefault: } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:305 + //line php5/php5.y:304 { // error yyVAL.node = nil } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:310 + //line php5/php5.y:309 { yyVAL.node = yyDollar[1].node } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:312 + //line php5/php5.y:311 { yyVAL.node = yyDollar[1].node } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:314 + //line php5/php5.y:313 { yyVAL.node = yyDollar[1].node } case 10: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:316 + //line php5/php5.y:315 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2405,7 +2399,7 @@ yydefault: } case 11: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:322 + //line php5/php5.y:321 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2417,7 +2411,7 @@ yydefault: } case 12: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:332 + //line php5/php5.y:331 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2429,7 +2423,7 @@ yydefault: } case 13: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:342 + //line php5/php5.y:341 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2437,7 +2431,7 @@ yydefault: } case 14: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:348 + //line php5/php5.y:347 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2445,7 +2439,7 @@ yydefault: } case 15: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:354 + //line php5/php5.y:353 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2457,7 +2451,7 @@ yydefault: } case 16: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:364 + //line php5/php5.y:363 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2469,25 +2463,25 @@ yydefault: } case 17: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:374 + //line php5/php5.y:373 { yyVAL.node = yyDollar[1].node } case 18: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:379 + //line php5/php5.y:378 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:381 + //line php5/php5.y:380 { yyVAL.list = []node.Node{yyDollar[1].node} } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:386 + //line php5/php5.y:385 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2499,7 +2493,7 @@ yydefault: } case 21: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:396 + //line php5/php5.y:395 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2514,7 +2508,7 @@ yydefault: } case 22: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:409 + //line php5/php5.y:408 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2526,7 +2520,7 @@ yydefault: } case 23: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:419 + //line php5/php5.y:418 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2541,19 +2535,19 @@ yydefault: } case 24: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:435 + //line php5/php5.y:434 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:437 + //line php5/php5.y:436 { yyVAL.list = []node.Node{yyDollar[1].node} } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:442 + //line php5/php5.y:441 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2565,7 +2559,7 @@ yydefault: } case 27: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:452 + //line php5/php5.y:451 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2580,7 +2574,7 @@ yydefault: } case 28: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:465 + //line php5/php5.y:464 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2592,7 +2586,7 @@ yydefault: } case 29: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:475 + //line php5/php5.y:474 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2607,19 +2601,19 @@ yydefault: } case 30: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:491 + //line php5/php5.y:490 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:493 + //line php5/php5.y:492 { yyVAL.list = []node.Node{yyDollar[1].node} } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:498 + //line php5/php5.y:497 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2631,7 +2625,7 @@ yydefault: } case 33: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:508 + //line php5/php5.y:507 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2646,7 +2640,7 @@ yydefault: } case 34: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:521 + //line php5/php5.y:520 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2658,7 +2652,7 @@ yydefault: } case 35: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:531 + //line php5/php5.y:530 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2673,7 +2667,7 @@ yydefault: } case 36: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:547 + //line php5/php5.y:546 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2691,7 +2685,7 @@ yydefault: } case 37: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:563 + //line php5/php5.y:562 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2709,7 +2703,7 @@ yydefault: } case 38: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:582 + //line php5/php5.y:581 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2717,38 +2711,38 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:588 + //line php5/php5.y:587 { yyVAL.list = []node.Node{} } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:594 + //line php5/php5.y:593 { // error yyVAL.node = nil } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:599 + //line php5/php5.y:598 { yyVAL.node = yyDollar[1].node } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:601 + //line php5/php5.y:600 { yyVAL.node = yyDollar[1].node } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:603 + //line php5/php5.y:602 { yyVAL.node = yyDollar[1].node } case 44: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:605 + //line php5/php5.y:604 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2756,13 +2750,13 @@ yydefault: } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:615 + //line php5/php5.y:614 { yyVAL.node = yyDollar[1].node } case 46: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:617 + //line php5/php5.y:616 { label := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2774,7 +2768,7 @@ yydefault: } case 47: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:630 + //line php5/php5.y:629 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2782,7 +2776,7 @@ yydefault: } case 48: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:636 + //line php5/php5.y:635 { yyVAL.node = stmt.NewIf(yyDollar[2].node, yyDollar[3].node, yyDollar[4].list, yyDollar[5].node) @@ -2798,7 +2792,7 @@ yydefault: } case 49: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:650 + //line php5/php5.y:649 { stmts := stmt.NewStmtList(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) @@ -2809,7 +2803,7 @@ yydefault: } case 50: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:659 + //line php5/php5.y:658 { switch n := yyDollar[3].node.(type) { case *stmt.While: @@ -2825,7 +2819,7 @@ yydefault: } case 51: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:673 + //line php5/php5.y:672 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2833,7 +2827,7 @@ yydefault: } case 52: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:679 + //line php5/php5.y:678 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -2853,7 +2847,7 @@ yydefault: } case 53: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:697 + //line php5/php5.y:696 { switch n := yyDollar[3].node.(type) { case *stmt.Switch: @@ -2871,7 +2865,7 @@ yydefault: } case 54: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:713 + //line php5/php5.y:712 { yyVAL.node = stmt.NewBreak(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2879,7 +2873,7 @@ yydefault: } case 55: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:719 + //line php5/php5.y:718 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2887,7 +2881,7 @@ yydefault: } case 56: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:725 + //line php5/php5.y:724 { yyVAL.node = stmt.NewContinue(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2895,7 +2889,7 @@ yydefault: } case 57: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:731 + //line php5/php5.y:730 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2903,7 +2897,7 @@ yydefault: } case 58: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:737 + //line php5/php5.y:736 { yyVAL.node = stmt.NewReturn(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2911,7 +2905,7 @@ yydefault: } case 59: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:743 + //line php5/php5.y:742 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2919,7 +2913,7 @@ yydefault: } case 60: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:749 + //line php5/php5.y:748 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2927,7 +2921,7 @@ yydefault: } case 61: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:755 + //line php5/php5.y:754 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2935,7 +2929,7 @@ yydefault: } case 62: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:761 + //line php5/php5.y:760 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2943,7 +2937,7 @@ yydefault: } case 63: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:767 + //line php5/php5.y:766 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2951,7 +2945,7 @@ yydefault: } case 64: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:773 + //line php5/php5.y:772 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2959,7 +2953,7 @@ yydefault: } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:779 + //line php5/php5.y:778 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2967,7 +2961,7 @@ yydefault: } case 66: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:785 + //line php5/php5.y:784 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2975,7 +2969,7 @@ yydefault: } case 67: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:791 + //line php5/php5.y:790 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2983,7 +2977,7 @@ yydefault: } case 68: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:797 + //line php5/php5.y:796 { if yyDollar[6].foreachVariable.node == nil { switch n := yyDollar[8].node.(type) { @@ -3018,7 +3012,7 @@ yydefault: } case 69: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:830 + //line php5/php5.y:829 { if yyDollar[6].foreachVariable.node == nil { switch n := yyDollar[8].node.(type) { @@ -3053,7 +3047,7 @@ yydefault: } case 70: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:863 + //line php5/php5.y:862 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) @@ -3061,7 +3055,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:869 + //line php5/php5.y:868 { yyVAL.node = stmt.NewNop() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3069,7 +3063,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:875 + //line php5/php5.y:874 { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3083,7 +3077,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:887 + //line php5/php5.y:886 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -3091,7 +3085,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:893 + //line php5/php5.y:892 { label := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3103,13 +3097,13 @@ yydefault: } case 75: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:906 + //line php5/php5.y:905 { yyVAL.list = []node.Node{} } case 76: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:908 + //line php5/php5.y:907 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3127,13 +3121,13 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:926 + //line php5/php5.y:925 { yyVAL.node = nil } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:928 + //line php5/php5.y:927 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3141,31 +3135,31 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:937 + //line php5/php5.y:936 { yyVAL.list = yyDollar[1].list } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:939 + //line php5/php5.y:938 { yyVAL.list = []node.Node{} } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:944 + //line php5/php5.y:943 { yyVAL.list = []node.Node{yyDollar[1].node} } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:946 + //line php5/php5.y:945 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:951 + //line php5/php5.y:950 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3181,73 +3175,73 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:968 + //line php5/php5.y:967 { yyVAL.list = []node.Node{yyDollar[1].node} } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:970 + //line php5/php5.y:969 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:975 + //line php5/php5.y:974 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:980 + //line php5/php5.y:979 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:985 + //line php5/php5.y:984 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:990 + //line php5/php5.y:989 { - yyVAL.boolWithToken = boolWithToken{false, nil} + yyVAL.token = nil } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:992 + //line php5/php5.y:991 { - yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} + yyVAL.token = yyDollar[1].token } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:997 + //line php5/php5.y:996 { - yyVAL.boolWithToken = boolWithToken{false, nil} + yyVAL.token = nil } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:999 + //line php5/php5.y:998 { - yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} + yyVAL.token = yyDollar[1].token } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:1004 + //line php5/php5.y:1003 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).comments.AddComments(name, yyDollar[3].token.Comments()) - yyVAL.node = stmt.NewFunction(name, yyDollar[2].boolWithToken.value, yyDollar[5].list, nil, yyDollar[8].list, "") + yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[5].list, nil, yyDollar[8].list, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:1017 + //line php5/php5.y:1016 { switch n := yyDollar[1].node.(type) { case *stmt.Class: @@ -3270,7 +3264,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1038 + //line php5/php5.y:1037 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3282,7 +3276,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1052 + //line php5/php5.y:1051 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3290,7 +3284,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1058 + //line php5/php5.y:1057 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3302,7 +3296,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1068 + //line php5/php5.y:1067 { yyVAL.node = stmt.NewTrait(nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3310,7 +3304,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1074 + //line php5/php5.y:1073 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3322,85 +3316,85 @@ yydefault: } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1087 + //line php5/php5.y:1086 { yyVAL.node = nil } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1089 + //line php5/php5.y:1088 { yyVAL.node = yyDollar[2].node } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1094 + //line php5/php5.y:1093 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1099 + //line php5/php5.y:1098 { yyVAL.list = nil } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1101 + //line php5/php5.y:1100 { yyVAL.list = yyDollar[2].list } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1106 + //line php5/php5.y:1105 { yyVAL.list = nil } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1108 + //line php5/php5.y:1107 { yyVAL.list = yyDollar[2].list } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1113 + //line php5/php5.y:1112 { yyVAL.list = []node.Node{yyDollar[1].node} } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1115 + //line php5/php5.y:1114 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1120 + //line php5/php5.y:1119 { yyVAL.foreachVariable = foreachVariable{nil, false} } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1122 + //line php5/php5.y:1121 { yyVAL.foreachVariable = yyDollar[2].foreachVariable } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1127 + //line php5/php5.y:1126 { yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1129 + //line php5/php5.y:1128 { yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1131 + //line php5/php5.y:1130 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3409,14 +3403,14 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1141 + //line php5/php5.y:1140 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1146 + //line php5/php5.y:1145 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -3426,14 +3420,14 @@ yydefault: } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1158 + //line php5/php5.y:1157 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1163 + //line php5/php5.y:1162 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList, false) @@ -3443,13 +3437,13 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1175 + //line php5/php5.y:1174 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1177 + //line php5/php5.y:1176 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3457,7 +3451,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1187 + //line php5/php5.y:1186 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3471,7 +3465,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1199 + //line php5/php5.y:1198 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3485,7 +3479,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1215 + //line php5/php5.y:1214 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3495,7 +3489,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1223 + //line php5/php5.y:1222 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3505,7 +3499,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1231 + //line php5/php5.y:1230 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -3515,7 +3509,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1239 + //line php5/php5.y:1238 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -3526,13 +3520,13 @@ yydefault: } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1252 + //line php5/php5.y:1251 { yyVAL.list = []node.Node{} } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1254 + //line php5/php5.y:1253 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) @@ -3541,7 +3535,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1261 + //line php5/php5.y:1260 { _default := stmt.NewDefault(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) @@ -3550,14 +3544,14 @@ yydefault: } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1278 + //line php5/php5.y:1277 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1283 + //line php5/php5.y:1282 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -3567,13 +3561,13 @@ yydefault: } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1296 + //line php5/php5.y:1295 { yyVAL.list = nil } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1298 + //line php5/php5.y:1297 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) @@ -3583,13 +3577,13 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1310 + //line php5/php5.y:1309 { yyVAL.list = nil } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1312 + //line php5/php5.y:1311 { stmts := stmt.NewStmtList(yyDollar[5].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[5].list)) @@ -3602,13 +3596,13 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1327 + //line php5/php5.y:1326 { yyVAL.node = nil } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1329 + //line php5/php5.y:1328 { yyVAL.node = stmt.NewElse(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3616,13 +3610,13 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1339 + //line php5/php5.y:1338 { yyVAL.node = nil } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1341 + //line php5/php5.y:1340 { stmts := stmt.NewStmtList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) @@ -3633,31 +3627,31 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1354 + //line php5/php5.y:1353 { yyVAL.list = yyDollar[1].list } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1356 + //line php5/php5.y:1355 { yyVAL.list = nil } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1361 + //line php5/php5.y:1360 { yyVAL.list = []node.Node{yyDollar[1].node} } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1363 + //line php5/php5.y:1362 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1368 + //line php5/php5.y:1367 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3667,17 +3661,17 @@ yydefault: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) + yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].token != nil, yyDollar[3].token != nil) if yyDollar[1].node != nil { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) - } else if yyDollar[2].boolWithToken.value == true { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].boolWithToken.token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].boolWithToken.token.Comments()) - } else if yyDollar[3].boolWithToken.value == true { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].boolWithToken.token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].boolWithToken.token.Comments()) + } else if yyDollar[2].token != nil { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].token, yyDollar[4].token)) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + } else if yyDollar[3].token != nil { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[4].token)) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } else { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) @@ -3685,7 +3679,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1394 + //line php5/php5.y:1393 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3695,17 +3689,17 @@ yydefault: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yylex.(*Parser).comments.AddComments(variable, yyDollar[4].token.Comments()) - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) + yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].token != nil, yyDollar[3].token != nil) if yyDollar[1].node != nil { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) - } else if yyDollar[2].boolWithToken.value == true { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].boolWithToken.token, yyDollar[6].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].boolWithToken.token.Comments()) - } else if yyDollar[3].boolWithToken.value == true { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].boolWithToken.token, yyDollar[6].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].boolWithToken.token.Comments()) + } else if yyDollar[2].token != nil { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[6].node)) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) + } else if yyDollar[3].token != nil { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[6].node)) + yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } else { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[6].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) @@ -3713,13 +3707,13 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1424 + //line php5/php5.y:1423 { yyVAL.node = nil } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1426 + //line php5/php5.y:1425 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3727,7 +3721,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1432 + //line php5/php5.y:1431 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3735,13 +3729,13 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1438 + //line php5/php5.y:1437 { yyVAL.node = yyDollar[1].node } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1444 + //line php5/php5.y:1443 { yyVAL.node = node.NewArgumentList(nil) @@ -3750,7 +3744,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1451 + //line php5/php5.y:1450 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -3759,7 +3753,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1458 + //line php5/php5.y:1457 { arg := node.NewArgument(yyDollar[2].node, false, false) yyVAL.node = node.NewArgumentList([]node.Node{arg}) @@ -3770,19 +3764,19 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1471 + //line php5/php5.y:1470 { yyVAL.list = []node.Node{yyDollar[1].node} } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1473 + //line php5/php5.y:1472 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1478 + //line php5/php5.y:1477 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3790,7 +3784,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1484 + //line php5/php5.y:1483 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3798,7 +3792,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1490 + //line php5/php5.y:1489 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -3806,7 +3800,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1496 + //line php5/php5.y:1495 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3814,19 +3808,19 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1505 + //line php5/php5.y:1504 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1507 + //line php5/php5.y:1506 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1513 + //line php5/php5.y:1512 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3838,7 +3832,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1523 + //line php5/php5.y:1522 { yyVAL.node = expr.NewVariable(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3846,7 +3840,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1529 + //line php5/php5.y:1528 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3854,7 +3848,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1539 + //line php5/php5.y:1538 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3873,7 +3867,7 @@ yydefault: } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1556 + //line php5/php5.y:1555 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3892,7 +3886,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1573 + //line php5/php5.y:1572 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3911,7 +3905,7 @@ yydefault: } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1590 + //line php5/php5.y:1589 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3930,19 +3924,19 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1612 + //line php5/php5.y:1611 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1614 + //line php5/php5.y:1613 { yyVAL.list = []node.Node{} } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1620 + //line php5/php5.y:1619 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) @@ -3950,25 +3944,25 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1626 + //line php5/php5.y:1625 { yyVAL.node = yyDollar[1].node } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1628 + //line php5/php5.y:1627 { yyVAL.node = yyDollar[1].node } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1630 + //line php5/php5.y:1629 { name := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yylex.(*Parser).comments.AddComments(name, yyDollar[4].token.Comments()) - yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].boolWithToken.value, yyDollar[6].list, nil, yyDollar[8].node, "") + yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[6].list, nil, yyDollar[8].node, "") if yyDollar[1].list == nil { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[8].node)) @@ -3980,7 +3974,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1649 + //line php5/php5.y:1648 { var adaptationList *stmt.TraitAdaptationList switch n := yyDollar[3].node.(type) { @@ -3996,19 +3990,19 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1666 + //line php5/php5.y:1665 { yyVAL.list = []node.Node{yyDollar[1].node} } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1668 + //line php5/php5.y:1667 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1673 + //line php5/php5.y:1672 { yyVAL.node = stmt.NewNop() @@ -4016,7 +4010,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1679 + //line php5/php5.y:1678 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4024,43 +4018,43 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1688 + //line php5/php5.y:1687 { yyVAL.list = nil } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1690 + //line php5/php5.y:1689 { yyVAL.list = yyDollar[1].list } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1695 + //line php5/php5.y:1694 { yyVAL.list = []node.Node{yyDollar[1].node} } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1697 + //line php5/php5.y:1696 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1702 + //line php5/php5.y:1701 { yyVAL.node = yyDollar[1].node } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1704 + //line php5/php5.y:1703 { yyVAL.node = yyDollar[1].node } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1709 + //line php5/php5.y:1708 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) @@ -4068,19 +4062,19 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1718 + //line php5/php5.y:1717 { yyVAL.list = []node.Node{yyDollar[1].node} } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1720 + //line php5/php5.y:1719 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1725 + //line php5/php5.y:1724 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4092,13 +4086,13 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1735 + //line php5/php5.y:1734 { yyVAL.node = yyDollar[1].node } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1740 + //line php5/php5.y:1739 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4110,7 +4104,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1753 + //line php5/php5.y:1752 { alias := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -4122,7 +4116,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1763 + //line php5/php5.y:1762 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4130,19 +4124,19 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1772 + //line php5/php5.y:1771 { yyVAL.node = nil } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1774 + //line php5/php5.y:1773 { yyVAL.node = yyDollar[1].node } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1779 + //line php5/php5.y:1778 { yyVAL.node = stmt.NewNop() @@ -4150,7 +4144,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1785 + //line php5/php5.y:1784 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -4158,13 +4152,13 @@ yydefault: } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1794 + //line php5/php5.y:1793 { yyVAL.list = yyDollar[1].list } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1796 + //line php5/php5.y:1795 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4174,31 +4168,31 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1807 + //line php5/php5.y:1806 { yyVAL.list = nil } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1809 + //line php5/php5.y:1808 { yyVAL.list = yyDollar[1].list } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1814 + //line php5/php5.y:1813 { yyVAL.list = []node.Node{yyDollar[1].node} } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1816 + //line php5/php5.y:1815 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 204: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1821 + //line php5/php5.y:1820 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4206,7 +4200,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1827 + //line php5/php5.y:1826 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4214,7 +4208,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1833 + //line php5/php5.y:1832 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4222,7 +4216,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1839 + //line php5/php5.y:1838 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4230,7 +4224,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1845 + //line php5/php5.y:1844 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4238,7 +4232,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1851 + //line php5/php5.y:1850 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4246,7 +4240,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1860 + //line php5/php5.y:1859 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4264,7 +4258,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1876 + //line php5/php5.y:1875 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4282,7 +4276,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1892 + //line php5/php5.y:1891 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4300,7 +4294,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1908 + //line php5/php5.y:1907 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4318,7 +4312,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1927 + //line php5/php5.y:1926 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4335,7 +4329,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1942 + //line php5/php5.y:1941 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -4351,55 +4345,55 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1959 + //line php5/php5.y:1958 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1961 + //line php5/php5.y:1960 { yyVAL.list = []node.Node{yyDollar[1].node} } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1967 + //line php5/php5.y:1966 { yyVAL.list = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1969 + //line php5/php5.y:1968 { yyVAL.list = yyDollar[1].list } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1974 + //line php5/php5.y:1973 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1976 + //line php5/php5.y:1975 { yyVAL.list = []node.Node{yyDollar[1].node} } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1981 + //line php5/php5.y:1980 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1983 + //line php5/php5.y:1982 { yyVAL.list = yyDollar[1].list } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1988 + //line php5/php5.y:1987 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -4408,7 +4402,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1995 + //line php5/php5.y:1994 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -4417,37 +4411,37 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2005 + //line php5/php5.y:2004 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2007 + //line php5/php5.y:2006 { yyVAL.list = yyDollar[1].list } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2009 + //line php5/php5.y:2008 { yyVAL.list = yyDollar[1].list } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2014 + //line php5/php5.y:2013 { yyVAL.list = nil } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2016 + //line php5/php5.y:2015 { yyVAL.list = yyDollar[1].list } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2021 + //line php5/php5.y:2020 { if yyDollar[3].node != nil { @@ -4462,7 +4456,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:2037 + //line php5/php5.y:2036 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -4474,7 +4468,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2047 + //line php5/php5.y:2046 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4482,7 +4476,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2053 + //line php5/php5.y:2052 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4490,7 +4484,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:2059 + //line php5/php5.y:2058 { var _new *expr.New @@ -4509,7 +4503,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2076 + //line php5/php5.y:2075 { yyVAL.node = expr.NewClone(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4517,7 +4511,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2082 + //line php5/php5.y:2081 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4525,7 +4519,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2088 + //line php5/php5.y:2087 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4533,7 +4527,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2094 + //line php5/php5.y:2093 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4541,7 +4535,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2100 + //line php5/php5.y:2099 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4549,7 +4543,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2106 + //line php5/php5.y:2105 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4557,7 +4551,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2112 + //line php5/php5.y:2111 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4565,7 +4559,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2118 + //line php5/php5.y:2117 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4573,7 +4567,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2124 + //line php5/php5.y:2123 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4581,7 +4575,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2130 + //line php5/php5.y:2129 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4589,7 +4583,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2136 + //line php5/php5.y:2135 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4597,7 +4591,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2142 + //line php5/php5.y:2141 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4605,7 +4599,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2148 + //line php5/php5.y:2147 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4613,7 +4607,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2154 + //line php5/php5.y:2153 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4621,7 +4615,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2160 + //line php5/php5.y:2159 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4629,7 +4623,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2166 + //line php5/php5.y:2165 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4637,7 +4631,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2172 + //line php5/php5.y:2171 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4645,7 +4639,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2178 + //line php5/php5.y:2177 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4653,7 +4647,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2184 + //line php5/php5.y:2183 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4661,7 +4655,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2190 + //line php5/php5.y:2189 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4669,7 +4663,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2196 + //line php5/php5.y:2195 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4677,7 +4671,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2202 + //line php5/php5.y:2201 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4685,7 +4679,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2208 + //line php5/php5.y:2207 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4693,7 +4687,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2214 + //line php5/php5.y:2213 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4701,7 +4695,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2220 + //line php5/php5.y:2219 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4709,7 +4703,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2226 + //line php5/php5.y:2225 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4717,7 +4711,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2232 + //line php5/php5.y:2231 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4725,7 +4719,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2238 + //line php5/php5.y:2237 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4733,7 +4727,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2244 + //line php5/php5.y:2243 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4741,7 +4735,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2250 + //line php5/php5.y:2249 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4749,7 +4743,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2256 + //line php5/php5.y:2255 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4757,7 +4751,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2262 + //line php5/php5.y:2261 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4765,7 +4759,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2268 + //line php5/php5.y:2267 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4773,7 +4767,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2274 + //line php5/php5.y:2273 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4781,7 +4775,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2280 + //line php5/php5.y:2279 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4789,7 +4783,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2286 + //line php5/php5.y:2285 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4797,7 +4791,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2292 + //line php5/php5.y:2291 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4805,7 +4799,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2298 + //line php5/php5.y:2297 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4813,7 +4807,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2304 + //line php5/php5.y:2303 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4821,7 +4815,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2310 + //line php5/php5.y:2309 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4829,7 +4823,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2316 + //line php5/php5.y:2315 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4837,7 +4831,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2322 + //line php5/php5.y:2321 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4845,7 +4839,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2328 + //line php5/php5.y:2327 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4853,7 +4847,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2334 + //line php5/php5.y:2333 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4861,7 +4855,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2340 + //line php5/php5.y:2339 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4869,7 +4863,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2346 + //line php5/php5.y:2345 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4877,7 +4871,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2352 + //line php5/php5.y:2351 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4885,19 +4879,19 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2358 + //line php5/php5.y:2357 { yyVAL.node = yyDollar[1].node } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2360 + //line php5/php5.y:2359 { yyVAL.node = yyDollar[1].node } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2362 + //line php5/php5.y:2361 { yyVAL.node = yyDollar[2].node @@ -4925,7 +4919,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2388 + //line php5/php5.y:2387 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -4933,7 +4927,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2394 + //line php5/php5.y:2393 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4941,13 +4935,13 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2400 + //line php5/php5.y:2399 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2402 + //line php5/php5.y:2401 { yyVAL.node = cast.NewInt(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4955,7 +4949,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2408 + //line php5/php5.y:2407 { yyVAL.node = cast.NewDouble(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4963,7 +4957,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2414 + //line php5/php5.y:2413 { yyVAL.node = cast.NewString(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4971,7 +4965,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2420 + //line php5/php5.y:2419 { yyVAL.node = cast.NewArray(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4979,7 +4973,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2426 + //line php5/php5.y:2425 { yyVAL.node = cast.NewObject(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4987,7 +4981,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2432 + //line php5/php5.y:2431 { yyVAL.node = cast.NewBool(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4995,7 +4989,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2438 + //line php5/php5.y:2437 { yyVAL.node = cast.NewUnset(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5003,7 +4997,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2444 + //line php5/php5.y:2443 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -5015,7 +5009,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2454 + //line php5/php5.y:2453 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5023,25 +5017,25 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2460 + //line php5/php5.y:2459 { yyVAL.node = yyDollar[1].node } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2462 + //line php5/php5.y:2461 { yyVAL.node = yyDollar[1].node } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2464 + //line php5/php5.y:2463 { yyVAL.node = yyDollar[1].node } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2466 + //line php5/php5.y:2465 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5049,7 +5043,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2472 + //line php5/php5.y:2471 { yyVAL.node = expr.NewPrint(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5057,7 +5051,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2478 + //line php5/php5.y:2477 { yyVAL.node = expr.NewYield(nil, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5065,25 +5059,25 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:2484 + //line php5/php5.y:2483 { - yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].list, nil, yyDollar[8].list, false, yyDollar[2].boolWithToken.value, "") + yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].list, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:2491 + //line php5/php5.y:2490 { - yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, nil, yyDollar[9].list, true, yyDollar[3].boolWithToken.value, "") + yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2501 + //line php5/php5.y:2500 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5091,7 +5085,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2507 + //line php5/php5.y:2506 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5099,7 +5093,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2513 + //line php5/php5.y:2512 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5107,7 +5101,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2519 + //line php5/php5.y:2518 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5115,7 +5109,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2528 + //line php5/php5.y:2527 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5123,7 +5117,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2534 + //line php5/php5.y:2533 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5131,7 +5125,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2540 + //line php5/php5.y:2539 { str := scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(str, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5143,7 +5137,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2550 + //line php5/php5.y:2549 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5151,7 +5145,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2559 + //line php5/php5.y:2558 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5159,7 +5153,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2565 + //line php5/php5.y:2564 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5167,25 +5161,25 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2574 + //line php5/php5.y:2573 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2579 + //line php5/php5.y:2578 { yyVAL.list = []node.Node{} } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2581 + //line php5/php5.y:2580 { yyVAL.list = yyDollar[3].list } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2586 + //line php5/php5.y:2585 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5203,7 +5197,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2602 + //line php5/php5.y:2601 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -5221,7 +5215,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2618 + //line php5/php5.y:2617 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5239,7 +5233,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2634 + //line php5/php5.y:2633 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5257,7 +5251,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2653 + //line php5/php5.y:2652 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5269,7 +5263,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2663 + //line php5/php5.y:2662 { funcName := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5281,7 +5275,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2673 + //line php5/php5.y:2672 { funcName := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5293,7 +5287,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2683 + //line php5/php5.y:2682 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5301,7 +5295,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2689 + //line php5/php5.y:2688 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5309,7 +5303,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2695 + //line php5/php5.y:2694 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5317,7 +5311,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2701 + //line php5/php5.y:2700 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5325,7 +5319,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2707 + //line php5/php5.y:2706 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) @@ -5333,7 +5327,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2716 + //line php5/php5.y:2715 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5341,7 +5335,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2722 + //line php5/php5.y:2721 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5349,7 +5343,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2728 + //line php5/php5.y:2727 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5357,7 +5351,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2734 + //line php5/php5.y:2733 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5365,7 +5359,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2743 + //line php5/php5.y:2742 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5373,7 +5367,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2749 + //line php5/php5.y:2748 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5381,7 +5375,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2755 + //line php5/php5.y:2754 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5389,19 +5383,19 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2764 + //line php5/php5.y:2763 { yyVAL.node = yyDollar[1].node } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2766 + //line php5/php5.y:2765 { yyVAL.node = yyDollar[1].node } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2771 + //line php5/php5.y:2770 { yyVAL.node = yyDollar[1].node @@ -5439,79 +5433,79 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2807 + //line php5/php5.y:2806 { yyVAL.node = yyDollar[1].node } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2813 + //line php5/php5.y:2812 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2815 + //line php5/php5.y:2814 { yyVAL.list = []node.Node{} } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2821 + //line php5/php5.y:2820 { yyVAL.list = yyDollar[2].list } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2826 + //line php5/php5.y:2825 { yyVAL.node = nil } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2828 + //line php5/php5.y:2827 { yyVAL.node = nil } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2830 + //line php5/php5.y:2829 { yyVAL.node = yyDollar[1].node } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2835 + //line php5/php5.y:2834 { yyVAL.list = []node.Node{} } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2837 + //line php5/php5.y:2836 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2839 + //line php5/php5.y:2838 { yyVAL.list = yyDollar[1].list } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2844 + //line php5/php5.y:2843 { yyVAL.node = nil } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2846 + //line php5/php5.y:2845 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2851 + //line php5/php5.y:2850 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5519,7 +5513,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2857 + //line php5/php5.y:2856 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5527,7 +5521,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2863 + //line php5/php5.y:2862 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5535,7 +5529,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2869 + //line php5/php5.y:2868 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5543,7 +5537,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2875 + //line php5/php5.y:2874 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5551,7 +5545,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2881 + //line php5/php5.y:2880 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5559,7 +5553,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2887 + //line php5/php5.y:2886 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5567,7 +5561,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2893 + //line php5/php5.y:2892 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5575,7 +5569,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2899 + //line php5/php5.y:2898 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5583,7 +5577,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2905 + //line php5/php5.y:2904 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5591,7 +5585,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2911 + //line php5/php5.y:2910 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5603,7 +5597,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2921 + //line php5/php5.y:2920 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -5611,7 +5605,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2930 + //line php5/php5.y:2929 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5623,25 +5617,25 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2943 + //line php5/php5.y:2942 { yyVAL.node = yyDollar[1].node } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2948 + //line php5/php5.y:2947 { yyVAL.node = yyDollar[1].node } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2950 + //line php5/php5.y:2949 { yyVAL.node = yyDollar[1].node } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2952 + //line php5/php5.y:2951 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5653,7 +5647,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2962 + //line php5/php5.y:2961 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5665,7 +5659,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2972 + //line php5/php5.y:2971 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5677,7 +5671,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2982 + //line php5/php5.y:2981 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5685,7 +5679,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2988 + //line php5/php5.y:2987 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5693,13 +5687,13 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2994 + //line php5/php5.y:2993 { yyVAL.node = yyDollar[1].node } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2996 + //line php5/php5.y:2995 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5707,13 +5701,13 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3002 + //line php5/php5.y:3001 { yyVAL.node = yyDollar[1].node } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3007 + //line php5/php5.y:3006 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5721,7 +5715,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3013 + //line php5/php5.y:3012 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5729,7 +5723,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3019 + //line php5/php5.y:3018 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5737,7 +5731,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3025 + //line php5/php5.y:3024 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5745,7 +5739,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3031 + //line php5/php5.y:3030 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5753,7 +5747,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3037 + //line php5/php5.y:3036 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5761,7 +5755,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3043 + //line php5/php5.y:3042 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5769,7 +5763,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3049 + //line php5/php5.y:3048 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5777,7 +5771,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3055 + //line php5/php5.y:3054 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5785,7 +5779,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3061 + //line php5/php5.y:3060 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5793,7 +5787,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3067 + //line php5/php5.y:3066 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5801,7 +5795,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3073 + //line php5/php5.y:3072 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5809,7 +5803,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3079 + //line php5/php5.y:3078 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5817,7 +5811,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3085 + //line php5/php5.y:3084 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5825,7 +5819,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3091 + //line php5/php5.y:3090 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5833,7 +5827,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3097 + //line php5/php5.y:3096 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5841,7 +5835,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3103 + //line php5/php5.y:3102 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5849,7 +5843,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3109 + //line php5/php5.y:3108 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5857,7 +5851,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3115 + //line php5/php5.y:3114 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5865,7 +5859,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3121 + //line php5/php5.y:3120 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5873,7 +5867,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3127 + //line php5/php5.y:3126 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5881,7 +5875,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3133 + //line php5/php5.y:3132 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5889,7 +5883,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3139 + //line php5/php5.y:3138 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5897,7 +5891,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3145 + //line php5/php5.y:3144 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5905,7 +5899,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3151 + //line php5/php5.y:3150 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5913,7 +5907,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3157 + //line php5/php5.y:3156 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5921,7 +5915,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3163 + //line php5/php5.y:3162 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5929,7 +5923,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3169 + //line php5/php5.y:3168 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5937,7 +5931,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3175 + //line php5/php5.y:3174 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5945,7 +5939,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3181 + //line php5/php5.y:3180 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -5953,7 +5947,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3187 + //line php5/php5.y:3186 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5961,7 +5955,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3193 + //line php5/php5.y:3192 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5969,19 +5963,19 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3199 + //line php5/php5.y:3198 { yyVAL.node = yyDollar[2].node } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3204 + //line php5/php5.y:3203 { yyVAL.node = yyDollar[1].node } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3206 + //line php5/php5.y:3205 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5993,7 +5987,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3216 + //line php5/php5.y:3215 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -6005,7 +5999,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3226 + //line php5/php5.y:3225 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -6017,7 +6011,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3239 + //line php5/php5.y:3238 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6029,25 +6023,25 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3249 + //line php5/php5.y:3248 { yyVAL.node = yyDollar[1].node } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3251 + //line php5/php5.y:3250 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3253 + //line php5/php5.y:3252 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3255 + //line php5/php5.y:3254 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6055,7 +6049,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3261 + //line php5/php5.y:3260 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6063,7 +6057,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3267 + //line php5/php5.y:3266 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6071,19 +6065,19 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3276 + //line php5/php5.y:3275 { yyVAL.list = nil } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3278 + //line php5/php5.y:3277 { yyVAL.list = yyDollar[1].list } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3288 + //line php5/php5.y:3287 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -6093,7 +6087,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3296 + //line php5/php5.y:3295 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6103,7 +6097,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3304 + //line php5/php5.y:3303 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6113,7 +6107,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3312 + //line php5/php5.y:3311 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6123,49 +6117,49 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3323 + //line php5/php5.y:3322 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3325 + //line php5/php5.y:3324 { yyVAL.node = yyDollar[1].node } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3330 + //line php5/php5.y:3329 { yyVAL.node = yyDollar[2].node } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3332 + //line php5/php5.y:3331 { yyVAL.node = yyDollar[2].node } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3338 + //line php5/php5.y:3337 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3344 + //line php5/php5.y:3343 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3349 + //line php5/php5.y:3348 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3354 + //line php5/php5.y:3353 { yyVAL.node = yyDollar[1].node @@ -6220,25 +6214,25 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3407 + //line php5/php5.y:3406 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3412 + //line php5/php5.y:3411 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3414 + //line php5/php5.y:3413 { yyVAL.list = []node.Node{} } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3420 + //line php5/php5.y:3419 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -6249,7 +6243,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3432 + //line php5/php5.y:3431 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6258,7 +6252,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3439 + //line php5/php5.y:3438 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6267,38 +6261,38 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3449 + //line php5/php5.y:3448 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3457 + //line php5/php5.y:3456 { yyVAL.list = []node.Node{yyDollar[1].node} } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3459 + //line php5/php5.y:3458 { yyVAL.list = yyDollar[1].list } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3461 + //line php5/php5.y:3460 { yyVAL.list = nil } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3466 + //line php5/php5.y:3465 { yyVAL.node = yyDollar[1].node } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3468 + //line php5/php5.y:3467 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6310,7 +6304,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3481 + //line php5/php5.y:3480 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6318,7 +6312,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3487 + //line php5/php5.y:3486 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6326,13 +6320,13 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3497 + //line php5/php5.y:3496 { yyVAL.node = yyDollar[1].node } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3502 + //line php5/php5.y:3501 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6340,7 +6334,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3508 + //line php5/php5.y:3507 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6348,31 +6342,31 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3516 + //line php5/php5.y:3515 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3517 + //line php5/php5.y:3516 { yyVAL.node = yyDollar[1].node } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3518 + //line php5/php5.y:3517 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3524 + //line php5/php5.y:3523 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3526 + //line php5/php5.y:3525 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6384,13 +6378,13 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3536 + //line php5/php5.y:3535 { yyVAL.node = yyDollar[1].node } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3541 + //line php5/php5.y:3540 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6398,7 +6392,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3547 + //line php5/php5.y:3546 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6406,13 +6400,13 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3553 + //line php5/php5.y:3552 { yyVAL.node = yyDollar[1].node } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3559 + //line php5/php5.y:3558 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6424,7 +6418,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3569 + //line php5/php5.y:3568 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6432,25 +6426,25 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3578 + //line php5/php5.y:3577 { yyVAL.node = nil } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3580 + //line php5/php5.y:3579 { yyVAL.node = yyDollar[1].node } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3586 + //line php5/php5.y:3585 { yyVAL.list = yyDollar[1].list } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3588 + //line php5/php5.y:3587 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6459,7 +6453,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3598 + //line php5/php5.y:3597 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6468,7 +6462,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3605 + //line php5/php5.y:3604 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6477,7 +6471,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3612 + //line php5/php5.y:3611 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6486,7 +6480,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3622 + //line php5/php5.y:3621 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6494,13 +6488,13 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3628 + //line php5/php5.y:3627 { yyVAL.node = yyDollar[2].node } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3633 + //line php5/php5.y:3632 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6510,7 +6504,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3641 + //line php5/php5.y:3640 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6524,13 +6518,13 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3656 + //line php5/php5.y:3655 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3658 + //line php5/php5.y:3657 { if yyDollar[1].node == nil { yyVAL.list = []node.Node{} @@ -6540,7 +6534,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3670 + //line php5/php5.y:3669 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6548,7 +6542,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3676 + //line php5/php5.y:3675 { item := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6560,25 +6554,25 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3686 + //line php5/php5.y:3685 { yyVAL.node = nil } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3692 + //line php5/php5.y:3691 { yyVAL.list = []node.Node{} } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3694 + //line php5/php5.y:3693 { yyVAL.list = yyDollar[1].list } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3699 + //line php5/php5.y:3698 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -6588,7 +6582,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3707 + //line php5/php5.y:3706 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6598,7 +6592,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3715 + //line php5/php5.y:3714 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6608,7 +6602,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3723 + //line php5/php5.y:3722 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6618,7 +6612,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3731 + //line php5/php5.y:3730 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[6].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) @@ -6628,7 +6622,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3739 + //line php5/php5.y:3738 { arrayItem := expr.NewArrayItem(nil, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) @@ -6638,7 +6632,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3747 + //line php5/php5.y:3746 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -6648,7 +6642,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3755 + //line php5/php5.y:3754 { arrayItem := expr.NewArrayItem(nil, yyDollar[2].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6658,13 +6652,13 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3766 + //line php5/php5.y:3765 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3768 + //line php5/php5.y:3767 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6673,13 +6667,13 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3775 + //line php5/php5.y:3774 { yyVAL.list = []node.Node{yyDollar[1].node} } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3777 + //line php5/php5.y:3776 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6688,7 +6682,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3787 + //line php5/php5.y:3786 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6700,7 +6694,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3797 + //line php5/php5.y:3796 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6715,7 +6709,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3810 + //line php5/php5.y:3809 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6733,7 +6727,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3826 + //line php5/php5.y:3825 { yyVAL.node = yyDollar[2].node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6741,7 +6735,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3832 + //line php5/php5.y:3831 { identifier := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6756,13 +6750,13 @@ yydefault: } case 500: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3846 + //line php5/php5.y:3845 { yyVAL.node = yyDollar[2].node } case 501: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3851 + //line php5/php5.y:3850 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6770,7 +6764,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3857 + //line php5/php5.y:3856 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -6784,7 +6778,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3869 + //line php5/php5.y:3868 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6796,7 +6790,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3882 + //line php5/php5.y:3881 { yyVAL.node = expr.NewIsset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6804,7 +6798,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3888 + //line php5/php5.y:3887 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6812,7 +6806,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3894 + //line php5/php5.y:3893 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6820,7 +6814,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3900 + //line php5/php5.y:3899 { yyVAL.node = expr.NewInclude(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6828,7 +6822,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3906 + //line php5/php5.y:3905 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6836,7 +6830,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3912 + //line php5/php5.y:3911 { yyVAL.node = expr.NewEval(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6844,7 +6838,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3918 + //line php5/php5.y:3917 { yyVAL.node = expr.NewRequire(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6852,7 +6846,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3924 + //line php5/php5.y:3923 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6860,31 +6854,31 @@ yydefault: } case 512: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3933 + //line php5/php5.y:3932 { yyVAL.list = []node.Node{yyDollar[1].node} } case 513: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3935 + //line php5/php5.y:3934 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 514: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3940 + //line php5/php5.y:3939 { yyVAL.node = yyDollar[1].node } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3942 + //line php5/php5.y:3941 { yyVAL.node = yyDollar[1].node } case 516: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3947 + //line php5/php5.y:3946 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6896,7 +6890,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3957 + //line php5/php5.y:3956 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6908,7 +6902,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3970 + //line php5/php5.y:3969 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6920,7 +6914,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3983 + //line php5/php5.y:3982 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) diff --git a/php5/php5.y b/php5/php5.y index ea530f5..d03a240 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -21,7 +21,6 @@ import ( %union{ node node.Node token *scanner.Token - boolWithToken boolWithToken list []node.Node foreachVariable foreachVariable simpleIndirectReference simpleIndirectReference @@ -261,7 +260,7 @@ import ( %type simple_indirect_reference %type foreach_variable foreach_optional_arg -%type is_reference is_variadic +%type is_reference is_variadic %% @@ -952,11 +951,11 @@ additional_catch: identifier := node.NewIdentifier(strings.TrimLeft($4.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).comments.AddComments(identifier, $4.Comments()) - + variable := expr.NewVariable(identifier) yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).comments.AddComments(variable, $4.Comments()) - + $$ = stmt.NewCatch([]node.Node{$3}, variable, $7) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) yylex.(*Parser).comments.AddComments($$, $1.Comments()) @@ -987,16 +986,16 @@ class_declaration_statement: is_reference: /* empty */ - { $$ = boolWithToken{false, nil} } + { $$ = nil } | '&' - { $$ = boolWithToken{true, $1} } + { $$ = $1 } ; is_variadic: /* empty */ - { $$ = boolWithToken{false, nil} } + { $$ = nil } | T_ELLIPSIS - { $$ = boolWithToken{true, $1} } + { $$ = $1 } ; unticked_function_declaration_statement: @@ -1006,7 +1005,7 @@ unticked_function_declaration_statement: yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).comments.AddComments(name, $3.Comments()) - $$ = stmt.NewFunction(name, $2.value, $5, nil, $8, "") + $$ = stmt.NewFunction(name, $2 != nil, $5, nil, $8, "") yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) yylex.(*Parser).comments.AddComments($$, $1.Comments()) } @@ -1039,7 +1038,7 @@ unticked_class_declaration_statement: name := node.NewIdentifier($2.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) yylex.(*Parser).comments.AddComments(name, $2.Comments()) - + $$ = stmt.NewInterface(name, $3, $5, "") yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) yylex.(*Parser).comments.AddComments($$, $1.Comments()) @@ -1374,17 +1373,17 @@ parameter: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).comments.AddComments($$, $4.Comments()) - $$ = node.NewParameter($1, variable, nil, $2.value, $3.value) + $$ = node.NewParameter($1, variable, nil, $2 != nil, $3 != nil) if $1 != nil { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } else if $2.value == true { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($2.token, $4)) - yylex.(*Parser).comments.AddComments($$, $2.token.Comments()) - } else if $3.value == true { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($3.token, $4)) - yylex.(*Parser).comments.AddComments($$, $3.token.Comments()) + } else if $2 != nil { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($2, $4)) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } else if $3 != nil { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) } else { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).comments.AddComments($$, $4.Comments()) @@ -1400,17 +1399,17 @@ parameter: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).comments.AddComments(variable, $4.Comments()) - $$ = node.NewParameter($1, variable, $6, $2.value, $3.value) + $$ = node.NewParameter($1, variable, $6, $2 != nil, $3 != nil) if $1 != nil { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) - } else if $2.value == true { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2.token, $6)) - yylex.(*Parser).comments.AddComments($$, $2.token.Comments()) - } else if $3.value == true { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3.token, $6)) - yylex.(*Parser).comments.AddComments($$, $3.token.Comments()) + } else if $2 != nil { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6)) + yylex.(*Parser).comments.AddComments($$, $2.Comments()) + } else if $3 != nil { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $6)) + yylex.(*Parser).comments.AddComments($$, $3.Comments()) } else { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) yylex.(*Parser).comments.AddComments($$, $4.Comments()) @@ -1632,7 +1631,7 @@ class_statement: yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).comments.AddComments(name, $4.Comments()) - $$ = stmt.NewClassMethod(name, $1, $3.value, $6, nil, $8, "") + $$ = stmt.NewClassMethod(name, $1, $3 != nil, $6, nil, $8, "") if $1 == nil { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $8)) @@ -1778,13 +1777,13 @@ method_body: ';' /* abstract method */ { $$ = stmt.NewNop() - + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) } | '{' inner_statement_list '}' { $$ = stmt.NewStmtList($2) - + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) } ; @@ -2482,14 +2481,14 @@ expr_without_variable: } | function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { - $$ = expr.NewClosure($4, $6, nil, $8, false, $2.value, "") + $$ = expr.NewClosure($4, $6, nil, $8, false, $2 != nil, "") yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) yylex.(*Parser).comments.AddComments($$, $1.Comments()) } | T_STATIC function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { - $$ = expr.NewClosure($5, $7, nil, $9, true, $3.value, "") + $$ = expr.NewClosure($5, $7, nil, $9, true, $3 != nil, "") yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $10)) yylex.(*Parser).comments.AddComments($$, $1.Comments()) @@ -3998,11 +3997,6 @@ type foreachVariable struct { byRef bool } -type boolWithToken struct { - value bool - token *scanner.Token -} - type simpleIndirectReference struct { all []*expr.Variable last *expr.Variable diff --git a/php7/php7.go b/php7/php7.go index 53daa2b..5f0d217 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -25,7 +25,6 @@ type yySymType struct { yys int node node.Node token *scanner.Token - boolWithToken boolWithToken list []node.Node foreachVariable foreachVariable str string @@ -350,11 +349,6 @@ type foreachVariable struct { byRef bool } -type boolWithToken struct { - value bool - token *scanner.Token -} - //line yacctab:1 var yyExca = [...]int{ -1, 1, @@ -2121,7 +2115,7 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:293 + //line php7/php7.y:292 { yylex.(*Parser).rootNode = node.NewRoot(yyDollar[1].list) @@ -2130,463 +2124,463 @@ yydefault: } case 2: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 3: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 5: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 10: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 11: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 12: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 13: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 14: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 15: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 16: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 17: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 18: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 21: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 22: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 23: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 24: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 27: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 28: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 29: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 30: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:303 { yyVAL.token = yyDollar[1].token } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 33: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 34: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 35: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 36: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 37: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 38: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 39: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:304 { yyVAL.token = yyDollar[1].token } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 44: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 46: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 47: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 48: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 49: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 50: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 51: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 52: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 53: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 54: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 55: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 56: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 57: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 58: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 59: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 60: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 61: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 62: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 63: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 64: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 66: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 67: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 68: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 69: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 70: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 72: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 73: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 74: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 75: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 76: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 77: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:321 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 78: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:326 + //line php7/php7.y:325 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2594,13 +2588,13 @@ yydefault: } case 79: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:332 + //line php7/php7.y:331 { yyVAL.list = []node.Node{} } case 80: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:337 + //line php7/php7.y:336 { namePart := name.NewNamePart(yyDollar[1].token.Value) yyVAL.list = []node.Node{namePart} @@ -2613,7 +2607,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:348 + //line php7/php7.y:347 { namePart := name.NewNamePart(yyDollar[3].token.Value) yyVAL.list = append(yyDollar[1].list, namePart) @@ -2627,7 +2621,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:363 + //line php7/php7.y:362 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -2636,7 +2630,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:370 + //line php7/php7.y:369 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -2649,7 +2643,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:381 + //line php7/php7.y:380 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -2661,44 +2655,44 @@ yydefault: } case 85: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:394 + //line php7/php7.y:393 { // error yyVAL.node = nil } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:399 + //line php7/php7.y:398 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:401 + //line php7/php7.y:400 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:403 + //line php7/php7.y:402 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:405 + //line php7/php7.y:404 { yyVAL.node = yyDollar[1].node } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:407 + //line php7/php7.y:406 { yyVAL.node = yyDollar[1].node } case 91: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:409 + //line php7/php7.y:408 { yyVAL.node = stmt.NewHaltCompiler() @@ -2713,7 +2707,7 @@ yydefault: } case 92: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:422 + //line php7/php7.y:421 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2728,7 +2722,7 @@ yydefault: } case 93: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:435 + //line php7/php7.y:434 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2744,7 +2738,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:449 + //line php7/php7.y:448 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2758,7 +2752,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:461 + //line php7/php7.y:460 { yyVAL.node = yyDollar[2].node @@ -2771,7 +2765,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:472 + //line php7/php7.y:471 { yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) @@ -2784,7 +2778,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:483 + //line php7/php7.y:482 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2797,7 +2791,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:494 + //line php7/php7.y:493 { yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) @@ -2810,7 +2804,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:505 + //line php7/php7.y:504 { yyVAL.node = stmt.NewConstList(yyDollar[2].list) @@ -2823,7 +2817,7 @@ yydefault: } case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:519 + //line php7/php7.y:518 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2835,7 +2829,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:529 + //line php7/php7.y:528 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2847,7 +2841,7 @@ yydefault: } case 102: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:542 + //line php7/php7.y:541 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2866,7 +2860,7 @@ yydefault: } case 103: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:559 + //line php7/php7.y:558 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2886,7 +2880,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:580 + //line php7/php7.y:579 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2905,7 +2899,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:597 + //line php7/php7.y:596 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2925,19 +2919,19 @@ yydefault: } case 106: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:618 + //line php7/php7.y:617 { yyVAL.token = nil } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:620 + //line php7/php7.y:619 { yyVAL.token = yyDollar[1].token } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:625 + //line php7/php7.y:624 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2946,13 +2940,13 @@ yydefault: } case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:632 + //line php7/php7.y:631 { yyVAL.list = []node.Node{yyDollar[1].node} } case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:637 + //line php7/php7.y:636 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2961,13 +2955,13 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:644 + //line php7/php7.y:643 { yyVAL.list = []node.Node{yyDollar[1].node} } case 112: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:649 + //line php7/php7.y:648 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2976,25 +2970,25 @@ yydefault: } case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:656 + //line php7/php7.y:655 { yyVAL.list = []node.Node{yyDollar[1].node} } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:661 + //line php7/php7.y:660 { yyVAL.node = yyDollar[1].node } case 115: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:663 + //line php7/php7.y:662 { yyVAL.node = yyDollar[2].node.(*stmt.Use).SetUseType(yyDollar[1].node) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:668 + //line php7/php7.y:667 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -3005,7 +2999,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:677 + //line php7/php7.y:676 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -3022,13 +3016,13 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:695 + //line php7/php7.y:694 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:697 + //line php7/php7.y:696 { yyVAL.node = yyDollar[2].node @@ -3037,7 +3031,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:707 + //line php7/php7.y:706 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3046,13 +3040,13 @@ yydefault: } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:714 + //line php7/php7.y:713 { yyVAL.list = []node.Node{yyDollar[1].node} } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:719 + //line php7/php7.y:718 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3060,50 +3054,50 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:725 + //line php7/php7.y:724 { yyVAL.list = []node.Node{} } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:730 + //line php7/php7.y:729 { // error yyVAL.node = nil } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:735 + //line php7/php7.y:734 { yyVAL.node = yyDollar[1].node } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:737 + //line php7/php7.y:736 { yyVAL.node = yyDollar[1].node } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:739 + //line php7/php7.y:738 { yyVAL.node = yyDollar[1].node } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:741 + //line php7/php7.y:740 { yyVAL.node = yyDollar[1].node } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:743 + //line php7/php7.y:742 { yyVAL.node = yyDollar[1].node } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:745 + //line php7/php7.y:744 { yyVAL.node = stmt.NewHaltCompiler() @@ -3118,7 +3112,7 @@ yydefault: } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:760 + //line php7/php7.y:759 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3131,19 +3125,19 @@ yydefault: } case 132: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:771 + //line php7/php7.y:770 { yyVAL.node = yyDollar[1].node } case 133: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:773 + //line php7/php7.y:772 { yyVAL.node = yyDollar[1].node } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:775 + //line php7/php7.y:774 { switch n := yyDollar[5].node.(type) { case *stmt.While: @@ -3164,7 +3158,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:794 + //line php7/php7.y:793 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) @@ -3180,7 +3174,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:808 + //line php7/php7.y:807 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -3207,7 +3201,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:833 + //line php7/php7.y:832 { switch n := yyDollar[5].node.(type) { case *stmt.Switch: @@ -3230,7 +3224,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:854 + //line php7/php7.y:853 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3243,7 +3237,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:865 + //line php7/php7.y:864 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3256,7 +3250,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:876 + //line php7/php7.y:875 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3269,7 +3263,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:887 + //line php7/php7.y:886 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3282,7 +3276,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:898 + //line php7/php7.y:897 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3295,7 +3289,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:909 + //line php7/php7.y:908 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3308,7 +3302,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:920 + //line php7/php7.y:919 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3320,7 +3314,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:930 + //line php7/php7.y:929 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3332,7 +3326,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:940 + //line php7/php7.y:939 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3350,7 +3344,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:956 + //line php7/php7.y:955 { switch n := yyDollar[7].node.(type) { case *stmt.Foreach: @@ -3376,7 +3370,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:980 + //line php7/php7.y:979 { switch n := yyDollar[9].node.(type) { case *stmt.Foreach: @@ -3405,7 +3399,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1007 + //line php7/php7.y:1006 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) @@ -3419,7 +3413,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1019 + //line php7/php7.y:1018 { yyVAL.node = stmt.NewNop() @@ -3431,7 +3425,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1029 + //line php7/php7.y:1028 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3448,7 +3442,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1044 + //line php7/php7.y:1043 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3461,7 +3455,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1055 + //line php7/php7.y:1054 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3477,7 +3471,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1069 + //line php7/php7.y:1068 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -3492,13 +3486,13 @@ yydefault: } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1084 + //line php7/php7.y:1083 { yyVAL.list = []node.Node{} } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1086 + //line php7/php7.y:1085 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[5].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -3520,13 +3514,13 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1108 + //line php7/php7.y:1107 { yyVAL.list = []node.Node{yyDollar[1].node} } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1110 + //line php7/php7.y:1109 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3535,13 +3529,13 @@ yydefault: } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1120 + //line php7/php7.y:1119 { yyVAL.node = nil } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1122 + //line php7/php7.y:1121 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3555,13 +3549,13 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1137 + //line php7/php7.y:1136 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1139 + //line php7/php7.y:1138 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3570,16 +3564,16 @@ yydefault: } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1149 + //line php7/php7.y:1148 { yyVAL.node = yyDollar[1].node } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1154 + //line php7/php7.y:1153 { name := node.NewIdentifier(yyDollar[3].token.Value) - yyVAL.node = stmt.NewFunction(name, yyDollar[2].boolWithToken.value, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) + yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) // save position yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3587,8 +3581,8 @@ yydefault: // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FunctionToken) - if yyDollar[2].boolWithToken.token != nil { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].boolWithToken.token, comment.AmpersandToken) + if yyDollar[2].token != nil { + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) } yylex.(*Parser).comments.AddFromToken(name, yyDollar[3].token, comment.StringToken) yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.OpenParenthesisToken) @@ -3600,25 +3594,25 @@ yydefault: yyDollar = yyS[yypt-0 : yypt+1] //line php7/php7.y:1177 { - yyVAL.boolWithToken = boolWithToken{false, nil} + yyVAL.token = nil } case 166: yyDollar = yyS[yypt-1 : yypt+1] //line php7/php7.y:1179 { - yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} + yyVAL.token = yyDollar[1].token } case 167: yyDollar = yyS[yypt-0 : yypt+1] //line php7/php7.y:1184 { - yyVAL.boolWithToken = boolWithToken{false, nil} + yyVAL.token = nil } case 168: yyDollar = yyS[yypt-1 : yypt+1] //line php7/php7.y:1186 { - yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} + yyVAL.token = yyDollar[1].token } case 169: yyDollar = yyS[yypt-9 : yypt+1] @@ -4189,13 +4183,13 @@ yydefault: variable := expr.NewVariable(identifier) if yyDollar[1].node != nil { - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) - } else if yyDollar[2].boolWithToken.value { - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) - } else if yyDollar[3].boolWithToken.value { - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) + yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].token != nil, yyDollar[3].token != nil) + } else if yyDollar[2].token != nil { + yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].token != nil, yyDollar[3].token != nil) + } else if yyDollar[3].token != nil { + yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].token != nil, yyDollar[3].token != nil) } else { - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) + yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].token != nil, yyDollar[3].token != nil) } // save position @@ -4203,20 +4197,20 @@ yydefault: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) if yyDollar[1].node != nil { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - } else if yyDollar[2].boolWithToken.value { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].boolWithToken.token, yyDollar[4].token)) - } else if yyDollar[3].boolWithToken.value { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].boolWithToken.token, yyDollar[4].token)) + } else if yyDollar[2].token != nil { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].token, yyDollar[4].token)) + } else if yyDollar[3].token != nil { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[4].token)) } else { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) } // save comments - if yyDollar[2].boolWithToken.value { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].boolWithToken.token, comment.AmpersandToken) + if yyDollar[2].token != nil { + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) } - if yyDollar[3].boolWithToken.value { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].boolWithToken.token, comment.EllipsisToken) + if yyDollar[3].token != nil { + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EllipsisToken) } yylex.(*Parser).comments.AddFromToken(variable, yyDollar[4].token, comment.VariableToken) } @@ -4227,13 +4221,13 @@ yydefault: identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) if yyDollar[1].node != nil { - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) - } else if yyDollar[2].boolWithToken.value == true { - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) - } else if yyDollar[3].boolWithToken.value == true { - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) + yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].token != nil, yyDollar[3].token != nil) + } else if yyDollar[2].token != nil { + yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].token != nil, yyDollar[3].token != nil) + } else if yyDollar[3].token != nil { + yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].token != nil, yyDollar[3].token != nil) } else { - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].boolWithToken.value, yyDollar[3].boolWithToken.value) + yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].token != nil, yyDollar[3].token != nil) } // save position @@ -4241,20 +4235,20 @@ yydefault: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) if yyDollar[1].node != nil { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) - } else if yyDollar[2].boolWithToken.value == true { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].boolWithToken.token, yyDollar[6].node)) - } else if yyDollar[3].boolWithToken.value == true { - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].boolWithToken.token, yyDollar[6].node)) + } else if yyDollar[2].token != nil { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[6].node)) + } else if yyDollar[3].token != nil { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[6].node)) } else { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[6].node)) } // save comments - if yyDollar[2].boolWithToken.value { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].boolWithToken.token, comment.AmpersandToken) + if yyDollar[2].token != nil { + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) } - if yyDollar[3].boolWithToken.value { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].boolWithToken.token, comment.EllipsisToken) + if yyDollar[3].token != nil { + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EllipsisToken) } yylex.(*Parser).comments.AddFromToken(variable, yyDollar[4].token, comment.VariableToken) yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.EqualToken) @@ -4521,7 +4515,7 @@ yydefault: //line php7/php7.y:1990 { name := node.NewIdentifier(yyDollar[4].token.Value) - yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].boolWithToken.value, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) + yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) // save position yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -4533,8 +4527,8 @@ yydefault: // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.FunctionToken) - if yyDollar[3].boolWithToken.value { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].boolWithToken.token, comment.AmpersandToken) + if yyDollar[3].token != nil { + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AmpersandToken) } yylex.(*Parser).comments.AddFromToken(name, yyDollar[4].token, comment.IdentifierToken) yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.OpenParenthesisToken) @@ -5947,15 +5941,15 @@ yydefault: yyDollar = yyS[yypt-11 : yypt+1] //line php7/php7.y:3206 { - yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].boolWithToken.value, yyDollar[3].str) + yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FunctionToken) - if yyDollar[2].boolWithToken.value { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].boolWithToken.token, comment.AmpersandToken) + if yyDollar[2].token != nil { + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) } yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.OpenParenthesisToken) yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseParenthesisToken) @@ -5966,7 +5960,7 @@ yydefault: yyDollar = yyS[yypt-12 : yypt+1] //line php7/php7.y:3223 { - yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].list, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].boolWithToken.value, yyDollar[4].str) + yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].list, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[12].token)) @@ -5974,8 +5968,8 @@ yydefault: // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.FunctionToken) - if yyDollar[3].boolWithToken.value { - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].boolWithToken.token, comment.AmpersandToken) + if yyDollar[3].token != nil { + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AmpersandToken) } yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.OpenParenthesisToken) yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseParenthesisToken) @@ -5993,13 +5987,13 @@ yydefault: yyDollar = yyS[yypt-0 : yypt+1] //line php7/php7.y:3252 { - yyVAL.boolWithToken = boolWithToken{false, nil} + yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] //line php7/php7.y:3254 { - yyVAL.boolWithToken = boolWithToken{true, yyDollar[1].token} + yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] diff --git a/php7/php7.y b/php7/php7.y index 71a13a8..6f70528 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -22,7 +22,6 @@ import ( %union{ node node.Node token *scanner.Token - boolWithToken boolWithToken list []node.Node foreachVariable foreachVariable str string @@ -228,7 +227,7 @@ import ( %left T_ENDIF %right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC -%type is_reference is_variadic returns_ref +%type is_reference is_variadic returns_ref %type reserved_non_modifiers %type semi_reserved @@ -1153,16 +1152,17 @@ function_declaration_statement: T_FUNCTION returns_ref T_STRING backup_doc_comment '(' parameter_list ')' return_type '{' inner_statement_list '}' { name := node.NewIdentifier($3.Value) - $$ = stmt.NewFunction(name, $2.value, $6, $8, $10, $4) + $$ = stmt.NewFunction(name, $2 != nil, $6, $8, $10, $4) // save position yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) + // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FunctionToken) - if $2.token != nil { - yylex.(*Parser).comments.AddFromToken($$, $2.token, comment.AmpersandToken) + if $2 != nil { + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) } yylex.(*Parser).comments.AddFromToken(name, $3, comment.StringToken) yylex.(*Parser).comments.AddFromToken($$, $5, comment.OpenParenthesisToken) @@ -1174,16 +1174,16 @@ function_declaration_statement: is_reference: /* empty */ - { $$ = boolWithToken{false, nil} } + { $$ = nil } | '&' - { $$ = boolWithToken{true, $1} } + { $$ = $1 } ; is_variadic: /* empty */ - { $$ = boolWithToken{false, nil} } + { $$ = nil } | T_ELLIPSIS - { $$ = boolWithToken{true, $1} } + { $$ = $1 } ; class_declaration_statement: @@ -1698,13 +1698,13 @@ parameter: variable := expr.NewVariable(identifier) if $1 != nil { - $$ = node.NewParameter($1, variable, nil, $2.value, $3.value) - } else if $2.value { - $$ = node.NewParameter($1, variable, nil, $2.value, $3.value) - } else if $3.value { - $$ = node.NewParameter($1, variable, nil, $2.value, $3.value) + $$ = node.NewParameter($1, variable, nil, $2 != nil, $3 != nil) + } else if $2 != nil { + $$ = node.NewParameter($1, variable, nil, $2 != nil, $3 != nil) + } else if $3 != nil { + $$ = node.NewParameter($1, variable, nil, $2 != nil, $3 != nil) } else { - $$ = node.NewParameter($1, variable, nil, $2.value, $3.value) + $$ = node.NewParameter($1, variable, nil, $2 != nil, $3 != nil) } // save position @@ -1712,20 +1712,20 @@ parameter: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) if $1 != nil { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - } else if $2.value { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($2.token, $4)) - } else if $3.value { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($3.token, $4)) + } else if $2 != nil { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($2, $4)) + } else if $3 != nil { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) } else { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) } // save comments - if $2.value { - yylex.(*Parser).comments.AddFromToken($$, $2.token, comment.AmpersandToken) + if $2 != nil { + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) } - if $3.value { - yylex.(*Parser).comments.AddFromToken($$, $3.token, comment.EllipsisToken) + if $3 != nil { + yylex.(*Parser).comments.AddFromToken($$, $3, comment.EllipsisToken) } yylex.(*Parser).comments.AddFromToken(variable, $4, comment.VariableToken) } @@ -1734,13 +1734,13 @@ parameter: identifier := node.NewIdentifier(strings.TrimLeft($4.Value, "$")) variable := expr.NewVariable(identifier) if $1 != nil { - $$ = node.NewParameter($1, variable, $6, $2.value, $3.value) - } else if $2.value == true { - $$ = node.NewParameter($1, variable, $6, $2.value, $3.value) - } else if $3.value == true { - $$ = node.NewParameter($1, variable, $6, $2.value, $3.value) + $$ = node.NewParameter($1, variable, $6, $2 != nil, $3 != nil) + } else if $2 != nil { + $$ = node.NewParameter($1, variable, $6, $2 != nil, $3 != nil) + } else if $3 != nil { + $$ = node.NewParameter($1, variable, $6, $2 != nil, $3 != nil) } else { - $$ = node.NewParameter($1, variable, $6, $2.value, $3.value) + $$ = node.NewParameter($1, variable, $6, $2 != nil, $3 != nil) } // save position @@ -1748,20 +1748,20 @@ parameter: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) if $1 != nil { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) - } else if $2.value == true { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2.token, $6)) - } else if $3.value == true { - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3.token, $6)) + } else if $2 != nil { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6)) + } else if $3 != nil { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $6)) } else { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) } // save comments - if $2.value { - yylex.(*Parser).comments.AddFromToken($$, $2.token, comment.AmpersandToken) + if $2 != nil { + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) } - if $3.value { - yylex.(*Parser).comments.AddFromToken($$, $3.token, comment.EllipsisToken) + if $3 != nil { + yylex.(*Parser).comments.AddFromToken($$, $3, comment.EllipsisToken) } yylex.(*Parser).comments.AddFromToken(variable, $4, comment.VariableToken) yylex.(*Parser).comments.AddFromToken($$, $5, comment.EqualToken) @@ -1989,7 +1989,7 @@ class_statement: | method_modifiers T_FUNCTION returns_ref identifier backup_doc_comment '(' parameter_list ')' return_type method_body { name := node.NewIdentifier($4.Value) - $$ = stmt.NewClassMethod(name, $1, $3.value, $7, $9, $10, $5) + $$ = stmt.NewClassMethod(name, $1, $3 != nil, $7, $9, $10, $5) // save position yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) @@ -2001,8 +2001,8 @@ class_statement: // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.FunctionToken) - if $3.value { - yylex.(*Parser).comments.AddFromToken($$, $3.token, comment.AmpersandToken) + if $3 != nil { + yylex.(*Parser).comments.AddFromToken($$, $3, comment.AmpersandToken) } yylex.(*Parser).comments.AddFromToken(name, $4, comment.IdentifierToken) yylex.(*Parser).comments.AddFromToken($$, $6, comment.OpenParenthesisToken) @@ -3204,15 +3204,15 @@ expr_without_variable: } | T_FUNCTION returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars return_type '{' inner_statement_list '}' { - $$ = expr.NewClosure($5, $7, $8, $10, false, $2.value, $3) + $$ = expr.NewClosure($5, $7, $8, $10, false, $2 != nil, $3) // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.FunctionToken) - if $2.value { - yylex.(*Parser).comments.AddFromToken($$, $2.token, comment.AmpersandToken) + if $2 != nil { + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) } yylex.(*Parser).comments.AddFromToken($$, $4, comment.OpenParenthesisToken) yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseParenthesisToken) @@ -3221,7 +3221,7 @@ expr_without_variable: } | T_STATIC T_FUNCTION returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars return_type '{' inner_statement_list '}' { - $$ = expr.NewClosure($6, $8, $9, $11, true, $3.value, $4) + $$ = expr.NewClosure($6, $8, $9, $11, true, $3 != nil, $4) // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $12)) @@ -3229,8 +3229,8 @@ expr_without_variable: // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) yylex.(*Parser).comments.AddFromToken($$, $2, comment.FunctionToken) - if $3.value { - yylex.(*Parser).comments.AddFromToken($$, $3.token, comment.AmpersandToken) + if $3 != nil { + yylex.(*Parser).comments.AddFromToken($$, $3, comment.AmpersandToken) } yylex.(*Parser).comments.AddFromToken($$, $5, comment.OpenParenthesisToken) yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseParenthesisToken) @@ -3249,9 +3249,9 @@ backup_doc_comment: returns_ref: /* empty */ - { $$ = boolWithToken{false, nil} } + { $$ = nil } | '&' - { $$ = boolWithToken{true, $1} } + { $$ = $1 } ; lexical_vars: @@ -4289,8 +4289,3 @@ type foreachVariable struct { node node.Node byRef bool } - -type boolWithToken struct { - value bool - token *scanner.Token -} From ac74ae32253b1fa15b37be5c7029086091a0e04c Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sat, 12 May 2018 23:10:01 +0300 Subject: [PATCH 20/25] create ClassExtends ClassImplements InterfaceExtends nodes --- README.md | 4 +- node/stmt/n_class.go | 12 +- node/stmt/n_class_extends.go | 38 + node/stmt/n_class_implements.go | 42 + node/stmt/n_interface.go | 10 +- node/stmt/n_interface_extends.go | 42 + node/stmt/t_class_test.go | 62 +- node/stmt/t_interface_test.go | 28 +- node/stmt/t_visitor_test.go | 33 +- php5/php5.go | 1289 +++++++++++++-------------- php5/php5.y | 44 +- php5/php5_test.go | 76 +- php7/php7.go | 1294 ++++++++++++++-------------- php7/php7.y | 61 +- php7/php7_test.go | 102 ++- printer/printer.go | 6 +- printer/printer_test.go | 40 +- visitor/namespace_resolver.go | 14 +- visitor/namespace_resolver_test.go | 18 +- 19 files changed, 1720 insertions(+), 1495 deletions(-) create mode 100644 node/stmt/n_class_extends.go create mode 100644 node/stmt/n_class_implements.go create mode 100644 node/stmt/n_interface_extends.go diff --git a/README.md b/README.md index d9c4a93..0bd8d03 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,9 @@ nodes := &stmt.StmtList{ &stmt.Class{ Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, - Extends: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, + Extends: &stmt.ClassExtends{ + ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, + }, Stmts: []node.Node{ &stmt.ClassMethod{ Modifiers: []node.Node{&node.Identifier{Value: "public"}}, diff --git a/node/stmt/n_class.go b/node/stmt/n_class.go index 002a9b2..305490d 100644 --- a/node/stmt/n_class.go +++ b/node/stmt/n_class.go @@ -11,13 +11,13 @@ type Class struct { ClassName node.Node Modifiers []node.Node ArgumentList *node.ArgumentList - Extends node.Node - Implements []node.Node + Extends *ClassExtends + Implements *ClassImplements Stmts []node.Node } // NewClass node constructor -func NewClass(ClassName node.Node, Modifiers []node.Node, ArgumentList *node.ArgumentList, Extends node.Node, Implements []node.Node, Stmts []node.Node, PhpDocComment string) *Class { +func NewClass(ClassName node.Node, Modifiers []node.Node, ArgumentList *node.ArgumentList, Extends *ClassExtends, Implements *ClassImplements, Stmts []node.Node, PhpDocComment string) *Class { return &Class{ PhpDocComment, ClassName, @@ -69,11 +69,7 @@ func (n *Class) Walk(v walker.Visitor) { if n.Implements != nil { vv := v.GetChildrenVisitor("Implements") - for _, nn := range n.Implements { - if nn != nil { - nn.Walk(vv) - } - } + n.Implements.Walk(vv) } if n.Stmts != nil { diff --git a/node/stmt/n_class_extends.go b/node/stmt/n_class_extends.go new file mode 100644 index 0000000..2d7efcc --- /dev/null +++ b/node/stmt/n_class_extends.go @@ -0,0 +1,38 @@ +package stmt + +import ( + "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/walker" +) + +// ClassExtends node +type ClassExtends struct { + ClassName node.Node +} + +// NewClassExtends node constructor +func NewClassExtends(className node.Node) *ClassExtends { + return &ClassExtends{ + className, + } +} + +// Attributes returns node attributes as map +func (n *ClassExtends) Attributes() map[string]interface{} { + return nil +} + +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true +func (n *ClassExtends) Walk(v walker.Visitor) { + if v.EnterNode(n) == false { + return + } + + if n.ClassName != nil { + vv := v.GetChildrenVisitor("ClassName") + n.ClassName.Walk(vv) + } + + v.LeaveNode(n) +} diff --git a/node/stmt/n_class_implements.go b/node/stmt/n_class_implements.go new file mode 100644 index 0000000..00a37a1 --- /dev/null +++ b/node/stmt/n_class_implements.go @@ -0,0 +1,42 @@ +package stmt + +import ( + "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/walker" +) + +// ClassImplements node +type ClassImplements struct { + InterfaceNames []node.Node +} + +// NewClassImplements node constructor +func NewClassImplements(interfaceNames []node.Node) *ClassImplements { + return &ClassImplements{ + interfaceNames, + } +} + +// Attributes returns node attributes as map +func (n *ClassImplements) Attributes() map[string]interface{} { + return nil +} + +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true +func (n *ClassImplements) Walk(v walker.Visitor) { + if v.EnterNode(n) == false { + return + } + + if n.InterfaceNames != nil { + vv := v.GetChildrenVisitor("InterfaceNames") + for _, nn := range n.InterfaceNames { + if nn != nil { + nn.Walk(vv) + } + } + } + + v.LeaveNode(n) +} diff --git a/node/stmt/n_interface.go b/node/stmt/n_interface.go index bd1296d..46524c6 100644 --- a/node/stmt/n_interface.go +++ b/node/stmt/n_interface.go @@ -9,12 +9,12 @@ import ( type Interface struct { PhpDocComment string InterfaceName node.Node - Extends []node.Node + Extends *InterfaceExtends Stmts []node.Node } // NewInterface node constructor -func NewInterface(InterfaceName node.Node, Extends []node.Node, Stmts []node.Node, PhpDocComment string) *Interface { +func NewInterface(InterfaceName node.Node, Extends *InterfaceExtends, Stmts []node.Node, PhpDocComment string) *Interface { return &Interface{ PhpDocComment, InterfaceName, @@ -44,11 +44,7 @@ func (n *Interface) Walk(v walker.Visitor) { if n.Extends != nil { vv := v.GetChildrenVisitor("Extends") - for _, nn := range n.Extends { - if nn != nil { - nn.Walk(vv) - } - } + n.Extends.Walk(vv) } if n.Stmts != nil { diff --git a/node/stmt/n_interface_extends.go b/node/stmt/n_interface_extends.go new file mode 100644 index 0000000..2b1c61a --- /dev/null +++ b/node/stmt/n_interface_extends.go @@ -0,0 +1,42 @@ +package stmt + +import ( + "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/walker" +) + +// InterfaceExtends node +type InterfaceExtends struct { + InterfaceNames []node.Node +} + +// NewInterfaceExtends node constructor +func NewInterfaceExtends(InterfaceNames []node.Node) *InterfaceExtends { + return &InterfaceExtends{ + InterfaceNames, + } +} + +// Attributes returns node attributes as map +func (n *InterfaceExtends) Attributes() map[string]interface{} { + return nil +} + +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true +func (n *InterfaceExtends) Walk(v walker.Visitor) { + if v.EnterNode(n) == false { + return + } + + if n.InterfaceNames != nil { + vv := v.GetChildrenVisitor("InterfaceNames") + for _, nn := range n.InterfaceNames { + if nn != nil { + nn.Walk(vv) + } + } + } + + v.LeaveNode(n) +} diff --git a/node/stmt/t_class_test.go b/node/stmt/t_class_test.go index 7ef2ad3..5b32326 100644 --- a/node/stmt/t_class_test.go +++ b/node/stmt/t_class_test.go @@ -72,9 +72,11 @@ func TestClassExtends(t *testing.T) { Modifiers: []node.Node{ &node.Identifier{Value: "final"}, }, - Extends: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "bar"}, + Extends: &stmt.ClassExtends{ + ClassName: &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "bar"}, + }, }, }, Stmts: []node.Node{}, @@ -103,10 +105,12 @@ func TestClassImplement(t *testing.T) { Modifiers: []node.Node{ &node.Identifier{Value: "final"}, }, - Implements: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "bar"}, + Implements: &stmt.ClassImplements{ + InterfaceNames: []node.Node{ + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "bar"}, + }, }, }, }, @@ -136,15 +140,17 @@ func TestClassImplements(t *testing.T) { Modifiers: []node.Node{ &node.Identifier{Value: "final"}, }, - Implements: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "bar"}, + Implements: &stmt.ClassImplements{ + InterfaceNames: []node.Node{ + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "bar"}, + }, }, - }, - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "baz"}, + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "baz"}, + }, }, }, }, @@ -173,20 +179,24 @@ func TestAnonimousClass(t *testing.T) { Expr: &expr.New{ Class: &stmt.Class{ ArgumentList: &node.ArgumentList{}, - Extends: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "foo"}, - }, - }, - Implements: []node.Node{ - &name.Name{ + Extends: &stmt.ClassExtends{ + ClassName: &name.Name{ Parts: []node.Node{ - &name.NamePart{Value: "bar"}, + &name.NamePart{Value: "foo"}, }, }, - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "baz"}, + }, + Implements: &stmt.ClassImplements{ + InterfaceNames: []node.Node{ + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "bar"}, + }, + }, + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "baz"}, + }, }, }, }, diff --git a/node/stmt/t_interface_test.go b/node/stmt/t_interface_test.go index 524178d..85a64d8 100644 --- a/node/stmt/t_interface_test.go +++ b/node/stmt/t_interface_test.go @@ -43,10 +43,12 @@ func TestInterfaceExtend(t *testing.T) { &stmt.Interface{ PhpDocComment: "", InterfaceName: &node.Identifier{Value: "Foo"}, - Extends: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + Extends: &stmt.InterfaceExtends{ + InterfaceNames: []node.Node{ + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Bar"}, + }, }, }, }, @@ -74,15 +76,17 @@ func TestInterfaceExtends(t *testing.T) { &stmt.Interface{ PhpDocComment: "", InterfaceName: &node.Identifier{Value: "Foo"}, - Extends: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + Extends: &stmt.InterfaceExtends{ + InterfaceNames: []node.Node{ + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Bar"}, + }, }, - }, - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Baz"}, + }, }, }, }, diff --git a/node/stmt/t_visitor_test.go b/node/stmt/t_visitor_test.go index 06cf9a3..f8f5c84 100644 --- a/node/stmt/t_visitor_test.go +++ b/node/stmt/t_visitor_test.go @@ -4,6 +4,8 @@ import ( "reflect" "testing" + "github.com/z7zmey/php-parser/node/name" + "github.com/z7zmey/php-parser/node/expr" "github.com/z7zmey/php-parser/node/stmt" @@ -93,8 +95,8 @@ var nodesToTest = []struct { ClassName: &node.Identifier{}, Modifiers: []node.Node{&stmt.Expression{}}, ArgumentList: &node.ArgumentList{}, - Extends: &node.Identifier{}, - Implements: []node.Node{&stmt.Expression{}}, + Extends: &stmt.ClassExtends{}, + Implements: &stmt.ClassImplements{}, Stmts: []node.Node{&stmt.Expression{}}, }, []string{"ClassName", "Modifiers", "ArgumentList", "Extends", "Implements", "Stmts"}, @@ -293,7 +295,7 @@ var nodesToTest = []struct { &stmt.Interface{ PhpDocComment: "/** */", InterfaceName: &node.Identifier{}, - Extends: []node.Node{&stmt.Expression{}}, + Extends: &stmt.InterfaceExtends{}, Stmts: []node.Node{&stmt.Expression{}}, }, []string{"InterfaceName", "Extends", "Stmts"}, @@ -493,6 +495,31 @@ var nodesToTest = []struct { []string{"Adaptations"}, map[string]interface{}{}, }, + { + &stmt.ClassExtends{ + ClassName: &name.Name{}, + }, + []string{"ClassName"}, + map[string]interface{}{}, + }, + { + &stmt.ClassImplements{ + InterfaceNames: []node.Node{ + &name.Name{}, + }, + }, + []string{"InterfaceNames"}, + map[string]interface{}{}, + }, + { + &stmt.InterfaceExtends{ + InterfaceNames: []node.Node{ + &name.Name{}, + }, + }, + []string{"InterfaceNames"}, + map[string]interface{}{}, + }, } type visitorMock struct { diff --git a/php5/php5.go b/php5/php5.go index 5509d4f..916f894 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -27,6 +27,10 @@ type yySymType struct { list []node.Node foreachVariable foreachVariable simpleIndirectReference simpleIndirectReference + + ClassExtends *stmt.ClassExtends + ClassImplements *stmt.ClassImplements + InterfaceExtends *stmt.InterfaceExtends } const T_INCLUDE = 57346 @@ -341,7 +345,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:3993 +//line php5/php5.y:4015 type foreachVariable struct { node node.Node @@ -699,14 +703,14 @@ var yyAct = [...]int{ 706, 703, 704, 608, 39, 589, 39, 39, 590, 591, 521, 684, 255, 260, 261, 572, 970, 260, 261, 956, 982, 839, 958, 39, 994, 961, 964, 39, 39, 521, - 963, 572, 902, 483, 993, 403, 572, 995, 895, 997, - 838, 835, 575, 566, 914, 1005, 916, 979, 1004, 448, - 724, 394, 39, 572, 1011, 531, 924, 389, 926, 927, - 1012, 531, 531, 164, 572, 1015, 992, 341, 697, 919, - 39, 232, 919, 232, 538, 558, 928, 290, 460, 161, - 157, 943, 318, 314, 231, 947, 231, 127, 948, 531, - 335, 944, 1008, 343, 39, 938, 528, 607, 996, 969, - 39, 968, 945, 967, 966, 837, 836, 834, 401, 40, + 963, 572, 902, 483, 993, 895, 572, 995, 838, 997, + 835, 566, 1005, 1004, 914, 724, 916, 979, 394, 448, + 389, 164, 39, 572, 1011, 531, 924, 341, 926, 927, + 1012, 531, 531, 697, 572, 1015, 992, 538, 928, 919, + 39, 232, 919, 232, 290, 558, 460, 161, 157, 318, + 314, 943, 127, 403, 231, 947, 231, 575, 948, 531, + 401, 335, 944, 1008, 39, 343, 938, 528, 607, 996, + 39, 969, 945, 968, 967, 966, 837, 836, 834, 40, 568, 15, 14, 822, 972, 719, 801, 694, 11, 249, 75, 232, 76, 116, 266, 64, 89, 598, 90, 520, 101, 74, 12, 326, 231, 100, 99, 531, 79, 519, @@ -1618,12 +1622,12 @@ var yyPgo = [...]int{ 1080, 1079, 1078, 135, 1077, 1076, 24, 1075, 26, 48, 45, 1074, 708, 34, 1073, 1, 1072, 1070, 27, 1069, 73, 68, 61, 1068, 1067, 1066, 35, 1065, 1063, 4, - 1062, 1061, 1060, 17, 1059, 1058, 1057, 1056, 1055, 51, - 5, 1054, 1053, 1051, 1049, 1048, 2, 1047, 631, 1046, - 18, 22, 1045, 1043, 1042, 15, 1041, 1040, 39, 0, - 1037, 1033, 1032, 117, 1030, 1029, 553, 1028, 1027, 42, - 8, 1026, 9, 1024, 1018, 1017, 14, 49, 1013, 1007, - 1001, 1000, 998, 995, 3, 993, 16, 992, 991, 990, + 1062, 1061, 1060, 17, 1059, 1058, 1057, 1056, 51, 5, + 1055, 1054, 1053, 1051, 1049, 2, 1048, 631, 1047, 18, + 22, 1046, 1045, 1043, 15, 1042, 1041, 1040, 1037, 1033, + 39, 0, 1032, 1030, 1029, 117, 1028, 1027, 553, 1026, + 1024, 42, 8, 1018, 9, 1017, 1013, 1007, 14, 49, + 1001, 1000, 998, 995, 993, 992, 3, 991, 16, 990, 988, 985, 28, 983, 982, 980, 976, 974, 971, 962, 21, 961, 959, 958, 25, 955, 23, 12, 953, 40, 945, 939, 937, 933, 41, 6, 19, 13, 930, 853, @@ -1631,29 +1635,29 @@ var yyPgo = [...]int{ } var yyR1 = [...]int{ - 0, 149, 88, 88, 89, 89, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 90, 90, - 4, 4, 4, 4, 91, 91, 5, 5, 5, 5, - 92, 92, 6, 6, 6, 6, 53, 53, 93, 93, + 0, 149, 90, 90, 91, 91, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 92, 92, + 4, 4, 4, 4, 93, 93, 5, 5, 5, 5, + 94, 94, 6, 6, 6, 6, 53, 53, 95, 95, 24, 24, 24, 24, 24, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 111, 111, 58, 58, 112, - 112, 113, 113, 59, 109, 109, 56, 51, 52, 147, + 26, 26, 26, 26, 26, 113, 113, 58, 58, 114, + 114, 115, 115, 59, 111, 111, 56, 51, 52, 147, 147, 148, 148, 60, 61, 61, 64, 64, 64, 64, - 65, 65, 2, 121, 121, 117, 117, 122, 122, 146, - 146, 145, 145, 145, 86, 86, 85, 85, 57, 57, - 110, 110, 83, 83, 83, 83, 107, 107, 107, 150, - 150, 87, 87, 103, 103, 104, 104, 54, 54, 55, - 55, 114, 114, 115, 115, 63, 63, 62, 62, 62, - 62, 81, 81, 81, 123, 123, 69, 69, 69, 69, - 94, 94, 27, 27, 27, 95, 95, 95, 95, 116, - 116, 66, 66, 66, 66, 68, 124, 124, 82, 82, - 125, 125, 126, 126, 70, 70, 71, 127, 127, 74, - 74, 73, 72, 72, 75, 75, 84, 84, 118, 118, - 119, 119, 128, 128, 76, 76, 76, 76, 76, 76, - 120, 120, 120, 120, 67, 67, 108, 108, 106, 106, - 105, 105, 134, 134, 132, 132, 133, 133, 133, 135, + 87, 87, 2, 89, 89, 88, 88, 122, 122, 146, + 146, 145, 145, 145, 85, 85, 84, 84, 57, 57, + 112, 112, 82, 82, 82, 82, 109, 109, 109, 150, + 150, 86, 86, 105, 105, 106, 106, 54, 54, 55, + 55, 116, 116, 117, 117, 63, 63, 62, 62, 62, + 62, 80, 80, 80, 123, 123, 68, 68, 68, 68, + 96, 96, 27, 27, 27, 97, 97, 97, 97, 118, + 118, 65, 65, 65, 65, 67, 124, 124, 81, 81, + 125, 125, 126, 126, 69, 69, 70, 127, 127, 73, + 73, 72, 71, 71, 74, 74, 83, 83, 119, 119, + 120, 120, 128, 128, 75, 75, 75, 75, 75, 75, + 121, 121, 121, 121, 66, 66, 110, 110, 108, 108, + 107, 107, 134, 134, 132, 132, 133, 133, 133, 135, 135, 42, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, @@ -1662,27 +1666,27 @@ var yyR1 = [...]int{ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 50, 50, 50, 50, - 47, 47, 47, 47, 46, 46, 1, 102, 102, 101, - 101, 101, 101, 23, 23, 23, 23, 23, 23, 23, + 47, 47, 47, 47, 46, 46, 1, 104, 104, 103, + 103, 103, 103, 23, 23, 23, 23, 23, 23, 23, 23, 11, 11, 11, 11, 45, 45, 45, 43, 43, 41, 41, 142, 142, 141, 49, 49, 49, 129, 129, - 129, 80, 80, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 8, 28, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 129, 79, 79, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 8, 28, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 35, 35, 35, 35, 29, 29, 29, 29, 29, 29, 29, 130, 130, 151, 151, 131, 131, 131, 131, 14, 14, 48, 48, 16, 17, 18, 19, 19, 143, 143, - 136, 138, 138, 77, 137, 137, 137, 40, 40, 44, + 136, 138, 138, 76, 137, 137, 137, 40, 40, 44, 44, 12, 22, 22, 20, 20, 20, 21, 21, 21, 10, 10, 10, 9, 9, 13, 13, 139, 139, 140, - 140, 140, 39, 39, 144, 144, 100, 100, 38, 38, - 38, 99, 99, 98, 98, 98, 98, 98, 98, 98, - 98, 96, 96, 96, 96, 33, 33, 33, 33, 33, + 140, 140, 39, 39, 144, 144, 102, 102, 38, 38, + 38, 101, 101, 100, 100, 100, 100, 100, 100, 100, + 100, 98, 98, 98, 98, 33, 33, 33, 33, 33, 33, 34, 34, 34, 37, 37, 37, 37, 37, 37, - 37, 37, 97, 97, 36, 36, 30, 30, 31, 32, + 37, 37, 99, 99, 36, 36, 30, 30, 31, 32, } var yyR2 = [...]int{ @@ -1741,7 +1745,7 @@ var yyR2 = [...]int{ } var yyChk = [...]int{ - -1000, -149, -88, -3, 2, -25, -51, -52, 51, 79, + -1000, -149, -90, -3, 2, -25, -51, -52, 51, 79, 44, -53, -26, 10, -60, -61, 38, 142, 7, 21, 20, 23, 30, 34, 35, 39, -50, 46, 98, 19, 14, -14, 48, 25, 27, 144, 40, 43, 36, -1, @@ -1751,99 +1755,99 @@ var yyChk = [...]int{ 112, 113, 6, 156, -29, -47, -46, 141, 96, -20, 91, 49, 50, 4, 5, 84, 85, 86, 11, -35, -32, -7, 140, 74, 62, 18, 60, 148, -21, -22, - -23, -30, -89, 82, -11, 8, 9, 66, 67, 81, + -23, -30, -91, 82, -11, 8, 9, 66, 67, 81, 63, 64, 65, 80, -10, -144, -44, -12, -40, -9, - 157, 12, 146, -89, 142, 82, 10, -90, 37, 38, - -4, -89, 82, 144, 158, 145, 10, -93, -48, 146, + 157, 12, 146, -91, 142, 82, 10, -92, 37, 38, + -4, -91, 82, 144, 158, 145, 10, -95, -48, 146, -48, -25, -1, 79, 146, -48, 144, -14, 97, 98, - 144, -14, 144, -15, -19, -14, 144, -94, -27, 12, - 157, -95, -1, 12, -108, -14, 144, 129, 130, 87, + 144, -14, 144, -15, -19, -14, 144, -96, -27, 12, + 157, -97, -1, 12, -110, -14, 144, 129, 130, 87, 89, 88, 159, 151, 161, 167, 153, 152, 162, 131, 163, 164, 132, 133, 134, 135, 136, 137, 165, 138, 166, 139, 90, 150, 146, 146, 146, 142, -14, 10, -147, 151, 10, 10, -15, -19, -14, 52, 52, 160, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 146, -14, 104, 105, -18, -19, -89, 79, + 127, 128, 146, -14, 104, 105, -18, -19, -91, 79, 82, -11, -12, 98, -18, -14, -14, -14, -14, -42, -14, -50, -14, -14, -14, -14, -14, -14, -14, -49, - 146, -48, -14, 148, 148, -129, 17, -96, -33, 12, - 76, 77, -14, 57, -43, -11, -41, -89, 79, 82, + 146, -48, -14, 148, 148, -129, 17, -98, -33, 12, + 76, 77, -14, 57, -43, -11, -41, -91, 79, 82, -21, -10, -144, -12, 146, 146, -14, -14, 146, -14, - -14, 148, -96, 17, 17, 75, -96, 148, 146, -99, - -98, -14, 151, 148, 148, 82, -81, 146, -89, 78, - 148, 142, -10, 157, 78, -81, 142, 147, 144, 142, - -88, -89, 144, 158, -91, -5, -89, 82, -92, -6, - -89, 82, 29, -89, 10, 160, -24, 143, 2, -25, - -51, -52, 51, -25, 145, -87, -25, 145, 21, -147, - -106, -105, -14, -83, 142, 145, 144, 144, 144, 144, + -14, 148, -98, 17, 17, 75, -98, 148, 146, -101, + -100, -14, 151, 148, 148, 82, -80, 146, -91, 78, + 148, 142, -10, 157, 78, -80, 142, 147, 144, 142, + -90, -91, 144, 158, -93, -5, -91, 82, -94, -6, + -91, 82, 29, -91, 10, 160, -24, 143, 2, -25, + -51, -52, 51, -25, 145, -86, -25, 145, 21, -147, + -108, -107, -14, -82, 142, 145, 144, 144, 144, 144, 144, 158, -16, 142, -19, 144, 158, -147, 160, 144, 158, -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, -43, -14, 145, -109, - -56, -19, -19, -15, -110, 10, -93, 144, 144, 10, - 146, -65, 55, -121, 55, 58, -14, 151, -14, -14, + -14, -14, -14, -14, -14, -14, -43, -14, 145, -111, + -56, -19, -19, -15, -112, 10, -95, 144, 144, 10, + 146, -87, 55, -89, 55, 58, -14, 151, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -100, -38, -19, 59, 82, -89, 78, 78, 147, 147, + -102, -38, -19, 59, 82, -91, 78, 78, 147, 147, 147, 147, -13, -14, -13, 141, -33, -33, 17, 148, 57, -14, 11, -19, -139, -140, -40, -39, -10, -144, - 10, 142, -80, -81, 78, 82, -89, 57, -10, 78, - -97, -36, -19, -15, -19, -15, -14, -13, 140, 75, - 75, -13, -99, 149, -151, 158, 58, -17, -19, -13, - -13, 10, 147, -123, -50, -69, -15, -19, 151, 83, - -81, -39, -40, 10, 52, -13, -14, -39, -40, 10, - -14, 144, -88, 143, -81, -4, 144, 158, 29, -89, - 144, 158, 29, -89, 10, 29, 160, -28, -78, -7, - -31, -89, 79, 82, 60, 148, -8, 62, -79, 18, - 74, -11, 154, 155, 153, 152, 146, 146, -103, -93, - -93, -48, 144, 158, -107, 144, -107, 144, -27, -14, + 10, 142, -79, -80, 78, 82, -91, 57, -10, 78, + -99, -36, -19, -15, -19, -15, -14, -13, 140, 75, + 75, -13, -101, 149, -151, 158, 58, -17, -19, -13, + -13, 10, 147, -123, -50, -68, -15, -19, 151, 83, + -80, -39, -40, 10, 52, -13, -14, -39, -40, 10, + -14, 144, -90, 143, -80, -4, 144, 158, 29, -91, + 144, 158, 29, -91, 10, 29, 160, -28, -77, -7, + -31, -91, 79, 82, 60, 148, -8, 62, -78, 18, + 74, -11, 154, 155, 153, 152, 146, 146, -105, -95, + -95, -48, 144, 158, -109, 144, -109, 144, -27, -14, 12, 146, -28, -14, 145, -14, 147, 158, 29, 29, - 147, 158, 160, 143, 146, -114, -115, -63, -62, 60, - 61, -45, -89, 79, 82, -117, 56, -45, 142, -122, - -45, -15, -19, -19, 91, 147, 158, 146, -89, -135, + 147, 158, 160, 143, 146, -116, -117, -63, -62, 60, + 61, -45, -91, 79, 82, -88, 56, -45, 142, -122, + -45, -15, -19, -19, 91, 147, 158, 146, -91, -135, -133, -132, -134, 148, -136, 57, 149, 149, -34, 10, - 13, 12, 10, 143, 148, 143, -137, -77, -138, -81, - 148, 142, -10, -14, -40, -89, -139, -40, 147, 158, + 13, 12, 10, 143, 148, 143, -137, -76, -138, -80, + 148, 142, -10, -14, -40, -91, -139, -40, 147, 158, 147, 147, 147, 149, 149, 147, -14, 151, -14, 151, - 149, 149, 147, 158, 147, -17, -14, -81, -81, 149, - 143, -81, -81, 143, 143, -5, 10, 29, -6, 10, + 149, 149, 147, 158, 147, -17, -14, -80, -80, 149, + 143, -80, -80, 143, 143, -5, 10, 29, -6, 10, 29, 10, -28, 148, 153, 152, 162, 131, 163, 164, 159, 151, 161, 132, 133, 167, 88, 89, 87, 130, 129, 134, 135, 136, 137, 165, 166, 138, 139, 150, - 82, -89, 146, -130, -131, -78, 17, 78, -78, -78, - -78, -78, -78, 147, -54, 93, 94, -104, 22, 144, - -106, -14, 143, 32, 33, -107, 31, -107, 143, 160, - -114, -14, 144, -56, -145, -19, 151, 59, -145, -57, - -25, 145, 10, -28, -111, 41, -114, 147, 158, -147, - 82, -89, 142, -122, -116, 158, -43, 160, -38, -100, + 82, -91, 146, -130, -131, -77, 17, 78, -77, -77, + -77, -77, -77, 147, -54, 93, 94, -106, 22, 144, + -108, -14, 143, 32, 33, -109, 31, -109, 143, 160, + -116, -14, 144, -56, -145, -19, 151, 59, -145, -57, + -25, 145, 10, -28, -113, 41, -116, 147, 158, -147, + 82, -91, 142, -122, -118, 158, -43, 160, -38, -102, 148, -134, -136, -13, -139, 149, -14, -143, 148, 148, - -13, -14, 143, -142, -36, 58, -17, -17, -69, 10, - 10, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, 145, -78, -89, + -13, -14, 143, -142, -36, 58, -17, -17, -68, 10, + 10, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, + -77, -77, -77, -77, -77, -77, -77, 145, -77, -91, -130, 149, -151, 158, 58, 10, 52, 147, 144, -48, -25, -55, 93, 94, 144, 144, -14, -150, 145, 144, 143, 144, 31, -28, 147, -146, 58, -19, 146, -146, - -93, 160, -58, 42, 146, 147, -102, 44, -63, -148, - 83, -89, -116, 143, -66, -118, -67, -68, -119, -128, - 47, 38, 44, -76, 103, 102, 101, 98, 99, 100, - -45, -80, -14, 147, -13, 149, -137, 149, -136, -13, - -13, 149, 143, -141, 57, -14, 151, 149, -78, 145, - 147, -78, -78, -25, 95, -48, 145, -106, -150, -93, - 144, -102, 147, -145, -100, 147, 28, -28, 142, -45, - 142, 142, 146, 12, 143, -120, 12, 144, 158, -1, - -76, 10, -124, -45, 149, 143, 149, 149, -139, -17, - -78, 58, 144, 145, -93, 147, -93, 142, -85, -25, - 145, 147, -85, 144, -93, 12, -93, -93, -101, 12, - 151, 160, 144, 158, 160, 10, -147, 160, -82, 158, - 144, 142, -78, -93, -86, -25, 145, -93, -93, 143, + -95, 160, -58, 42, 146, 147, -104, 44, -63, -148, + 83, -91, -118, 143, -65, -119, -66, -67, -120, -128, + 47, 38, 44, -75, 103, 102, 101, 98, 99, 100, + -45, -79, -14, 147, -13, 149, -137, 149, -136, -13, + -13, 149, 143, -141, 57, -14, 151, 149, -77, 145, + 147, -77, -77, -25, 95, -48, 145, -108, -150, -95, + 144, -104, 147, -145, -102, 147, 28, -28, 142, -45, + 142, 142, 146, 12, 143, -121, 12, 144, 158, -1, + -75, 10, -124, -45, 149, 143, 149, 149, -139, -17, + -77, 58, 144, 145, -95, 147, -95, 142, -84, -25, + 145, 147, -84, 144, -95, 12, -95, -95, -103, 12, + 151, 160, 144, 158, 160, 10, -147, 160, -81, 158, + 144, 142, -77, -95, -85, -25, 145, -95, -95, 143, 147, 143, 143, 147, 158, 12, -28, 12, -28, 160, - 10, -28, -45, -125, -126, -70, -71, -72, -73, -74, - -45, 10, -93, 143, 26, 142, 12, 151, 160, -28, - 146, 143, -70, 144, 144, 45, 29, 78, 24, 144, - -93, 12, -28, -114, -127, -45, -75, -76, 10, 144, - 143, 147, 158, 10, -112, -113, -59, 41, -84, 144, - 142, -45, -59, 146, -93, -45, 143, 12, 147, 142, - -93, 143, + 10, -28, -45, -125, -126, -69, -70, -71, -72, -73, + -45, 10, -95, 143, 26, 142, 12, 151, 160, -28, + 146, 143, -69, 144, 144, 45, 29, 78, 24, 144, + -95, 12, -28, -116, -127, -45, -74, -75, 10, 144, + 143, 147, 158, 10, -114, -115, -59, 41, -83, 144, + 142, -45, -59, 146, -95, -45, 143, 12, 147, 142, + -95, 143, } var yyDef = [...]int{ @@ -2327,14 +2331,14 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:269 + //line php5/php5.y:276 { yylex.(*Parser).rootNode = node.NewRoot(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) } case 2: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:277 + //line php5/php5.y:284 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2342,13 +2346,13 @@ yydefault: } case 3: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:282 + //line php5/php5.y:289 { yyVAL.list = []node.Node{} } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:287 + //line php5/php5.y:294 { namePart := name.NewNamePart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2357,7 +2361,7 @@ yydefault: } case 5: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:294 + //line php5/php5.y:301 { namePart := name.NewNamePart(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2366,32 +2370,32 @@ yydefault: } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:304 + //line php5/php5.y:311 { // error yyVAL.node = nil } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:309 + //line php5/php5.y:316 { yyVAL.node = yyDollar[1].node } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:311 + //line php5/php5.y:318 { yyVAL.node = yyDollar[1].node } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:313 + //line php5/php5.y:320 { yyVAL.node = yyDollar[1].node } case 10: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:315 + //line php5/php5.y:322 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2399,7 +2403,7 @@ yydefault: } case 11: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:321 + //line php5/php5.y:328 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2411,7 +2415,7 @@ yydefault: } case 12: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:331 + //line php5/php5.y:338 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2423,7 +2427,7 @@ yydefault: } case 13: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:341 + //line php5/php5.y:348 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2431,7 +2435,7 @@ yydefault: } case 14: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:347 + //line php5/php5.y:354 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2439,7 +2443,7 @@ yydefault: } case 15: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:353 + //line php5/php5.y:360 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2451,7 +2455,7 @@ yydefault: } case 16: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:363 + //line php5/php5.y:370 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2463,25 +2467,25 @@ yydefault: } case 17: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:373 + //line php5/php5.y:380 { yyVAL.node = yyDollar[1].node } case 18: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:378 + //line php5/php5.y:385 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:380 + //line php5/php5.y:387 { yyVAL.list = []node.Node{yyDollar[1].node} } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:385 + //line php5/php5.y:392 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2493,7 +2497,7 @@ yydefault: } case 21: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:395 + //line php5/php5.y:402 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2508,7 +2512,7 @@ yydefault: } case 22: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:408 + //line php5/php5.y:415 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2520,7 +2524,7 @@ yydefault: } case 23: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:418 + //line php5/php5.y:425 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2535,19 +2539,19 @@ yydefault: } case 24: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:434 + //line php5/php5.y:441 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:436 + //line php5/php5.y:443 { yyVAL.list = []node.Node{yyDollar[1].node} } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:441 + //line php5/php5.y:448 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2559,7 +2563,7 @@ yydefault: } case 27: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:451 + //line php5/php5.y:458 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2574,7 +2578,7 @@ yydefault: } case 28: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:464 + //line php5/php5.y:471 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2586,7 +2590,7 @@ yydefault: } case 29: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:474 + //line php5/php5.y:481 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2601,19 +2605,19 @@ yydefault: } case 30: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:490 + //line php5/php5.y:497 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:492 + //line php5/php5.y:499 { yyVAL.list = []node.Node{yyDollar[1].node} } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:497 + //line php5/php5.y:504 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2625,7 +2629,7 @@ yydefault: } case 33: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:507 + //line php5/php5.y:514 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2640,7 +2644,7 @@ yydefault: } case 34: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:520 + //line php5/php5.y:527 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2652,7 +2656,7 @@ yydefault: } case 35: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:530 + //line php5/php5.y:537 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2667,7 +2671,7 @@ yydefault: } case 36: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:546 + //line php5/php5.y:553 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2685,7 +2689,7 @@ yydefault: } case 37: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:562 + //line php5/php5.y:569 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2703,7 +2707,7 @@ yydefault: } case 38: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:581 + //line php5/php5.y:588 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2711,38 +2715,38 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:587 + //line php5/php5.y:594 { yyVAL.list = []node.Node{} } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:593 + //line php5/php5.y:600 { // error yyVAL.node = nil } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:598 + //line php5/php5.y:605 { yyVAL.node = yyDollar[1].node } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:600 + //line php5/php5.y:607 { yyVAL.node = yyDollar[1].node } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:602 + //line php5/php5.y:609 { yyVAL.node = yyDollar[1].node } case 44: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:604 + //line php5/php5.y:611 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2750,13 +2754,13 @@ yydefault: } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:614 + //line php5/php5.y:621 { yyVAL.node = yyDollar[1].node } case 46: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:616 + //line php5/php5.y:623 { label := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2768,7 +2772,7 @@ yydefault: } case 47: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:629 + //line php5/php5.y:636 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2776,7 +2780,7 @@ yydefault: } case 48: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:635 + //line php5/php5.y:642 { yyVAL.node = stmt.NewIf(yyDollar[2].node, yyDollar[3].node, yyDollar[4].list, yyDollar[5].node) @@ -2792,7 +2796,7 @@ yydefault: } case 49: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:649 + //line php5/php5.y:656 { stmts := stmt.NewStmtList(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) @@ -2803,7 +2807,7 @@ yydefault: } case 50: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:658 + //line php5/php5.y:665 { switch n := yyDollar[3].node.(type) { case *stmt.While: @@ -2819,7 +2823,7 @@ yydefault: } case 51: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:672 + //line php5/php5.y:679 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2827,7 +2831,7 @@ yydefault: } case 52: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:678 + //line php5/php5.y:685 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -2847,7 +2851,7 @@ yydefault: } case 53: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:696 + //line php5/php5.y:703 { switch n := yyDollar[3].node.(type) { case *stmt.Switch: @@ -2865,7 +2869,7 @@ yydefault: } case 54: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:712 + //line php5/php5.y:719 { yyVAL.node = stmt.NewBreak(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2873,7 +2877,7 @@ yydefault: } case 55: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:718 + //line php5/php5.y:725 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2881,7 +2885,7 @@ yydefault: } case 56: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:724 + //line php5/php5.y:731 { yyVAL.node = stmt.NewContinue(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2889,7 +2893,7 @@ yydefault: } case 57: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:730 + //line php5/php5.y:737 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2897,7 +2901,7 @@ yydefault: } case 58: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:736 + //line php5/php5.y:743 { yyVAL.node = stmt.NewReturn(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2905,7 +2909,7 @@ yydefault: } case 59: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:742 + //line php5/php5.y:749 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2913,7 +2917,7 @@ yydefault: } case 60: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:748 + //line php5/php5.y:755 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2921,7 +2925,7 @@ yydefault: } case 61: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:754 + //line php5/php5.y:761 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2929,7 +2933,7 @@ yydefault: } case 62: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:760 + //line php5/php5.y:767 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2937,7 +2941,7 @@ yydefault: } case 63: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:766 + //line php5/php5.y:773 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2945,7 +2949,7 @@ yydefault: } case 64: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:772 + //line php5/php5.y:779 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2953,7 +2957,7 @@ yydefault: } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:778 + //line php5/php5.y:785 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2961,7 +2965,7 @@ yydefault: } case 66: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:784 + //line php5/php5.y:791 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2969,7 +2973,7 @@ yydefault: } case 67: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:790 + //line php5/php5.y:797 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2977,7 +2981,7 @@ yydefault: } case 68: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:796 + //line php5/php5.y:803 { if yyDollar[6].foreachVariable.node == nil { switch n := yyDollar[8].node.(type) { @@ -3012,7 +3016,7 @@ yydefault: } case 69: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:829 + //line php5/php5.y:836 { if yyDollar[6].foreachVariable.node == nil { switch n := yyDollar[8].node.(type) { @@ -3047,7 +3051,7 @@ yydefault: } case 70: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:862 + //line php5/php5.y:869 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) @@ -3055,7 +3059,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:868 + //line php5/php5.y:875 { yyVAL.node = stmt.NewNop() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3063,7 +3067,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:874 + //line php5/php5.y:881 { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3077,7 +3081,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:886 + //line php5/php5.y:893 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -3085,7 +3089,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:892 + //line php5/php5.y:899 { label := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3097,13 +3101,13 @@ yydefault: } case 75: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:905 + //line php5/php5.y:912 { yyVAL.list = []node.Node{} } case 76: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:907 + //line php5/php5.y:914 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3121,13 +3125,13 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:925 + //line php5/php5.y:932 { yyVAL.node = nil } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:927 + //line php5/php5.y:934 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3135,31 +3139,31 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:936 + //line php5/php5.y:943 { yyVAL.list = yyDollar[1].list } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:938 + //line php5/php5.y:945 { yyVAL.list = []node.Node{} } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:943 + //line php5/php5.y:950 { yyVAL.list = []node.Node{yyDollar[1].node} } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:945 + //line php5/php5.y:952 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:950 + //line php5/php5.y:957 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3175,61 +3179,61 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:967 + //line php5/php5.y:974 { yyVAL.list = []node.Node{yyDollar[1].node} } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:969 + //line php5/php5.y:976 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:974 + //line php5/php5.y:981 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:979 + //line php5/php5.y:986 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:984 + //line php5/php5.y:991 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:989 + //line php5/php5.y:996 { yyVAL.token = nil } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:991 + //line php5/php5.y:998 { yyVAL.token = yyDollar[1].token } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:996 + //line php5/php5.y:1003 { yyVAL.token = nil } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:998 + //line php5/php5.y:1005 { yyVAL.token = yyDollar[1].token } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:1003 + //line php5/php5.y:1010 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3241,7 +3245,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:1016 + //line php5/php5.y:1023 { switch n := yyDollar[1].node.(type) { case *stmt.Class: @@ -3249,8 +3253,8 @@ yydefault: yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) n.ClassName = name n.Stmts = yyDollar[6].list - n.Extends = yyDollar[3].node - n.Implements = yyDollar[4].list + n.Extends = yyDollar[3].ClassExtends + n.Implements = yyDollar[4].ClassImplements case *stmt.Trait: // TODO: is it possible that trait extend or implement @@ -3264,19 +3268,19 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1037 + //line php5/php5.y:1044 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yylex.(*Parser).comments.AddComments(name, yyDollar[2].token.Comments()) - yyVAL.node = stmt.NewInterface(name, yyDollar[3].list, yyDollar[5].list, "") + yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[5].list, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1051 + //line php5/php5.y:1058 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3284,7 +3288,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1057 + //line php5/php5.y:1064 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3296,7 +3300,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1067 + //line php5/php5.y:1074 { yyVAL.node = stmt.NewTrait(nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3304,7 +3308,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1073 + //line php5/php5.y:1080 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3316,85 +3320,94 @@ yydefault: } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1086 + //line php5/php5.y:1093 { - yyVAL.node = nil + yyVAL.ClassExtends = nil } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1088 + //line php5/php5.y:1095 { - yyVAL.node = yyDollar[2].node + yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.ClassExtends, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1093 + //line php5/php5.y:1105 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1098 + //line php5/php5.y:1110 { - yyVAL.list = nil + yyVAL.InterfaceExtends = nil } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1100 + //line php5/php5.y:1112 { - yyVAL.list = yyDollar[2].list + yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.InterfaceExtends, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1105 + //line php5/php5.y:1122 { - yyVAL.list = nil + yyVAL.ClassImplements = nil } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1107 + //line php5/php5.y:1124 { - yyVAL.list = yyDollar[2].list + yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.ClassImplements, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1112 + //line php5/php5.y:1134 { yyVAL.list = []node.Node{yyDollar[1].node} } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1114 + //line php5/php5.y:1136 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1119 + //line php5/php5.y:1141 { yyVAL.foreachVariable = foreachVariable{nil, false} } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1121 + //line php5/php5.y:1143 { yyVAL.foreachVariable = yyDollar[2].foreachVariable } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1126 + //line php5/php5.y:1148 { yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1128 + //line php5/php5.y:1150 { yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1130 + //line php5/php5.y:1152 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3403,14 +3416,14 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1140 + //line php5/php5.y:1162 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1145 + //line php5/php5.y:1167 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -3420,14 +3433,14 @@ yydefault: } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1157 + //line php5/php5.y:1179 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1162 + //line php5/php5.y:1184 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList, false) @@ -3437,13 +3450,13 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1174 + //line php5/php5.y:1196 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1176 + //line php5/php5.y:1198 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3451,7 +3464,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1186 + //line php5/php5.y:1208 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3465,7 +3478,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1198 + //line php5/php5.y:1220 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3479,7 +3492,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1214 + //line php5/php5.y:1236 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3489,7 +3502,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1222 + //line php5/php5.y:1244 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3499,7 +3512,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1230 + //line php5/php5.y:1252 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -3509,7 +3522,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1238 + //line php5/php5.y:1260 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -3520,13 +3533,13 @@ yydefault: } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1251 + //line php5/php5.y:1273 { yyVAL.list = []node.Node{} } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1253 + //line php5/php5.y:1275 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) @@ -3535,7 +3548,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1260 + //line php5/php5.y:1282 { _default := stmt.NewDefault(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) @@ -3544,14 +3557,14 @@ yydefault: } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1277 + //line php5/php5.y:1299 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1282 + //line php5/php5.y:1304 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -3561,13 +3574,13 @@ yydefault: } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1295 + //line php5/php5.y:1317 { yyVAL.list = nil } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1297 + //line php5/php5.y:1319 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) @@ -3577,13 +3590,13 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1309 + //line php5/php5.y:1331 { yyVAL.list = nil } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1311 + //line php5/php5.y:1333 { stmts := stmt.NewStmtList(yyDollar[5].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[5].list)) @@ -3596,13 +3609,13 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1326 + //line php5/php5.y:1348 { yyVAL.node = nil } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1328 + //line php5/php5.y:1350 { yyVAL.node = stmt.NewElse(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3610,13 +3623,13 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1338 + //line php5/php5.y:1360 { yyVAL.node = nil } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1340 + //line php5/php5.y:1362 { stmts := stmt.NewStmtList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) @@ -3627,31 +3640,31 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1353 + //line php5/php5.y:1375 { yyVAL.list = yyDollar[1].list } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1355 + //line php5/php5.y:1377 { yyVAL.list = nil } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1360 + //line php5/php5.y:1382 { yyVAL.list = []node.Node{yyDollar[1].node} } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1362 + //line php5/php5.y:1384 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1367 + //line php5/php5.y:1389 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3679,7 +3692,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1393 + //line php5/php5.y:1415 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3707,13 +3720,13 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1423 + //line php5/php5.y:1445 { yyVAL.node = nil } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1425 + //line php5/php5.y:1447 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3721,7 +3734,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1431 + //line php5/php5.y:1453 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3729,13 +3742,13 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1437 + //line php5/php5.y:1459 { yyVAL.node = yyDollar[1].node } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1443 + //line php5/php5.y:1465 { yyVAL.node = node.NewArgumentList(nil) @@ -3744,7 +3757,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1450 + //line php5/php5.y:1472 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -3753,7 +3766,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1457 + //line php5/php5.y:1479 { arg := node.NewArgument(yyDollar[2].node, false, false) yyVAL.node = node.NewArgumentList([]node.Node{arg}) @@ -3764,19 +3777,19 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1470 + //line php5/php5.y:1492 { yyVAL.list = []node.Node{yyDollar[1].node} } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1472 + //line php5/php5.y:1494 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1477 + //line php5/php5.y:1499 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3784,7 +3797,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1483 + //line php5/php5.y:1505 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3792,7 +3805,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1489 + //line php5/php5.y:1511 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -3800,7 +3813,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1495 + //line php5/php5.y:1517 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3808,19 +3821,19 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1504 + //line php5/php5.y:1526 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1506 + //line php5/php5.y:1528 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1512 + //line php5/php5.y:1534 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3832,7 +3845,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1522 + //line php5/php5.y:1544 { yyVAL.node = expr.NewVariable(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3840,7 +3853,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1528 + //line php5/php5.y:1550 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3848,7 +3861,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1538 + //line php5/php5.y:1560 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3867,7 +3880,7 @@ yydefault: } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1555 + //line php5/php5.y:1577 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3886,7 +3899,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1572 + //line php5/php5.y:1594 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3905,7 +3918,7 @@ yydefault: } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1589 + //line php5/php5.y:1611 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3924,19 +3937,19 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1611 + //line php5/php5.y:1633 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1613 + //line php5/php5.y:1635 { yyVAL.list = []node.Node{} } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1619 + //line php5/php5.y:1641 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) @@ -3944,19 +3957,19 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1625 + //line php5/php5.y:1647 { yyVAL.node = yyDollar[1].node } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1627 + //line php5/php5.y:1649 { yyVAL.node = yyDollar[1].node } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1629 + //line php5/php5.y:1651 { name := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3974,7 +3987,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1648 + //line php5/php5.y:1670 { var adaptationList *stmt.TraitAdaptationList switch n := yyDollar[3].node.(type) { @@ -3990,19 +4003,19 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1665 + //line php5/php5.y:1687 { yyVAL.list = []node.Node{yyDollar[1].node} } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1667 + //line php5/php5.y:1689 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1672 + //line php5/php5.y:1694 { yyVAL.node = stmt.NewNop() @@ -4010,7 +4023,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1678 + //line php5/php5.y:1700 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4018,43 +4031,43 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1687 + //line php5/php5.y:1709 { yyVAL.list = nil } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1689 + //line php5/php5.y:1711 { yyVAL.list = yyDollar[1].list } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1694 + //line php5/php5.y:1716 { yyVAL.list = []node.Node{yyDollar[1].node} } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1696 + //line php5/php5.y:1718 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1701 + //line php5/php5.y:1723 { yyVAL.node = yyDollar[1].node } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1703 + //line php5/php5.y:1725 { yyVAL.node = yyDollar[1].node } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1708 + //line php5/php5.y:1730 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) @@ -4062,19 +4075,19 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1717 + //line php5/php5.y:1739 { yyVAL.list = []node.Node{yyDollar[1].node} } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1719 + //line php5/php5.y:1741 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1724 + //line php5/php5.y:1746 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4086,13 +4099,13 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1734 + //line php5/php5.y:1756 { yyVAL.node = yyDollar[1].node } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1739 + //line php5/php5.y:1761 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4104,7 +4117,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1752 + //line php5/php5.y:1774 { alias := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -4116,7 +4129,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1762 + //line php5/php5.y:1784 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4124,19 +4137,19 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1771 + //line php5/php5.y:1793 { yyVAL.node = nil } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1773 + //line php5/php5.y:1795 { yyVAL.node = yyDollar[1].node } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1778 + //line php5/php5.y:1800 { yyVAL.node = stmt.NewNop() @@ -4144,7 +4157,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1784 + //line php5/php5.y:1806 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -4152,13 +4165,13 @@ yydefault: } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1793 + //line php5/php5.y:1815 { yyVAL.list = yyDollar[1].list } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1795 + //line php5/php5.y:1817 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4168,31 +4181,31 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1806 + //line php5/php5.y:1828 { yyVAL.list = nil } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1808 + //line php5/php5.y:1830 { yyVAL.list = yyDollar[1].list } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1813 + //line php5/php5.y:1835 { yyVAL.list = []node.Node{yyDollar[1].node} } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1815 + //line php5/php5.y:1837 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 204: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1820 + //line php5/php5.y:1842 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4200,7 +4213,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1826 + //line php5/php5.y:1848 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4208,7 +4221,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1832 + //line php5/php5.y:1854 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4216,7 +4229,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1838 + //line php5/php5.y:1860 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4224,7 +4237,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1844 + //line php5/php5.y:1866 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4232,7 +4245,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1850 + //line php5/php5.y:1872 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4240,7 +4253,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1859 + //line php5/php5.y:1881 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4258,7 +4271,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1875 + //line php5/php5.y:1897 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4276,7 +4289,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1891 + //line php5/php5.y:1913 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4294,7 +4307,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1907 + //line php5/php5.y:1929 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4312,7 +4325,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1926 + //line php5/php5.y:1948 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4329,7 +4342,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1941 + //line php5/php5.y:1963 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -4345,55 +4358,55 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1958 + //line php5/php5.y:1980 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1960 + //line php5/php5.y:1982 { yyVAL.list = []node.Node{yyDollar[1].node} } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1966 + //line php5/php5.y:1988 { yyVAL.list = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1968 + //line php5/php5.y:1990 { yyVAL.list = yyDollar[1].list } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1973 + //line php5/php5.y:1995 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1975 + //line php5/php5.y:1997 { yyVAL.list = []node.Node{yyDollar[1].node} } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1980 + //line php5/php5.y:2002 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1982 + //line php5/php5.y:2004 { yyVAL.list = yyDollar[1].list } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1987 + //line php5/php5.y:2009 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -4402,7 +4415,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1994 + //line php5/php5.y:2016 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -4411,37 +4424,37 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2004 + //line php5/php5.y:2026 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2006 + //line php5/php5.y:2028 { yyVAL.list = yyDollar[1].list } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2008 + //line php5/php5.y:2030 { yyVAL.list = yyDollar[1].list } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2013 + //line php5/php5.y:2035 { yyVAL.list = nil } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2015 + //line php5/php5.y:2037 { yyVAL.list = yyDollar[1].list } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2020 + //line php5/php5.y:2042 { if yyDollar[3].node != nil { @@ -4456,7 +4469,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:2036 + //line php5/php5.y:2058 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -4468,7 +4481,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2046 + //line php5/php5.y:2068 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4476,7 +4489,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2052 + //line php5/php5.y:2074 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4484,7 +4497,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:2058 + //line php5/php5.y:2080 { var _new *expr.New @@ -4503,7 +4516,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2075 + //line php5/php5.y:2097 { yyVAL.node = expr.NewClone(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4511,7 +4524,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2081 + //line php5/php5.y:2103 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4519,7 +4532,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2087 + //line php5/php5.y:2109 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4527,7 +4540,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2093 + //line php5/php5.y:2115 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4535,7 +4548,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2099 + //line php5/php5.y:2121 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4543,7 +4556,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2105 + //line php5/php5.y:2127 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4551,7 +4564,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2111 + //line php5/php5.y:2133 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4559,7 +4572,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2117 + //line php5/php5.y:2139 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4567,7 +4580,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2123 + //line php5/php5.y:2145 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4575,7 +4588,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2129 + //line php5/php5.y:2151 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4583,7 +4596,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2135 + //line php5/php5.y:2157 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4591,7 +4604,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2141 + //line php5/php5.y:2163 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4599,7 +4612,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2147 + //line php5/php5.y:2169 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4607,7 +4620,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2153 + //line php5/php5.y:2175 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4615,7 +4628,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2159 + //line php5/php5.y:2181 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4623,7 +4636,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2165 + //line php5/php5.y:2187 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4631,7 +4644,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2171 + //line php5/php5.y:2193 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4639,7 +4652,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2177 + //line php5/php5.y:2199 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4647,7 +4660,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2183 + //line php5/php5.y:2205 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4655,7 +4668,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2189 + //line php5/php5.y:2211 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4663,7 +4676,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2195 + //line php5/php5.y:2217 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4671,7 +4684,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2201 + //line php5/php5.y:2223 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4679,7 +4692,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2207 + //line php5/php5.y:2229 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4687,7 +4700,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2213 + //line php5/php5.y:2235 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4695,7 +4708,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2219 + //line php5/php5.y:2241 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4703,7 +4716,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2225 + //line php5/php5.y:2247 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4711,7 +4724,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2231 + //line php5/php5.y:2253 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4719,7 +4732,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2237 + //line php5/php5.y:2259 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4727,7 +4740,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2243 + //line php5/php5.y:2265 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4735,7 +4748,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2249 + //line php5/php5.y:2271 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4743,7 +4756,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2255 + //line php5/php5.y:2277 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4751,7 +4764,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2261 + //line php5/php5.y:2283 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4759,7 +4772,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2267 + //line php5/php5.y:2289 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4767,7 +4780,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2273 + //line php5/php5.y:2295 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4775,7 +4788,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2279 + //line php5/php5.y:2301 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4783,7 +4796,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2285 + //line php5/php5.y:2307 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4791,7 +4804,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2291 + //line php5/php5.y:2313 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4799,7 +4812,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2297 + //line php5/php5.y:2319 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4807,7 +4820,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2303 + //line php5/php5.y:2325 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4815,7 +4828,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2309 + //line php5/php5.y:2331 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4823,7 +4836,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2315 + //line php5/php5.y:2337 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4831,7 +4844,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2321 + //line php5/php5.y:2343 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4839,7 +4852,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2327 + //line php5/php5.y:2349 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4847,7 +4860,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2333 + //line php5/php5.y:2355 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4855,7 +4868,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2339 + //line php5/php5.y:2361 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4863,7 +4876,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2345 + //line php5/php5.y:2367 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4871,7 +4884,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2351 + //line php5/php5.y:2373 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4879,19 +4892,19 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2357 + //line php5/php5.y:2379 { yyVAL.node = yyDollar[1].node } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2359 + //line php5/php5.y:2381 { yyVAL.node = yyDollar[1].node } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2361 + //line php5/php5.y:2383 { yyVAL.node = yyDollar[2].node @@ -4919,7 +4932,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2387 + //line php5/php5.y:2409 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -4927,7 +4940,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2393 + //line php5/php5.y:2415 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4935,13 +4948,13 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2399 + //line php5/php5.y:2421 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2401 + //line php5/php5.y:2423 { yyVAL.node = cast.NewInt(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4949,7 +4962,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2407 + //line php5/php5.y:2429 { yyVAL.node = cast.NewDouble(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4957,7 +4970,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2413 + //line php5/php5.y:2435 { yyVAL.node = cast.NewString(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4965,7 +4978,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2419 + //line php5/php5.y:2441 { yyVAL.node = cast.NewArray(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4973,7 +4986,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2425 + //line php5/php5.y:2447 { yyVAL.node = cast.NewObject(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4981,7 +4994,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2431 + //line php5/php5.y:2453 { yyVAL.node = cast.NewBool(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4989,7 +5002,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2437 + //line php5/php5.y:2459 { yyVAL.node = cast.NewUnset(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4997,7 +5010,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2443 + //line php5/php5.y:2465 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -5009,7 +5022,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2453 + //line php5/php5.y:2475 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5017,25 +5030,25 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2459 + //line php5/php5.y:2481 { yyVAL.node = yyDollar[1].node } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2461 + //line php5/php5.y:2483 { yyVAL.node = yyDollar[1].node } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2463 + //line php5/php5.y:2485 { yyVAL.node = yyDollar[1].node } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2465 + //line php5/php5.y:2487 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5043,7 +5056,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2471 + //line php5/php5.y:2493 { yyVAL.node = expr.NewPrint(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5051,7 +5064,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2477 + //line php5/php5.y:2499 { yyVAL.node = expr.NewYield(nil, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5059,7 +5072,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:2483 + //line php5/php5.y:2505 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].list, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) @@ -5068,7 +5081,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:2490 + //line php5/php5.y:2512 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) @@ -5077,7 +5090,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2500 + //line php5/php5.y:2522 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5085,7 +5098,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2506 + //line php5/php5.y:2528 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5093,7 +5106,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2512 + //line php5/php5.y:2534 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5101,7 +5114,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2518 + //line php5/php5.y:2540 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5109,7 +5122,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2527 + //line php5/php5.y:2549 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5117,7 +5130,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2533 + //line php5/php5.y:2555 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5125,7 +5138,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2539 + //line php5/php5.y:2561 { str := scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(str, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5137,7 +5150,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2549 + //line php5/php5.y:2571 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5145,7 +5158,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2558 + //line php5/php5.y:2580 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5153,7 +5166,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2564 + //line php5/php5.y:2586 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5161,25 +5174,25 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2573 + //line php5/php5.y:2595 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2578 + //line php5/php5.y:2600 { yyVAL.list = []node.Node{} } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2580 + //line php5/php5.y:2602 { yyVAL.list = yyDollar[3].list } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2585 + //line php5/php5.y:2607 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5197,7 +5210,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2601 + //line php5/php5.y:2623 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -5215,7 +5228,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2617 + //line php5/php5.y:2639 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5233,7 +5246,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2633 + //line php5/php5.y:2655 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5251,7 +5264,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2652 + //line php5/php5.y:2674 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5263,7 +5276,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2662 + //line php5/php5.y:2684 { funcName := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5275,7 +5288,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2672 + //line php5/php5.y:2694 { funcName := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5287,7 +5300,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2682 + //line php5/php5.y:2704 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5295,7 +5308,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2688 + //line php5/php5.y:2710 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5303,7 +5316,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2694 + //line php5/php5.y:2716 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5311,7 +5324,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2700 + //line php5/php5.y:2722 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5319,7 +5332,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2706 + //line php5/php5.y:2728 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) @@ -5327,7 +5340,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2715 + //line php5/php5.y:2737 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5335,7 +5348,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2721 + //line php5/php5.y:2743 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5343,7 +5356,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2727 + //line php5/php5.y:2749 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5351,7 +5364,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2733 + //line php5/php5.y:2755 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5359,7 +5372,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2742 + //line php5/php5.y:2764 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5367,7 +5380,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2748 + //line php5/php5.y:2770 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5375,7 +5388,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2754 + //line php5/php5.y:2776 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5383,19 +5396,19 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2763 + //line php5/php5.y:2785 { yyVAL.node = yyDollar[1].node } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2765 + //line php5/php5.y:2787 { yyVAL.node = yyDollar[1].node } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2770 + //line php5/php5.y:2792 { yyVAL.node = yyDollar[1].node @@ -5433,79 +5446,79 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2806 + //line php5/php5.y:2828 { yyVAL.node = yyDollar[1].node } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2812 + //line php5/php5.y:2834 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2814 + //line php5/php5.y:2836 { yyVAL.list = []node.Node{} } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2820 + //line php5/php5.y:2842 { yyVAL.list = yyDollar[2].list } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2825 + //line php5/php5.y:2847 { yyVAL.node = nil } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2827 + //line php5/php5.y:2849 { yyVAL.node = nil } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2829 + //line php5/php5.y:2851 { yyVAL.node = yyDollar[1].node } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2834 + //line php5/php5.y:2856 { yyVAL.list = []node.Node{} } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2836 + //line php5/php5.y:2858 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2838 + //line php5/php5.y:2860 { yyVAL.list = yyDollar[1].list } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2843 + //line php5/php5.y:2865 { yyVAL.node = nil } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2845 + //line php5/php5.y:2867 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2850 + //line php5/php5.y:2872 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5513,7 +5526,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2856 + //line php5/php5.y:2878 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5521,7 +5534,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2862 + //line php5/php5.y:2884 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5529,7 +5542,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2868 + //line php5/php5.y:2890 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5537,7 +5550,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2874 + //line php5/php5.y:2896 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5545,7 +5558,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2880 + //line php5/php5.y:2902 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5553,7 +5566,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2886 + //line php5/php5.y:2908 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5561,7 +5574,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2892 + //line php5/php5.y:2914 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5569,7 +5582,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2898 + //line php5/php5.y:2920 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5577,7 +5590,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2904 + //line php5/php5.y:2926 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5585,7 +5598,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2910 + //line php5/php5.y:2932 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5597,7 +5610,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2920 + //line php5/php5.y:2942 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -5605,7 +5618,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2929 + //line php5/php5.y:2951 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5617,25 +5630,25 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2942 + //line php5/php5.y:2964 { yyVAL.node = yyDollar[1].node } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2947 + //line php5/php5.y:2969 { yyVAL.node = yyDollar[1].node } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2949 + //line php5/php5.y:2971 { yyVAL.node = yyDollar[1].node } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2951 + //line php5/php5.y:2973 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5647,7 +5660,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2961 + //line php5/php5.y:2983 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5659,7 +5672,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2971 + //line php5/php5.y:2993 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5671,7 +5684,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2981 + //line php5/php5.y:3003 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5679,7 +5692,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2987 + //line php5/php5.y:3009 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5687,13 +5700,13 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2993 + //line php5/php5.y:3015 { yyVAL.node = yyDollar[1].node } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2995 + //line php5/php5.y:3017 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5701,13 +5714,13 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3001 + //line php5/php5.y:3023 { yyVAL.node = yyDollar[1].node } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3006 + //line php5/php5.y:3028 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5715,7 +5728,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3012 + //line php5/php5.y:3034 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5723,7 +5736,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3018 + //line php5/php5.y:3040 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5731,7 +5744,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3024 + //line php5/php5.y:3046 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5739,7 +5752,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3030 + //line php5/php5.y:3052 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5747,7 +5760,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3036 + //line php5/php5.y:3058 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5755,7 +5768,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3042 + //line php5/php5.y:3064 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5763,7 +5776,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3048 + //line php5/php5.y:3070 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5771,7 +5784,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3054 + //line php5/php5.y:3076 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5779,7 +5792,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3060 + //line php5/php5.y:3082 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5787,7 +5800,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3066 + //line php5/php5.y:3088 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5795,7 +5808,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3072 + //line php5/php5.y:3094 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5803,7 +5816,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3078 + //line php5/php5.y:3100 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5811,7 +5824,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3084 + //line php5/php5.y:3106 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5819,7 +5832,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3090 + //line php5/php5.y:3112 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5827,7 +5840,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3096 + //line php5/php5.y:3118 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5835,7 +5848,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3102 + //line php5/php5.y:3124 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5843,7 +5856,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3108 + //line php5/php5.y:3130 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5851,7 +5864,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3114 + //line php5/php5.y:3136 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5859,7 +5872,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3120 + //line php5/php5.y:3142 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5867,7 +5880,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3126 + //line php5/php5.y:3148 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5875,7 +5888,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3132 + //line php5/php5.y:3154 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5883,7 +5896,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3138 + //line php5/php5.y:3160 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5891,7 +5904,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3144 + //line php5/php5.y:3166 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5899,7 +5912,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3150 + //line php5/php5.y:3172 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5907,7 +5920,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3156 + //line php5/php5.y:3178 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5915,7 +5928,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3162 + //line php5/php5.y:3184 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5923,7 +5936,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3168 + //line php5/php5.y:3190 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5931,7 +5944,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3174 + //line php5/php5.y:3196 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5939,7 +5952,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3180 + //line php5/php5.y:3202 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -5947,7 +5960,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3186 + //line php5/php5.y:3208 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5955,7 +5968,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3192 + //line php5/php5.y:3214 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5963,19 +5976,19 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3198 + //line php5/php5.y:3220 { yyVAL.node = yyDollar[2].node } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3203 + //line php5/php5.y:3225 { yyVAL.node = yyDollar[1].node } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3205 + //line php5/php5.y:3227 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5987,7 +6000,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3215 + //line php5/php5.y:3237 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5999,7 +6012,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3225 + //line php5/php5.y:3247 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -6011,7 +6024,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3238 + //line php5/php5.y:3260 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6023,25 +6036,25 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3248 + //line php5/php5.y:3270 { yyVAL.node = yyDollar[1].node } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3250 + //line php5/php5.y:3272 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3252 + //line php5/php5.y:3274 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3254 + //line php5/php5.y:3276 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6049,7 +6062,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3260 + //line php5/php5.y:3282 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6057,7 +6070,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3266 + //line php5/php5.y:3288 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6065,19 +6078,19 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3275 + //line php5/php5.y:3297 { yyVAL.list = nil } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3277 + //line php5/php5.y:3299 { yyVAL.list = yyDollar[1].list } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3287 + //line php5/php5.y:3309 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -6087,7 +6100,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3295 + //line php5/php5.y:3317 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6097,7 +6110,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3303 + //line php5/php5.y:3325 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6107,7 +6120,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3311 + //line php5/php5.y:3333 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6117,49 +6130,49 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3322 + //line php5/php5.y:3344 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3324 + //line php5/php5.y:3346 { yyVAL.node = yyDollar[1].node } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3329 + //line php5/php5.y:3351 { yyVAL.node = yyDollar[2].node } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3331 + //line php5/php5.y:3353 { yyVAL.node = yyDollar[2].node } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3337 + //line php5/php5.y:3359 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3343 + //line php5/php5.y:3365 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3348 + //line php5/php5.y:3370 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3353 + //line php5/php5.y:3375 { yyVAL.node = yyDollar[1].node @@ -6214,25 +6227,25 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3406 + //line php5/php5.y:3428 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3411 + //line php5/php5.y:3433 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3413 + //line php5/php5.y:3435 { yyVAL.list = []node.Node{} } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3419 + //line php5/php5.y:3441 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -6243,7 +6256,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3431 + //line php5/php5.y:3453 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6252,7 +6265,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3438 + //line php5/php5.y:3460 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6261,38 +6274,38 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3448 + //line php5/php5.y:3470 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3456 + //line php5/php5.y:3478 { yyVAL.list = []node.Node{yyDollar[1].node} } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3458 + //line php5/php5.y:3480 { yyVAL.list = yyDollar[1].list } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3460 + //line php5/php5.y:3482 { yyVAL.list = nil } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3465 + //line php5/php5.y:3487 { yyVAL.node = yyDollar[1].node } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3467 + //line php5/php5.y:3489 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6304,7 +6317,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3480 + //line php5/php5.y:3502 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6312,7 +6325,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3486 + //line php5/php5.y:3508 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6320,13 +6333,13 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3496 + //line php5/php5.y:3518 { yyVAL.node = yyDollar[1].node } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3501 + //line php5/php5.y:3523 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6334,7 +6347,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3507 + //line php5/php5.y:3529 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6342,31 +6355,31 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3515 + //line php5/php5.y:3537 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3516 + //line php5/php5.y:3538 { yyVAL.node = yyDollar[1].node } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3517 + //line php5/php5.y:3539 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3523 + //line php5/php5.y:3545 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3525 + //line php5/php5.y:3547 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6378,13 +6391,13 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3535 + //line php5/php5.y:3557 { yyVAL.node = yyDollar[1].node } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3540 + //line php5/php5.y:3562 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6392,7 +6405,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3546 + //line php5/php5.y:3568 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6400,13 +6413,13 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3552 + //line php5/php5.y:3574 { yyVAL.node = yyDollar[1].node } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3558 + //line php5/php5.y:3580 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6418,7 +6431,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3568 + //line php5/php5.y:3590 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6426,25 +6439,25 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3577 + //line php5/php5.y:3599 { yyVAL.node = nil } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3579 + //line php5/php5.y:3601 { yyVAL.node = yyDollar[1].node } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3585 + //line php5/php5.y:3607 { yyVAL.list = yyDollar[1].list } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3587 + //line php5/php5.y:3609 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6453,7 +6466,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3597 + //line php5/php5.y:3619 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6462,7 +6475,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3604 + //line php5/php5.y:3626 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6471,7 +6484,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3611 + //line php5/php5.y:3633 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6480,7 +6493,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3621 + //line php5/php5.y:3643 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6488,13 +6501,13 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3627 + //line php5/php5.y:3649 { yyVAL.node = yyDollar[2].node } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3632 + //line php5/php5.y:3654 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6504,7 +6517,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3640 + //line php5/php5.y:3662 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6518,13 +6531,13 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3655 + //line php5/php5.y:3677 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3657 + //line php5/php5.y:3679 { if yyDollar[1].node == nil { yyVAL.list = []node.Node{} @@ -6534,7 +6547,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3669 + //line php5/php5.y:3691 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6542,7 +6555,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3675 + //line php5/php5.y:3697 { item := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6554,25 +6567,25 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3685 + //line php5/php5.y:3707 { yyVAL.node = nil } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3691 + //line php5/php5.y:3713 { yyVAL.list = []node.Node{} } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3693 + //line php5/php5.y:3715 { yyVAL.list = yyDollar[1].list } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3698 + //line php5/php5.y:3720 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -6582,7 +6595,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3706 + //line php5/php5.y:3728 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6592,7 +6605,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3714 + //line php5/php5.y:3736 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6602,7 +6615,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3722 + //line php5/php5.y:3744 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6612,7 +6625,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3730 + //line php5/php5.y:3752 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[6].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) @@ -6622,7 +6635,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3738 + //line php5/php5.y:3760 { arrayItem := expr.NewArrayItem(nil, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) @@ -6632,7 +6645,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3746 + //line php5/php5.y:3768 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -6642,7 +6655,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3754 + //line php5/php5.y:3776 { arrayItem := expr.NewArrayItem(nil, yyDollar[2].node, true) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6652,13 +6665,13 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3765 + //line php5/php5.y:3787 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3767 + //line php5/php5.y:3789 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6667,13 +6680,13 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3774 + //line php5/php5.y:3796 { yyVAL.list = []node.Node{yyDollar[1].node} } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3776 + //line php5/php5.y:3798 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6682,7 +6695,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3786 + //line php5/php5.y:3808 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6694,7 +6707,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3796 + //line php5/php5.y:3818 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6709,7 +6722,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3809 + //line php5/php5.y:3831 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6727,7 +6740,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3825 + //line php5/php5.y:3847 { yyVAL.node = yyDollar[2].node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6735,7 +6748,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3831 + //line php5/php5.y:3853 { identifier := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6750,13 +6763,13 @@ yydefault: } case 500: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3845 + //line php5/php5.y:3867 { yyVAL.node = yyDollar[2].node } case 501: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3850 + //line php5/php5.y:3872 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6764,7 +6777,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3856 + //line php5/php5.y:3878 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -6778,7 +6791,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3868 + //line php5/php5.y:3890 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6790,7 +6803,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3881 + //line php5/php5.y:3903 { yyVAL.node = expr.NewIsset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6798,7 +6811,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3887 + //line php5/php5.y:3909 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6806,7 +6819,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3893 + //line php5/php5.y:3915 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6814,7 +6827,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3899 + //line php5/php5.y:3921 { yyVAL.node = expr.NewInclude(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6822,7 +6835,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3905 + //line php5/php5.y:3927 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6830,7 +6843,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3911 + //line php5/php5.y:3933 { yyVAL.node = expr.NewEval(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6838,7 +6851,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3917 + //line php5/php5.y:3939 { yyVAL.node = expr.NewRequire(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6846,7 +6859,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3923 + //line php5/php5.y:3945 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6854,31 +6867,31 @@ yydefault: } case 512: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3932 + //line php5/php5.y:3954 { yyVAL.list = []node.Node{yyDollar[1].node} } case 513: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3934 + //line php5/php5.y:3956 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 514: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3939 + //line php5/php5.y:3961 { yyVAL.node = yyDollar[1].node } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3941 + //line php5/php5.y:3963 { yyVAL.node = yyDollar[1].node } case 516: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3946 + //line php5/php5.y:3968 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6890,7 +6903,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3956 + //line php5/php5.y:3978 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6902,7 +6915,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3969 + //line php5/php5.y:3991 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6914,7 +6927,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3982 + //line php5/php5.y:4004 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) diff --git a/php5/php5.y b/php5/php5.y index d03a240..704f4a1 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -19,11 +19,15 @@ import ( %} %union{ - node node.Node - token *scanner.Token - list []node.Node - foreachVariable foreachVariable + node node.Node + token *scanner.Token + list []node.Node + foreachVariable foreachVariable simpleIndirectReference simpleIndirectReference + + ClassExtends *stmt.ClassExtends + ClassImplements *stmt.ClassImplements + InterfaceExtends *stmt.InterfaceExtends } %type $unk @@ -235,7 +239,7 @@ import ( %type exit_expr yield_expr function_declaration_statement class_declaration_statement constant_declaration %type else_single new_else_single unset_variable declare_statement %type finally_statement additional_catch unticked_function_declaration_statement unticked_class_declaration_statement -%type optional_class_type parameter class_entry_type extends_from class_statement class_constant_declaration +%type optional_class_type parameter class_entry_type class_statement class_constant_declaration %type trait_use_statement function_call_parameter trait_adaptation_statement trait_precedence trait_alias %type trait_method_reference_fully_qualified trait_method_reference trait_modifiers member_modifier method %type static_scalar_value static_operation @@ -244,13 +248,16 @@ import ( %type switch_case_list %type method_body %type foreach_statement for_statement while_statement +%type extends_from +%type implements_list +%type interface_extends_list %type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations %type inner_statement_list global_var_list static_var_list encaps_list isset_variables non_empty_array_pair_list %type array_pair_list assignment_list lexical_var_list lexical_vars elseif_list new_elseif_list non_empty_for_expr %type for_expr case_list echo_expr_list unset_variables declare_list catch_statement additional_catches -%type non_empty_additional_catches parameter_list non_empty_parameter_list class_statement_list implements_list -%type class_statement_list variable_modifiers method_modifiers class_variable_declaration interface_extends_list +%type non_empty_additional_catches parameter_list non_empty_parameter_list class_statement_list +%type class_statement_list variable_modifiers method_modifiers class_variable_declaration %type interface_list non_empty_function_call_parameter_list trait_list trait_adaptation_list non_empty_trait_adaptation_list %type trait_reference_list non_empty_member_modifiers backticks_expr static_array_pair_list non_empty_static_array_pair_list @@ -912,7 +919,7 @@ catch_statement: variable := expr.NewVariable(identifier) yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).comments.AddComments(variable, $4.Comments()) - + catch := stmt.NewCatch([]node.Node{$3}, variable, $7) yylex.(*Parser).positions.AddPosition(catch, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) yylex.(*Parser).comments.AddComments(catch, $1.Comments()) @@ -1085,7 +1092,12 @@ extends_from: /* empty */ { $$ = nil } | T_EXTENDS fully_qualified_class_name - { $$ = $2 } + { + $$ = stmt.NewClassExtends($2); + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + } ; interface_entry: @@ -1097,14 +1109,24 @@ interface_extends_list: /* empty */ { $$ = nil } | T_EXTENDS interface_list - { $$ = $2 } + { + $$ = stmt.NewInterfaceExtends($2); + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + } ; implements_list: /* empty */ { $$ = nil } | T_IMPLEMENTS interface_list - { $$ = $2 } + { + $$ = stmt.NewClassImplements($2); + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + } ; interface_list: diff --git a/php5/php5_test.go b/php5/php5_test.go index ca6338f..44de74c 100644 --- a/php5/php5_test.go +++ b/php5/php5_test.go @@ -852,20 +852,8 @@ func TestPhp5(t *testing.T) { Modifiers: []node.Node{ &node.Identifier{Value: "final"}, }, - Extends: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "bar"}, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, - Modifiers: []node.Node{ - &node.Identifier{Value: "final"}, - }, - Implements: []node.Node{ - &name.Name{ + Extends: &stmt.ClassExtends{ + ClassName: &name.Name{ Parts: []node.Node{ &name.NamePart{Value: "bar"}, }, @@ -878,15 +866,33 @@ func TestPhp5(t *testing.T) { Modifiers: []node.Node{ &node.Identifier{Value: "final"}, }, - Implements: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "bar"}, + Implements: &stmt.ClassImplements{ + InterfaceNames: []node.Node{ + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "bar"}, + }, }, }, - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "baz"}, + }, + Stmts: []node.Node{}, + }, + &stmt.Class{ + ClassName: &node.Identifier{Value: "foo"}, + Modifiers: []node.Node{ + &node.Identifier{Value: "final"}, + }, + Implements: &stmt.ClassImplements{ + InterfaceNames: []node.Node{ + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "bar"}, + }, + }, + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "baz"}, + }, }, }, }, @@ -1236,10 +1242,12 @@ func TestPhp5(t *testing.T) { &stmt.Interface{ PhpDocComment: "", InterfaceName: &node.Identifier{Value: "Foo"}, - Extends: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + Extends: &stmt.InterfaceExtends{ + InterfaceNames: []node.Node{ + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Bar"}, + }, }, }, }, @@ -1248,15 +1256,17 @@ func TestPhp5(t *testing.T) { &stmt.Interface{ PhpDocComment: "", InterfaceName: &node.Identifier{Value: "Foo"}, - Extends: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + Extends: &stmt.InterfaceExtends{ + InterfaceNames: []node.Node{ + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Bar"}, + }, }, - }, - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Baz"}, + }, }, }, }, diff --git a/php7/php7.go b/php7/php7.go index 5f0d217..f41d3b7 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -28,6 +28,10 @@ type yySymType struct { list []node.Node foreachVariable foreachVariable str string + + ClassExtends *stmt.ClassExtends + ClassImplements *stmt.ClassImplements + InterfaceExtends *stmt.InterfaceExtends } const T_INCLUDE = 57346 @@ -342,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:4286 +//line php7/php7.y:4281 type foreachVariable struct { node node.Node @@ -622,11 +626,11 @@ var yyAct = [...]int{ 758, 193, 232, 760, 187, 686, 763, 669, 670, 777, 671, 770, 1, 772, 766, 38, 797, 779, 798, 775, 579, 791, 546, 800, 787, 739, 134, 546, 546, 112, - 736, 737, 230, 381, 231, 663, 234, 531, 222, 810, - 527, 256, 257, 521, 738, 106, 860, 740, 818, 805, - 526, 256, 257, 367, 873, 824, 145, 792, 827, 142, - 806, 323, 817, 232, 823, 149, 719, 836, 660, 255, - 822, 834, 251, 639, 278, 255, 845, 928, 830, 645, + 736, 737, 230, 663, 231, 531, 234, 222, 521, 810, + 527, 256, 257, 860, 738, 106, 367, 740, 818, 805, + 526, 256, 257, 873, 145, 824, 792, 142, 827, 323, + 806, 149, 817, 232, 823, 836, 719, 660, 822, 255, + 251, 834, 381, 639, 278, 255, 845, 928, 830, 645, 422, 255, 840, 849, 224, 43, 282, 42, 16, 15, 851, 843, 599, 267, 546, 49, 546, 848, 745, 746, 747, 744, 743, 742, 853, 48, 867, 108, 671, 255, @@ -1429,17 +1433,17 @@ var yyPgo = [...]int{ 0, 897, 896, 51, 9, 895, 3, 29, 16, 894, 11, 31, 79, 78, 49, 45, 893, 21, 892, 73, - 19, 55, 891, 0, 80, 890, 889, 38, 141, 47, - 25, 887, 36, 886, 56, 62, 883, 10, 880, 879, - 872, 868, 13, 46, 866, 858, 100, 84, 199, 856, - 855, 853, 5, 852, 83, 40, 845, 138, 43, 840, - 837, 835, 825, 823, 119, 822, 819, 818, 817, 12, - 815, 814, 44, 42, 32, 2, 15, 629, 41, 74, - 812, 809, 807, 14, 806, 803, 8, 686, 20, 536, - 802, 121, 800, 798, 797, 71, 795, 33, 791, 789, - 30, 37, 787, 786, 28, 784, 783, 545, 776, 18, - 773, 768, 26, 767, 63, 1, 4, 765, 17, 763, - 39, 761, 760, 755, 7, 745, 6, 742, + 19, 55, 891, 0, 80, 890, 889, 38, 141, 25, + 887, 36, 886, 56, 62, 883, 10, 880, 879, 872, + 868, 13, 46, 866, 858, 100, 84, 199, 856, 855, + 853, 5, 852, 83, 40, 845, 138, 43, 840, 837, + 835, 825, 823, 119, 822, 819, 818, 817, 12, 815, + 814, 44, 42, 32, 2, 15, 629, 41, 74, 812, + 809, 807, 14, 806, 803, 47, 39, 802, 8, 686, + 20, 536, 800, 121, 798, 797, 795, 71, 791, 33, + 789, 787, 30, 37, 786, 784, 28, 783, 776, 545, + 773, 18, 768, 767, 26, 765, 63, 1, 4, 763, + 17, 761, 760, 755, 7, 745, 6, 742, } var yyR1 = [...]int{ @@ -1450,48 +1454,48 @@ var yyR1 = [...]int{ 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, 5, - 5, 5, 5, 5, 5, 5, 6, 6, 114, 114, - 91, 91, 10, 10, 10, 9, 9, 9, 9, 9, + 5, 5, 5, 5, 5, 5, 6, 6, 116, 116, + 93, 93, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 87, 87, 16, 16, 18, 18, 7, 7, 101, 101, - 100, 100, 107, 107, 17, 17, 20, 20, 19, 19, - 95, 95, 115, 115, 22, 22, 22, 22, 22, 22, + 89, 89, 16, 16, 18, 18, 7, 7, 103, 103, + 102, 102, 109, 109, 17, 17, 20, 20, 19, 19, + 97, 97, 117, 117, 22, 22, 22, 22, 22, 22, 22, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 93, 93, 92, 92, 26, - 26, 106, 106, 27, 12, 1, 1, 2, 2, 13, - 13, 125, 125, 77, 77, 14, 15, 29, 29, 119, - 119, 120, 120, 88, 88, 88, 88, 84, 84, 83, - 83, 25, 25, 81, 81, 81, 81, 104, 104, 104, - 8, 8, 85, 85, 68, 68, 66, 66, 70, 70, - 67, 67, 116, 116, 117, 117, 30, 30, 31, 31, - 76, 76, 74, 74, 74, 75, 75, 78, 78, 113, - 113, 32, 32, 99, 99, 34, 103, 103, 35, 35, - 118, 118, 36, 36, 36, 36, 124, 124, 80, 80, - 80, 105, 105, 37, 37, 38, 39, 39, 39, 39, - 41, 41, 40, 82, 82, 122, 122, 121, 121, 123, - 123, 86, 86, 86, 86, 86, 86, 102, 102, 42, - 42, 94, 94, 69, 21, 96, 96, 43, 97, 97, - 98, 98, 45, 44, 44, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 126, 3, 3, 109, 109, 108, 108, 52, 52, - 53, 53, 53, 53, 46, 46, 47, 47, 50, 50, - 90, 90, 90, 79, 79, 57, 57, 57, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 58, 58, 58, 23, 23, 24, - 24, 56, 59, 59, 59, 60, 60, 60, 61, 61, - 61, 61, 61, 61, 28, 28, 28, 48, 48, 48, - 62, 62, 63, 63, 63, 63, 63, 63, 54, 54, - 54, 55, 55, 55, 112, 72, 72, 111, 111, 71, - 71, 71, 71, 71, 71, 89, 89, 89, 89, 64, - 64, 64, 64, 64, 64, 64, 65, 65, 65, 65, - 49, 49, 49, 49, 49, 49, 49, 110, 110, 73, + 11, 11, 11, 11, 11, 95, 95, 94, 94, 26, + 26, 108, 108, 27, 12, 1, 1, 2, 2, 13, + 13, 125, 125, 76, 76, 14, 15, 85, 85, 87, + 87, 86, 86, 90, 90, 90, 90, 83, 83, 82, + 82, 25, 25, 80, 80, 80, 80, 106, 106, 106, + 8, 8, 84, 84, 67, 67, 65, 65, 69, 69, + 66, 66, 118, 118, 119, 119, 29, 29, 30, 30, + 75, 75, 73, 73, 73, 74, 74, 77, 77, 115, + 115, 31, 31, 101, 101, 33, 105, 105, 34, 34, + 120, 120, 35, 35, 35, 35, 124, 124, 79, 79, + 79, 107, 107, 36, 36, 37, 38, 38, 38, 38, + 40, 40, 39, 81, 81, 122, 122, 121, 121, 123, + 123, 88, 88, 88, 88, 88, 88, 104, 104, 41, + 41, 96, 96, 68, 21, 98, 98, 42, 99, 99, + 100, 100, 44, 43, 43, 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, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 126, 3, 3, 111, 111, 110, 110, 51, 51, + 52, 52, 52, 52, 45, 45, 46, 46, 49, 49, + 92, 92, 92, 78, 78, 56, 56, 56, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 57, 57, 57, 23, 23, 24, + 24, 55, 58, 58, 58, 59, 59, 59, 60, 60, + 60, 60, 60, 60, 28, 28, 28, 47, 47, 47, + 61, 61, 62, 62, 62, 62, 62, 62, 53, 53, + 53, 54, 54, 54, 114, 71, 71, 113, 113, 70, + 70, 70, 70, 70, 70, 91, 91, 91, 91, 63, + 63, 63, 63, 63, 63, 63, 64, 64, 64, 64, + 48, 48, 48, 48, 48, 48, 48, 112, 112, 72, } var yyR2 = [...]int{ @@ -1547,50 +1551,50 @@ var yyR2 = [...]int{ } var yyChk = [...]int{ - -1000, -127, -114, -9, 2, -11, -12, -13, -14, -15, - 51, 79, 44, 38, 142, -66, -67, 21, 20, 23, + -1000, -127, -116, -9, 2, -11, -12, -13, -14, -15, + 51, 79, 44, 38, 142, -65, -66, 21, 20, 23, 30, 34, 35, 39, 46, 98, 19, 14, -23, 48, 25, 27, 144, 40, 43, 36, 10, 37, -125, 52, - 53, 54, -68, -70, -28, -33, -77, 7, -61, -62, - -59, 59, 148, 92, 104, 105, 153, 152, 154, 155, - 146, -44, -49, 107, 108, 109, 110, 111, 112, 113, - 6, 156, -51, 141, 96, 97, 106, 99, 100, -48, - -58, -53, -46, -56, -57, 91, 49, 50, 4, 5, + 53, 54, -67, -69, -28, -32, -76, 7, -60, -61, + -58, 59, 148, 92, 104, 105, 153, 152, 154, 155, + 146, -43, -48, 107, 108, 109, 110, 111, 112, 113, + 6, 156, -50, 141, 96, 97, 106, 99, 100, -47, + -57, -52, -45, -55, -56, 91, 49, 50, 4, 5, 84, 85, 86, 8, 9, 66, 67, 81, 63, 64, - 65, 80, 62, 74, 140, 12, 157, -10, -60, 60, - 18, -91, 82, 146, 82, -91, 142, 10, -18, -87, - -107, -91, 82, 37, 38, -19, -20, -95, -21, 10, - -115, 146, -11, 37, 79, 146, 146, -24, -23, 98, - -24, -24, -99, -34, -48, -103, 37, -35, 12, -96, - -43, -23, 144, 129, 130, 87, 89, 88, 159, 151, + 65, 80, 62, 74, 140, 12, 157, -10, -59, 60, + 18, -93, 82, 146, 82, -93, 142, 10, -18, -89, + -109, -93, 82, 37, 38, -19, -20, -97, -21, 10, + -117, 146, -11, 37, 79, 146, 146, -24, -23, 98, + -24, -24, -101, -33, -47, -105, 37, -34, 12, -98, + -42, -23, 144, 129, 130, 87, 89, 88, 159, 151, 161, 167, 153, 152, 162, 131, 163, 164, 132, 133, 134, 135, 136, 137, 165, 138, 166, 139, 115, 90, 150, 114, 146, 146, 146, 142, -23, 10, 145, -3, - 151, 52, -77, 10, 10, 10, 93, 94, 93, 95, + 151, 52, -76, 10, 10, 10, 93, 94, 93, 95, 94, 160, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 104, 105, 146, 148, 142, 57, - 146, -112, -111, -72, -71, -23, 151, 59, -23, -28, - -58, 146, -57, 98, 148, -28, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -50, 146, - -23, -90, 17, -89, -64, 12, 76, 77, -23, -23, - -23, 148, 78, 78, -47, -45, -46, -63, 52, -10, - -48, 146, 146, -23, -23, 146, -23, -23, 17, 75, - -89, -89, 17, 142, -48, -78, 146, -78, 146, 82, - -91, 147, -91, 144, 142, -114, 144, -16, -107, -91, - 82, 144, 158, 82, 29, -91, -20, 144, 158, 160, + 146, -114, -113, -71, -70, -23, 151, 59, -23, -28, + -57, 146, -56, 98, 148, -28, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23, -23, -49, 146, + -23, -92, 17, -91, -63, 12, 76, 77, -23, -23, + -23, 148, 78, 78, -46, -44, -45, -62, 52, -10, + -47, 146, 146, -23, -23, 146, -23, -23, 17, 75, + -91, -91, 17, 142, -47, -77, 146, -77, 146, 82, + -93, 147, -93, 144, 142, -116, 144, -16, -109, -93, + 82, 144, 158, 82, 29, -93, -20, 144, 158, 160, -22, 143, 2, -11, -12, -13, -14, -15, 51, -23, - 21, -3, -97, -98, -23, -23, 144, 144, 144, 144, + 21, -3, -99, -100, -23, -23, 144, 144, 144, 144, 158, 144, 158, -3, 160, 144, 158, -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, -47, -23, 145, -23, -106, -27, -28, - -23, -95, -115, 144, 144, 10, -126, 10, -29, 55, - -126, -119, 55, 146, -11, 146, 144, 145, -23, 151, + -23, -23, -23, -46, -23, 145, -23, -108, -27, -28, + -23, -97, -117, 144, 144, 10, -126, 10, -85, 55, + -126, -87, 55, 146, -11, 146, 144, 145, -23, 151, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -24, -23, -55, 10, 142, -48, -112, - 149, 158, 58, -28, 146, -23, -112, 147, -24, 141, - -64, -64, 17, 148, 57, -23, 11, -28, 58, -24, - -54, -6, -48, 142, 10, -5, -4, 98, 99, 100, + -23, -23, -23, -24, -23, -54, 10, 142, -47, -114, + 149, 158, 58, -28, 146, -23, -114, 147, -24, 141, + -63, -63, 17, 148, 57, -23, 11, -28, 58, -24, + -53, -6, -47, 142, 10, -5, -4, 98, 99, 100, 101, 102, 103, 4, 5, 84, 85, 86, 87, 88, 89, 90, 91, 92, 6, 7, 93, 94, 95, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, @@ -1598,49 +1602,49 @@ var yyChk = [...]int{ 50, 35, 36, 37, 38, 39, 96, 97, 59, 30, 31, 32, 33, 34, 60, 61, 55, 56, 79, 53, 54, 52, 62, 63, 65, 64, 66, 67, 81, 80, - -54, -6, -48, -79, -78, 78, 148, 142, 57, 78, - -79, -110, -73, -23, -23, -23, 75, 75, 140, -23, - 147, -113, -32, -23, 83, -112, 10, 144, -114, 143, - 144, 144, 82, -91, -19, 82, -91, 142, 10, 82, - -21, -23, 146, 147, 146, 144, 158, 147, -34, -35, - -126, -23, -43, 145, -23, -7, 158, 29, 147, 143, - -126, 146, -29, -120, 56, -10, 142, -126, -124, -10, - -23, -23, -115, -23, 147, 149, 143, -78, -23, 147, - 160, -72, -23, 151, 59, -112, 147, 149, 147, -65, + -53, -6, -47, -78, -77, 78, 148, 142, 57, 78, + -78, -112, -72, -23, -23, -23, 75, 75, 140, -23, + 147, -115, -31, -23, 83, -114, 10, 144, -116, 143, + 144, 144, 82, -93, -19, 82, -93, 142, 10, 82, + -21, -23, 146, 147, 146, 144, 158, 147, -33, -34, + -126, -23, -42, 145, -23, -7, 158, 29, 147, 143, + -126, 146, -85, -86, 56, -10, 142, -126, -124, -10, + -23, -23, -117, -23, 147, 149, 143, -77, -23, 147, + 160, -71, -23, 151, 59, -114, 147, 149, 147, -64, 10, 13, 152, 12, 10, 143, 143, 148, 143, -23, - 149, -78, -23, -78, -48, -24, -23, -55, -48, -29, + 149, -77, -23, -77, -47, -24, -23, -54, -47, -85, -7, 158, 147, 147, 143, -7, 158, -23, 147, 143, - 142, 82, -101, -17, -20, -87, 142, -126, 147, -85, - -11, 145, -23, -97, -23, -81, 142, 145, 146, -23, - 147, -27, -88, -28, 151, 59, 148, -25, -11, 145, - -93, 146, -116, -117, -30, -31, -76, -74, 150, 60, - 61, -10, -120, -126, -124, -118, 142, 158, 147, 147, + 142, 82, -103, -17, -20, -89, 142, -126, 147, -84, + -11, 145, -23, -99, -23, -80, 142, 145, 146, -23, + 147, -27, -90, -28, 151, 59, 148, -25, -11, 145, + -95, 146, -118, -119, -29, -30, -75, -73, 150, 60, + 61, -10, -86, -126, -124, -120, 142, 158, 147, 147, 95, -11, 145, 143, 160, -23, -28, 146, 147, 149, - 13, -23, 143, 149, 143, -120, 147, -73, 147, -32, - -100, -20, 142, -7, 158, -20, -101, 144, -115, 147, - 144, -104, 144, -104, 144, -116, 144, 147, 58, -28, - 146, -112, -115, -26, 41, 42, -116, 147, 158, -1, - 151, -74, -126, 142, 143, -36, -122, -121, 44, -123, - 47, -86, 103, 102, 101, 98, 99, 100, -118, -10, - -11, 145, 144, -115, -23, -112, 149, -126, -7, 158, - -100, 143, -17, -7, 22, 144, -97, 143, 32, 33, - -104, 31, -104, 147, -83, -11, 145, -88, -28, -112, - 149, 28, 146, 142, 147, -109, 44, -30, -2, 83, - 142, -118, -102, -42, 12, 38, 37, -124, -86, 143, - -115, 147, 143, 142, 143, -20, -7, 143, 144, 147, - -23, -8, 145, 144, 143, 144, 31, -109, -115, 147, - 147, 144, -92, -10, -115, -75, 145, -75, 146, 12, - -118, 143, 144, 158, -126, 160, -94, -69, -6, -3, - -80, 144, 142, -118, 143, -84, -11, 145, -8, -115, - 144, -75, 26, -83, 12, 159, 143, 142, -76, 142, - -108, -52, 12, 151, 160, 143, -42, -23, 144, 158, - 160, -6, 143, -105, -37, -38, -39, -40, -41, -10, - -6, 79, 10, 143, -115, -115, 142, 144, 147, -10, - -115, -115, 147, 158, 12, -23, -126, -69, -23, -126, - 143, -37, 144, 144, 45, 29, 78, 24, -115, 142, - 143, 143, -52, -126, 146, -124, 10, -4, -86, -6, - 144, 143, -115, -116, -6, 143, 147, -75, -82, 144, - 142, -115, 143, + 13, -23, 143, 149, 143, -86, 147, -72, 147, -31, + -102, -20, 142, -7, 158, -20, -103, 144, -117, 147, + 144, -106, 144, -106, 144, -118, 144, 147, 58, -28, + 146, -114, -117, -26, 41, 42, -118, 147, 158, -1, + 151, -73, -126, 142, 143, -35, -122, -121, 44, -123, + 47, -88, 103, 102, 101, 98, 99, 100, -120, -10, + -11, 145, 144, -117, -23, -114, 149, -126, -7, 158, + -102, 143, -17, -7, 22, 144, -99, 143, 32, 33, + -106, 31, -106, 147, -82, -11, 145, -90, -28, -114, + 149, 28, 146, 142, 147, -111, 44, -29, -2, 83, + 142, -120, -104, -41, 12, 38, 37, -124, -88, 143, + -117, 147, 143, 142, 143, -20, -7, 143, 144, 147, + -23, -8, 145, 144, 143, 144, 31, -111, -117, 147, + 147, 144, -94, -10, -117, -74, 145, -74, 146, 12, + -120, 143, 144, 158, -126, 160, -96, -68, -6, -3, + -79, 144, 142, -120, 143, -83, -11, 145, -8, -117, + 144, -74, 26, -82, 12, 159, 143, 142, -75, 142, + -110, -51, 12, 151, 160, 143, -41, -23, 144, 158, + 160, -6, 143, -107, -36, -37, -38, -39, -40, -10, + -6, 79, 10, 143, -117, -117, 142, 144, 147, -10, + -117, -117, 147, 158, 12, -23, -126, -68, -23, -126, + 143, -36, 144, 144, 45, 29, 78, 24, -117, 142, + 143, 143, -51, -126, 146, -124, 10, -4, -88, -6, + 144, 143, -117, -118, -6, 143, 147, -74, -81, 144, + 142, -117, 143, } var yyDef = [...]int{ @@ -2115,7 +2119,7 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:292 + //line php7/php7.y:299 { yylex.(*Parser).rootNode = node.NewRoot(yyDollar[1].list) @@ -2124,463 +2128,463 @@ yydefault: } case 2: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 3: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 5: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:301 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 10: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 11: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 12: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 13: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 14: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 15: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 16: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 17: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 18: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 21: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:302 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 22: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 23: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 24: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 27: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 28: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 29: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 30: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:303 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 33: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 34: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 35: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 36: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 37: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 38: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 39: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:304 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 44: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 46: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 47: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 48: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 49: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 50: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 51: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 52: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:305 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 53: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 54: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 55: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 56: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 57: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 58: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 59: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 60: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:306 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 61: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 62: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 63: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 64: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 66: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 67: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 68: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 69: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 70: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 72: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 73: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 74: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 75: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 76: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:318 + //line php7/php7.y:325 { yyVAL.token = yyDollar[1].token } case 77: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:327 { yyVAL.token = yyDollar[1].token } case 78: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:325 + //line php7/php7.y:332 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2588,13 +2592,13 @@ yydefault: } case 79: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:331 + //line php7/php7.y:338 { yyVAL.list = []node.Node{} } case 80: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:336 + //line php7/php7.y:343 { namePart := name.NewNamePart(yyDollar[1].token.Value) yyVAL.list = []node.Node{namePart} @@ -2607,7 +2611,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:347 + //line php7/php7.y:354 { namePart := name.NewNamePart(yyDollar[3].token.Value) yyVAL.list = append(yyDollar[1].list, namePart) @@ -2621,7 +2625,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:362 + //line php7/php7.y:369 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -2630,7 +2634,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:369 + //line php7/php7.y:376 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -2643,7 +2647,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:380 + //line php7/php7.y:387 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -2655,44 +2659,44 @@ yydefault: } case 85: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:393 + //line php7/php7.y:400 { // error yyVAL.node = nil } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:398 + //line php7/php7.y:405 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:400 + //line php7/php7.y:407 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:402 + //line php7/php7.y:409 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:404 + //line php7/php7.y:411 { yyVAL.node = yyDollar[1].node } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:406 + //line php7/php7.y:413 { yyVAL.node = yyDollar[1].node } case 91: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:408 + //line php7/php7.y:415 { yyVAL.node = stmt.NewHaltCompiler() @@ -2707,7 +2711,7 @@ yydefault: } case 92: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:421 + //line php7/php7.y:428 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2722,7 +2726,7 @@ yydefault: } case 93: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:434 + //line php7/php7.y:441 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2738,7 +2742,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:448 + //line php7/php7.y:455 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2752,7 +2756,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:460 + //line php7/php7.y:467 { yyVAL.node = yyDollar[2].node @@ -2765,7 +2769,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:471 + //line php7/php7.y:478 { yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) @@ -2778,7 +2782,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:482 + //line php7/php7.y:489 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2791,7 +2795,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:493 + //line php7/php7.y:500 { yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) @@ -2804,7 +2808,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:504 + //line php7/php7.y:511 { yyVAL.node = stmt.NewConstList(yyDollar[2].list) @@ -2817,7 +2821,7 @@ yydefault: } case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:518 + //line php7/php7.y:525 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2829,7 +2833,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:528 + //line php7/php7.y:535 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2841,7 +2845,7 @@ yydefault: } case 102: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:541 + //line php7/php7.y:548 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2860,7 +2864,7 @@ yydefault: } case 103: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:558 + //line php7/php7.y:565 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2880,7 +2884,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:579 + //line php7/php7.y:586 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2899,7 +2903,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:596 + //line php7/php7.y:603 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2919,19 +2923,19 @@ yydefault: } case 106: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:617 + //line php7/php7.y:624 { yyVAL.token = nil } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:619 + //line php7/php7.y:626 { yyVAL.token = yyDollar[1].token } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:624 + //line php7/php7.y:631 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2940,13 +2944,13 @@ yydefault: } case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:631 + //line php7/php7.y:638 { yyVAL.list = []node.Node{yyDollar[1].node} } case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:636 + //line php7/php7.y:643 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2955,13 +2959,13 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:643 + //line php7/php7.y:650 { yyVAL.list = []node.Node{yyDollar[1].node} } case 112: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:648 + //line php7/php7.y:655 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2970,25 +2974,25 @@ yydefault: } case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:655 + //line php7/php7.y:662 { yyVAL.list = []node.Node{yyDollar[1].node} } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:660 + //line php7/php7.y:667 { yyVAL.node = yyDollar[1].node } case 115: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:662 + //line php7/php7.y:669 { yyVAL.node = yyDollar[2].node.(*stmt.Use).SetUseType(yyDollar[1].node) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:667 + //line php7/php7.y:674 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2999,7 +3003,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:676 + //line php7/php7.y:683 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -3016,13 +3020,13 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:694 + //line php7/php7.y:701 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:696 + //line php7/php7.y:703 { yyVAL.node = yyDollar[2].node @@ -3031,7 +3035,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:706 + //line php7/php7.y:713 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3040,13 +3044,13 @@ yydefault: } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:713 + //line php7/php7.y:720 { yyVAL.list = []node.Node{yyDollar[1].node} } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:718 + //line php7/php7.y:725 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3054,50 +3058,50 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:724 + //line php7/php7.y:731 { yyVAL.list = []node.Node{} } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:729 + //line php7/php7.y:736 { // error yyVAL.node = nil } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:734 + //line php7/php7.y:741 { yyVAL.node = yyDollar[1].node } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:736 + //line php7/php7.y:743 { yyVAL.node = yyDollar[1].node } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:738 + //line php7/php7.y:745 { yyVAL.node = yyDollar[1].node } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:740 + //line php7/php7.y:747 { yyVAL.node = yyDollar[1].node } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:742 + //line php7/php7.y:749 { yyVAL.node = yyDollar[1].node } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:744 + //line php7/php7.y:751 { yyVAL.node = stmt.NewHaltCompiler() @@ -3112,7 +3116,7 @@ yydefault: } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:759 + //line php7/php7.y:766 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3125,19 +3129,19 @@ yydefault: } case 132: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:770 + //line php7/php7.y:777 { yyVAL.node = yyDollar[1].node } case 133: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:772 + //line php7/php7.y:779 { yyVAL.node = yyDollar[1].node } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:774 + //line php7/php7.y:781 { switch n := yyDollar[5].node.(type) { case *stmt.While: @@ -3158,7 +3162,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:793 + //line php7/php7.y:800 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) @@ -3174,7 +3178,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:807 + //line php7/php7.y:814 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -3201,7 +3205,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:832 + //line php7/php7.y:839 { switch n := yyDollar[5].node.(type) { case *stmt.Switch: @@ -3224,7 +3228,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:853 + //line php7/php7.y:860 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3237,7 +3241,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:864 + //line php7/php7.y:871 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3250,7 +3254,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:875 + //line php7/php7.y:882 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3263,7 +3267,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:886 + //line php7/php7.y:893 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3276,7 +3280,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:897 + //line php7/php7.y:904 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3289,7 +3293,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:908 + //line php7/php7.y:915 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3302,7 +3306,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:919 + //line php7/php7.y:926 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3314,7 +3318,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:929 + //line php7/php7.y:936 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3326,7 +3330,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:939 + //line php7/php7.y:946 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3344,7 +3348,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:955 + //line php7/php7.y:962 { switch n := yyDollar[7].node.(type) { case *stmt.Foreach: @@ -3370,7 +3374,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:979 + //line php7/php7.y:986 { switch n := yyDollar[9].node.(type) { case *stmt.Foreach: @@ -3399,7 +3403,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1006 + //line php7/php7.y:1013 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) @@ -3413,7 +3417,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1018 + //line php7/php7.y:1025 { yyVAL.node = stmt.NewNop() @@ -3425,7 +3429,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1028 + //line php7/php7.y:1035 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3442,7 +3446,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1043 + //line php7/php7.y:1050 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3455,7 +3459,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1054 + //line php7/php7.y:1061 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3471,7 +3475,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1068 + //line php7/php7.y:1075 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -3486,13 +3490,13 @@ yydefault: } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1083 + //line php7/php7.y:1090 { yyVAL.list = []node.Node{} } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1085 + //line php7/php7.y:1092 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[5].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -3514,13 +3518,13 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1107 + //line php7/php7.y:1114 { yyVAL.list = []node.Node{yyDollar[1].node} } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1109 + //line php7/php7.y:1116 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3529,13 +3533,13 @@ yydefault: } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1119 + //line php7/php7.y:1126 { yyVAL.node = nil } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1121 + //line php7/php7.y:1128 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3549,13 +3553,13 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1136 + //line php7/php7.y:1143 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1138 + //line php7/php7.y:1145 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3564,13 +3568,13 @@ yydefault: } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1148 + //line php7/php7.y:1155 { yyVAL.node = yyDollar[1].node } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1153 + //line php7/php7.y:1160 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) @@ -3592,34 +3596,34 @@ yydefault: } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1177 + //line php7/php7.y:1184 { yyVAL.token = nil } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1179 + //line php7/php7.y:1186 { yyVAL.token = yyDollar[1].token } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1184 + //line php7/php7.y:1191 { yyVAL.token = nil } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1186 + //line php7/php7.y:1193 { yyVAL.token = yyDollar[1].token } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1191 + //line php7/php7.y:1198 { name := node.NewIdentifier(yyDollar[3].token.Value) - yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].node, yyDollar[5].list, yyDollar[8].list, yyDollar[6].str) + yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].ClassExtends, yyDollar[5].ClassImplements, yyDollar[8].list, yyDollar[6].str) // save position yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3628,21 +3632,15 @@ yydefault: // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ClassToken) yylex.(*Parser).comments.AddFromToken(name, yyDollar[3].token, comment.StringToken) - if yyDollar[4].node != nil { - yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, yyDollar[4].node) - } - if yyDollar[5].list != nil { - yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, firstNode(yyDollar[5].list)) - } yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.OpenCurlyBracesToken) yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[9].token, comment.CloseCurlyBracesToken) } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1212 + //line php7/php7.y:1213 { name := node.NewIdentifier(yyDollar[2].token.Value) - yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) + yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) // save position yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3651,30 +3649,24 @@ yydefault: // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassToken) yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringToken) - if yyDollar[3].node != nil { - yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, yyDollar[3].node) - } - if yyDollar[4].list != nil { - yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, firstNode(yyDollar[4].list)) - } yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.OpenCurlyBracesToken) yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseCurlyBracesToken) } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1236 + //line php7/php7.y:1231 { yyVAL.list = []node.Node{yyDollar[1].node} } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1238 + //line php7/php7.y:1233 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1243 + //line php7/php7.y:1238 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3686,7 +3678,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1253 + //line php7/php7.y:1248 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3698,7 +3690,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1266 + //line php7/php7.y:1261 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3715,10 +3707,10 @@ yydefault: } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1284 + //line php7/php7.y:1279 { name := node.NewIdentifier(yyDollar[2].token.Value) - yyVAL.node = stmt.NewInterface(name, yyDollar[3].list, yyDollar[6].list, yyDollar[4].str) + yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[6].list, yyDollar[4].str) // save position yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3727,66 +3719,72 @@ yydefault: // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.InterfaceToken) yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringToken) - if yyDollar[3].list != nil { - yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, firstNode(yyDollar[3].list)) - } yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.OpenCurlyBracesToken) yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseCurlyBracesToken) } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1305 + //line php7/php7.y:1297 { - yyVAL.node = nil + yyVAL.ClassExtends = nil } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1307 + //line php7/php7.y:1299 { - yyVAL.node = yyDollar[2].node + yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.ClassExtends, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ExtendsToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.ClassExtends, yyDollar[1].token, comment.ExtendsToken) } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1317 + //line php7/php7.y:1312 { - yyVAL.list = nil + yyVAL.InterfaceExtends = nil } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1319 + //line php7/php7.y:1314 { - yyVAL.list = yyDollar[2].list + yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.InterfaceExtends, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yylex.(*Parser).comments.AddFromToken(firstNode(yyVAL.list), yyDollar[1].token, comment.ExtendsToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.InterfaceExtends, yyDollar[1].token, comment.ExtendsToken) } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1329 + //line php7/php7.y:1327 { - yyVAL.list = nil + yyVAL.ClassImplements = nil } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1331 + //line php7/php7.y:1329 { - yyVAL.list = yyDollar[2].list + yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.ClassImplements, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) // save comments - yylex.(*Parser).comments.AddFromToken(firstNode(yyVAL.list), yyDollar[1].token, comment.ImplementsToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.ClassImplements, yyDollar[1].token, comment.ImplementsToken) } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1341 + //line php7/php7.y:1342 { yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1343 + //line php7/php7.y:1344 { yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} @@ -3798,7 +3796,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1353 + //line php7/php7.y:1354 { list := expr.NewList(yyDollar[3].list) yyVAL.foreachVariable = foreachVariable{list, false} @@ -3813,7 +3811,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1366 + //line php7/php7.y:1367 { list := expr.NewShortList(yyDollar[2].list) yyVAL.foreachVariable = foreachVariable{list, false} @@ -3827,7 +3825,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1381 + //line php7/php7.y:1382 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -3836,7 +3834,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1388 + //line php7/php7.y:1389 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -3852,7 +3850,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1405 + //line php7/php7.y:1406 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node, false) @@ -3861,7 +3859,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1412 + //line php7/php7.y:1413 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList, false) @@ -3877,13 +3875,13 @@ yydefault: } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1429 + //line php7/php7.y:1430 { yyVAL.node = yyDollar[1].node } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1431 + //line php7/php7.y:1432 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3897,7 +3895,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1446 + //line php7/php7.y:1447 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3912,7 +3910,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1459 + //line php7/php7.y:1460 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3928,7 +3926,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1473 + //line php7/php7.y:1474 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -3944,7 +3942,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1487 + //line php7/php7.y:1488 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -3962,13 +3960,13 @@ yydefault: } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1506 + //line php7/php7.y:1507 { yyVAL.list = []node.Node{} } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1508 + //line php7/php7.y:1509 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -3982,7 +3980,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1520 + //line php7/php7.y:1521 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -3996,19 +3994,19 @@ yydefault: } case 200: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1535 + //line php7/php7.y:1536 { yyVAL.token = yyDollar[1].token } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1537 + //line php7/php7.y:1538 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1542 + //line php7/php7.y:1543 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4017,7 +4015,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1549 + //line php7/php7.y:1550 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4033,7 +4031,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1566 + //line php7/php7.y:1567 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -4047,7 +4045,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1578 + //line php7/php7.y:1579 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -4063,13 +4061,13 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1595 + //line php7/php7.y:1596 { yyVAL.node = yyDollar[1].node } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1597 + //line php7/php7.y:1598 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4083,7 +4081,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1612 + //line php7/php7.y:1613 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4100,7 +4098,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1627 + //line php7/php7.y:1628 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4118,7 +4116,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1646 + //line php7/php7.y:1647 { yyVAL.node = yyDollar[1].node @@ -4131,7 +4129,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1657 + //line php7/php7.y:1658 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4150,25 +4148,25 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1677 + //line php7/php7.y:1678 { yyVAL.list = yyDollar[1].list } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1679 + //line php7/php7.y:1680 { yyVAL.list = nil } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1684 + //line php7/php7.y:1685 { yyVAL.list = []node.Node{yyDollar[1].node} } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1686 + //line php7/php7.y:1687 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4177,7 +4175,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1696 + //line php7/php7.y:1697 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4216,7 +4214,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1733 + //line php7/php7.y:1734 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4255,25 +4253,25 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1773 + //line php7/php7.y:1774 { yyVAL.node = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1775 + //line php7/php7.y:1776 { yyVAL.node = yyDollar[1].node } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1780 + //line php7/php7.y:1781 { yyVAL.node = yyDollar[1].node } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1782 + //line php7/php7.y:1783 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4285,7 +4283,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1795 + //line php7/php7.y:1796 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4297,7 +4295,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1805 + //line php7/php7.y:1806 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4309,19 +4307,19 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1815 + //line php7/php7.y:1816 { yyVAL.node = yyDollar[1].node } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1820 + //line php7/php7.y:1821 { yyVAL.node = nil } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1822 + //line php7/php7.y:1823 { yyVAL.node = yyDollar[2].node @@ -4330,7 +4328,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1832 + //line php7/php7.y:1833 { yyVAL.node = node.NewArgumentList(nil) @@ -4339,7 +4337,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1839 + //line php7/php7.y:1840 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4348,13 +4346,13 @@ yydefault: } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1849 + //line php7/php7.y:1850 { yyVAL.list = []node.Node{yyDollar[1].node} } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1851 + //line php7/php7.y:1852 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4363,7 +4361,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1861 + //line php7/php7.y:1862 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4372,7 +4370,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1868 + //line php7/php7.y:1869 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4384,7 +4382,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1881 + //line php7/php7.y:1882 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4393,19 +4391,19 @@ yydefault: } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1888 + //line php7/php7.y:1889 { yyVAL.list = []node.Node{yyDollar[1].node} } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1893 + //line php7/php7.y:1894 { yyVAL.node = yyDollar[1].node } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1898 + //line php7/php7.y:1899 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4414,13 +4412,13 @@ yydefault: } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1905 + //line php7/php7.y:1906 { yyVAL.list = []node.Node{yyDollar[1].node} } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1910 + //line php7/php7.y:1911 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4436,7 +4434,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1924 + //line php7/php7.y:1925 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4453,19 +4451,19 @@ yydefault: } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1942 + //line php7/php7.y:1943 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1944 + //line php7/php7.y:1945 { yyVAL.list = []node.Node{} } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1949 + //line php7/php7.y:1950 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4477,7 +4475,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1959 + //line php7/php7.y:1960 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4490,7 +4488,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1970 + //line php7/php7.y:1971 { var adaptationList *stmt.TraitAdaptationList @@ -4512,7 +4510,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:1990 + //line php7/php7.y:1991 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) @@ -4536,13 +4534,13 @@ yydefault: } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2015 + //line php7/php7.y:2016 { yyVAL.list = []node.Node{yyDollar[1].node} } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2017 + //line php7/php7.y:2018 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4551,7 +4549,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2027 + //line php7/php7.y:2028 { yyVAL.node = stmt.NewNop() @@ -4563,7 +4561,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2037 + //line php7/php7.y:2038 { yyVAL.node = stmt.NewTraitAdaptationList(nil) @@ -4575,7 +4573,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2047 + //line php7/php7.y:2048 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4587,19 +4585,19 @@ yydefault: } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2060 + //line php7/php7.y:2061 { yyVAL.list = []node.Node{yyDollar[1].node} } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2062 + //line php7/php7.y:2063 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2067 + //line php7/php7.y:2068 { yyVAL.node = yyDollar[1].node @@ -4608,7 +4606,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2074 + //line php7/php7.y:2075 { yyVAL.node = yyDollar[1].node @@ -4617,7 +4615,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2084 + //line php7/php7.y:2085 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4629,7 +4627,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2097 + //line php7/php7.y:2098 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4644,7 +4642,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2110 + //line php7/php7.y:2111 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4659,7 +4657,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2123 + //line php7/php7.y:2124 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -4674,7 +4672,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2136 + //line php7/php7.y:2137 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -4686,7 +4684,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2149 + //line php7/php7.y:2150 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -4700,13 +4698,13 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2161 + //line php7/php7.y:2162 { yyVAL.node = yyDollar[1].node } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2166 + //line php7/php7.y:2167 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -4721,7 +4719,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2182 + //line php7/php7.y:2183 { yyVAL.node = stmt.NewNop() @@ -4733,7 +4731,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2192 + //line php7/php7.y:2193 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -4746,13 +4744,13 @@ yydefault: } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2206 + //line php7/php7.y:2207 { yyVAL.list = yyDollar[1].list } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2208 + //line php7/php7.y:2209 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -4765,31 +4763,31 @@ yydefault: } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2222 + //line php7/php7.y:2223 { yyVAL.list = nil } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2224 + //line php7/php7.y:2225 { yyVAL.list = yyDollar[1].list } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2229 + //line php7/php7.y:2230 { yyVAL.list = []node.Node{yyDollar[1].node} } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2231 + //line php7/php7.y:2232 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2236 + //line php7/php7.y:2237 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4801,7 +4799,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2246 + //line php7/php7.y:2247 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4813,7 +4811,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2256 + //line php7/php7.y:2257 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4825,7 +4823,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2266 + //line php7/php7.y:2267 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4837,7 +4835,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2276 + //line php7/php7.y:2277 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4849,7 +4847,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2286 + //line php7/php7.y:2287 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4861,7 +4859,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2299 + //line php7/php7.y:2300 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4870,13 +4868,13 @@ yydefault: } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2306 + //line php7/php7.y:2307 { yyVAL.list = []node.Node{yyDollar[1].node} } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2311 + //line php7/php7.y:2312 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4892,7 +4890,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2325 + //line php7/php7.y:2326 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4909,7 +4907,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2343 + //line php7/php7.y:2344 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4918,13 +4916,13 @@ yydefault: } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2350 + //line php7/php7.y:2351 { yyVAL.list = []node.Node{yyDollar[1].node} } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2355 + //line php7/php7.y:2356 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4939,7 +4937,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2371 + //line php7/php7.y:2372 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4954,7 +4952,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2387 + //line php7/php7.y:2388 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4963,31 +4961,31 @@ yydefault: } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2394 + //line php7/php7.y:2395 { yyVAL.list = []node.Node{yyDollar[1].node} } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2399 + //line php7/php7.y:2400 { yyVAL.node = yyDollar[1].node } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2404 + //line php7/php7.y:2405 { yyVAL.list = nil } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2406 + //line php7/php7.y:2407 { yyVAL.list = yyDollar[1].list } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2411 + //line php7/php7.y:2412 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4996,18 +4994,18 @@ yydefault: } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2418 + //line php7/php7.y:2419 { yyVAL.list = []node.Node{yyDollar[1].node} } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:2423 + //line php7/php7.y:2424 { if yyDollar[2].node != nil { - yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) + yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) } else { - yyVAL.node = stmt.NewClass(nil, nil, nil, yyDollar[3].node, yyDollar[4].list, yyDollar[7].list, yyDollar[5].str) + yyVAL.node = stmt.NewClass(nil, nil, nil, yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) } // save position @@ -5015,18 +5013,12 @@ yydefault: // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassToken) - if yyDollar[3].node != nil { - yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, yyDollar[3].node) - } - if yyDollar[4].list != nil { - yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, firstNode(yyDollar[4].list)) - } yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.OpenCurlyBracesToken) yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseCurlyBracesToken) } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2448 + //line php7/php7.y:2443 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -5041,7 +5033,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2461 + //line php7/php7.y:2456 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -5053,7 +5045,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2474 + //line php7/php7.y:2469 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5070,7 +5062,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:2489 + //line php7/php7.y:2484 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5086,7 +5078,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2503 + //line php7/php7.y:2498 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5098,7 +5090,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2513 + //line php7/php7.y:2508 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5111,7 +5103,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2524 + //line php7/php7.y:2519 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5123,7 +5115,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2534 + //line php7/php7.y:2529 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5135,7 +5127,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2544 + //line php7/php7.y:2539 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5147,7 +5139,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2554 + //line php7/php7.y:2549 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5159,7 +5151,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2564 + //line php7/php7.y:2559 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5171,7 +5163,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2574 + //line php7/php7.y:2569 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5183,7 +5175,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2584 + //line php7/php7.y:2579 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5195,7 +5187,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2594 + //line php7/php7.y:2589 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5207,7 +5199,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2604 + //line php7/php7.y:2599 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5219,7 +5211,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2614 + //line php7/php7.y:2609 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5231,7 +5223,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2624 + //line php7/php7.y:2619 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5243,7 +5235,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2634 + //line php7/php7.y:2629 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5255,7 +5247,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2644 + //line php7/php7.y:2639 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5267,7 +5259,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2654 + //line php7/php7.y:2649 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5279,7 +5271,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2664 + //line php7/php7.y:2659 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5291,7 +5283,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2674 + //line php7/php7.y:2669 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5303,7 +5295,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2684 + //line php7/php7.y:2679 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5315,7 +5307,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2694 + //line php7/php7.y:2689 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5327,7 +5319,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2704 + //line php7/php7.y:2699 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5339,7 +5331,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2714 + //line php7/php7.y:2709 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5351,7 +5343,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2724 + //line php7/php7.y:2719 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5363,7 +5355,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2734 + //line php7/php7.y:2729 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5375,7 +5367,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2744 + //line php7/php7.y:2739 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5387,7 +5379,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2754 + //line php7/php7.y:2749 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5399,7 +5391,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2764 + //line php7/php7.y:2759 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5411,7 +5403,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2774 + //line php7/php7.y:2769 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5423,7 +5415,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2784 + //line php7/php7.y:2779 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5435,7 +5427,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2794 + //line php7/php7.y:2789 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5447,7 +5439,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2804 + //line php7/php7.y:2799 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5459,7 +5451,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2814 + //line php7/php7.y:2809 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5471,7 +5463,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2824 + //line php7/php7.y:2819 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5483,7 +5475,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2834 + //line php7/php7.y:2829 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5495,7 +5487,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2844 + //line php7/php7.y:2839 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5507,7 +5499,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2854 + //line php7/php7.y:2849 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5519,7 +5511,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2864 + //line php7/php7.y:2859 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -5531,7 +5523,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2874 + //line php7/php7.y:2869 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -5543,7 +5535,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2884 + //line php7/php7.y:2879 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -5555,7 +5547,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2894 + //line php7/php7.y:2889 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -5567,7 +5559,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2904 + //line php7/php7.y:2899 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5579,7 +5571,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2914 + //line php7/php7.y:2909 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5591,7 +5583,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2924 + //line php7/php7.y:2919 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -5603,7 +5595,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2934 + //line php7/php7.y:2929 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -5615,7 +5607,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2944 + //line php7/php7.y:2939 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -5627,7 +5619,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2954 + //line php7/php7.y:2949 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5639,7 +5631,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2964 + //line php7/php7.y:2959 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -5651,7 +5643,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2974 + //line php7/php7.y:2969 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5663,7 +5655,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2984 + //line php7/php7.y:2979 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -5675,7 +5667,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2994 + //line php7/php7.y:2989 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -5687,7 +5679,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3004 + //line php7/php7.y:2999 { yyVAL.node = yyDollar[2].node @@ -5697,13 +5689,13 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3012 + //line php7/php7.y:3007 { yyVAL.node = yyDollar[1].node } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3014 + //line php7/php7.y:3009 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -5716,7 +5708,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3025 + //line php7/php7.y:3020 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -5729,7 +5721,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3036 + //line php7/php7.y:3031 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -5741,13 +5733,13 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3046 + //line php7/php7.y:3041 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3048 + //line php7/php7.y:3043 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -5759,7 +5751,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3058 + //line php7/php7.y:3053 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -5771,7 +5763,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3068 + //line php7/php7.y:3063 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -5783,7 +5775,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3078 + //line php7/php7.y:3073 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -5795,7 +5787,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3088 + //line php7/php7.y:3083 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -5807,7 +5799,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3098 + //line php7/php7.y:3093 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -5819,7 +5811,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3108 + //line php7/php7.y:3103 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -5831,7 +5823,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3118 + //line php7/php7.y:3113 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -5847,7 +5839,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3132 + //line php7/php7.y:3127 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -5859,13 +5851,13 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3142 + //line php7/php7.y:3137 { yyVAL.node = yyDollar[1].node } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3144 + //line php7/php7.y:3139 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -5878,7 +5870,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3155 + //line php7/php7.y:3150 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -5890,7 +5882,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3165 + //line php7/php7.y:3160 { yyVAL.node = expr.NewYield(nil, nil) @@ -5902,7 +5894,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3175 + //line php7/php7.y:3170 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -5914,7 +5906,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3185 + //line php7/php7.y:3180 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -5927,7 +5919,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3196 + //line php7/php7.y:3191 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -5939,7 +5931,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3206 + //line php7/php7.y:3201 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) @@ -5958,7 +5950,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:3223 + //line php7/php7.y:3218 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].list, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) @@ -5978,38 +5970,38 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3244 + //line php7/php7.y:3239 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3252 + //line php7/php7.y:3247 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3254 + //line php7/php7.y:3249 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3259 + //line php7/php7.y:3254 { yyVAL.list = []node.Node{} } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3261 + //line php7/php7.y:3256 { yyVAL.list = yyDollar[3].list } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3266 + //line php7/php7.y:3261 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6018,13 +6010,13 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3273 + //line php7/php7.y:3268 { yyVAL.list = []node.Node{yyDollar[1].node} } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3278 + //line php7/php7.y:3273 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6040,7 +6032,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3292 + //line php7/php7.y:3287 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6057,7 +6049,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3310 + //line php7/php7.y:3305 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6066,7 +6058,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3317 + //line php7/php7.y:3312 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6078,7 +6070,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3327 + //line php7/php7.y:3322 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6090,7 +6082,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3337 + //line php7/php7.y:3332 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6099,7 +6091,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3347 + //line php7/php7.y:3342 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6111,67 +6103,67 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3357 + //line php7/php7.y:3352 { yyVAL.node = yyDollar[1].node } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3362 + //line php7/php7.y:3357 { yyVAL.node = yyDollar[1].node } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3364 + //line php7/php7.y:3359 { yyVAL.node = yyDollar[1].node } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3369 + //line php7/php7.y:3364 { yyVAL.node = nil } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3371 + //line php7/php7.y:3366 { yyVAL.node = yyDollar[2].node } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3376 + //line php7/php7.y:3371 { yyVAL.list = []node.Node{} } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3378 + //line php7/php7.y:3373 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3380 + //line php7/php7.y:3375 { yyVAL.list = yyDollar[1].list } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3385 + //line php7/php7.y:3380 { yyVAL.node = nil } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3387 + //line php7/php7.y:3382 { yyVAL.node = yyDollar[1].node } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3392 + //line php7/php7.y:3387 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6185,7 +6177,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3404 + //line php7/php7.y:3399 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6198,7 +6190,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3415 + //line php7/php7.y:3410 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6210,7 +6202,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3428 + //line php7/php7.y:3423 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6222,7 +6214,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3438 + //line php7/php7.y:3433 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6234,7 +6226,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3448 + //line php7/php7.y:3443 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6246,7 +6238,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3458 + //line php7/php7.y:3453 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6258,7 +6250,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3468 + //line php7/php7.y:3463 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6270,7 +6262,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3478 + //line php7/php7.y:3473 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6282,7 +6274,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3488 + //line php7/php7.y:3483 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6294,7 +6286,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3498 + //line php7/php7.y:3493 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6306,7 +6298,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3508 + //line php7/php7.y:3503 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6318,7 +6310,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3518 + //line php7/php7.y:3513 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6330,7 +6322,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3528 + //line php7/php7.y:3523 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -6344,7 +6336,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3540 + //line php7/php7.y:3535 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -6356,7 +6348,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3550 + //line php7/php7.y:3545 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -6368,7 +6360,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3560 + //line php7/php7.y:3555 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -6380,19 +6372,19 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3570 + //line php7/php7.y:3565 { yyVAL.node = yyDollar[1].node } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3572 + //line php7/php7.y:3567 { yyVAL.node = yyDollar[1].node } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3577 + //line php7/php7.y:3572 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -6401,7 +6393,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3584 + //line php7/php7.y:3579 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6416,7 +6408,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3597 + //line php7/php7.y:3592 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6431,43 +6423,43 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3613 + //line php7/php7.y:3608 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3615 + //line php7/php7.y:3610 { yyVAL.node = yyDollar[1].node } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3620 + //line php7/php7.y:3615 { yyVAL.node = nil } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3622 + //line php7/php7.y:3617 { yyVAL.node = yyDollar[1].node } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3627 + //line php7/php7.y:3622 { yyVAL.node = yyDollar[1].node } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3632 + //line php7/php7.y:3627 { yyVAL.node = yyDollar[1].node } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3634 + //line php7/php7.y:3629 { yyVAL.node = yyDollar[2].node @@ -6477,19 +6469,19 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3642 + //line php7/php7.y:3637 { yyVAL.node = yyDollar[1].node } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3647 + //line php7/php7.y:3642 { yyVAL.node = yyDollar[1].node } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3649 + //line php7/php7.y:3644 { yyVAL.node = yyDollar[2].node @@ -6499,19 +6491,19 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3657 + //line php7/php7.y:3652 { yyVAL.node = yyDollar[1].node } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3662 + //line php7/php7.y:3657 { yyVAL.node = yyDollar[1].node } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3664 + //line php7/php7.y:3659 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6524,7 +6516,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3675 + //line php7/php7.y:3670 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6537,7 +6529,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3686 + //line php7/php7.y:3681 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6550,7 +6542,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3697 + //line php7/php7.y:3692 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6562,25 +6554,25 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3707 + //line php7/php7.y:3702 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3712 + //line php7/php7.y:3707 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3714 + //line php7/php7.y:3709 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3716 + //line php7/php7.y:3711 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6592,7 +6584,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3729 + //line php7/php7.y:3724 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6606,7 +6598,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3741 + //line php7/php7.y:3736 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -6620,7 +6612,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3753 + //line php7/php7.y:3748 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6632,7 +6624,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3766 + //line php7/php7.y:3761 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6644,7 +6636,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3776 + //line php7/php7.y:3771 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6656,13 +6648,13 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3789 + //line php7/php7.y:3784 { yyVAL.node = yyDollar[1].node } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3791 + //line php7/php7.y:3786 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6675,7 +6667,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3802 + //line php7/php7.y:3797 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6688,7 +6680,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3813 + //line php7/php7.y:3808 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6700,7 +6692,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3823 + //line php7/php7.y:3818 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6712,7 +6704,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3833 + //line php7/php7.y:3828 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6724,7 +6716,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3846 + //line php7/php7.y:3841 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6736,7 +6728,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3856 + //line php7/php7.y:3851 { yyVAL.node = yyDollar[2].node @@ -6746,13 +6738,13 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3864 + //line php7/php7.y:3859 { yyVAL.node = yyDollar[1].node } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3869 + //line php7/php7.y:3864 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6764,7 +6756,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3879 + //line php7/php7.y:3874 { yyVAL.node = yyDollar[2].node @@ -6774,13 +6766,13 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3887 + //line php7/php7.y:3882 { yyVAL.node = yyDollar[1].node } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3892 + //line php7/php7.y:3887 { if yyDollar[1].list[len(yyDollar[1].list)-1] == nil { yyVAL.list = yyDollar[1].list[:len(yyDollar[1].list)-1] @@ -6790,19 +6782,19 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3903 + //line php7/php7.y:3898 { yyVAL.node = nil } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3905 + //line php7/php7.y:3900 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3910 + //line php7/php7.y:3905 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6811,13 +6803,13 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3917 + //line php7/php7.y:3912 { yyVAL.list = []node.Node{yyDollar[1].node} } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3922 + //line php7/php7.y:3917 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) @@ -6829,7 +6821,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3932 + //line php7/php7.y:3927 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) @@ -6838,7 +6830,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3939 + //line php7/php7.y:3934 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) @@ -6851,7 +6843,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3950 + //line php7/php7.y:3945 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[2].node, true) @@ -6863,7 +6855,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3960 + //line php7/php7.y:3955 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -6881,7 +6873,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3976 + //line php7/php7.y:3971 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -6898,13 +6890,13 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3994 + //line php7/php7.y:3989 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3996 + //line php7/php7.y:3991 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -6917,13 +6909,13 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4007 + //line php7/php7.y:4002 { yyVAL.list = []node.Node{yyDollar[1].node} } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4009 + //line php7/php7.y:4004 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -6936,7 +6928,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4023 + //line php7/php7.y:4018 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6950,7 +6942,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4035 + //line php7/php7.y:4030 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6968,7 +6960,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4051 + //line php7/php7.y:4046 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6988,7 +6980,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4069 + //line php7/php7.y:4064 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7001,7 +6993,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4080 + //line php7/php7.y:4075 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -7017,7 +7009,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:4094 + //line php7/php7.y:4089 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -7037,13 +7029,13 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4112 + //line php7/php7.y:4107 { yyVAL.node = yyDollar[2].node } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4118 + //line php7/php7.y:4113 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7055,7 +7047,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4128 + //line php7/php7.y:4123 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7072,7 +7064,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4143 + //line php7/php7.y:4138 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -7103,7 +7095,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4172 + //line php7/php7.y:4167 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(identifier) @@ -7117,7 +7109,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:4187 + //line php7/php7.y:4182 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -7134,7 +7126,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4202 + //line php7/php7.y:4197 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -7148,7 +7140,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4214 + //line php7/php7.y:4209 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -7160,7 +7152,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4224 + //line php7/php7.y:4219 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -7172,7 +7164,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4234 + //line php7/php7.y:4229 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -7186,7 +7178,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4246 + //line php7/php7.y:4241 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -7198,7 +7190,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4256 + //line php7/php7.y:4251 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -7210,13 +7202,13 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4269 + //line php7/php7.y:4264 { yyVAL.list = []node.Node{yyDollar[1].node} } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4271 + //line php7/php7.y:4266 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -7225,7 +7217,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4281 + //line php7/php7.y:4276 { yyVAL.node = yyDollar[1].node } diff --git a/php7/php7.y b/php7/php7.y index 6f70528..9cee1c3 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -20,11 +20,15 @@ import ( %} %union{ - node node.Node - token *scanner.Token - list []node.Node - foreachVariable foreachVariable - str string + node node.Node + token *scanner.Token + list []node.Node + foreachVariable foreachVariable + str string + + ClassExtends *stmt.ClassExtends + ClassImplements *stmt.ClassImplements + InterfaceExtends *stmt.InterfaceExtends } %type $unk @@ -243,7 +247,7 @@ import ( %type const_decl inner_statement %type expr optional_expr %type declare_statement finally_statement unset_variable variable -%type extends_from parameter optional_type argument expr_without_variable global_var +%type parameter optional_type argument expr_without_variable global_var %type static_var class_statement trait_adaptation trait_precedence trait_alias %type absolute_trait_method_reference trait_method_reference property echo_expr %type new_expr anonymous_class class_name class_name_reference simple_variable @@ -265,6 +269,9 @@ import ( %type switch_case_list %type method_body %type foreach_statement for_statement while_statement +%type extends_from +%type implements_list +%type interface_extends_list %type member_modifier %type use_type @@ -278,7 +285,7 @@ import ( %type use_declarations lexical_var_list lexical_vars isset_variables non_empty_array_pair_list %type array_pair_list non_empty_argument_list top_statement_list %type inner_statement_list parameter_list non_empty_parameter_list class_statement_list -%type interface_extends_list implements_list method_modifiers variable_modifiers +%type method_modifiers variable_modifiers %type non_empty_member_modifiers name_list class_modifiers %type backup_doc_comment @@ -1199,12 +1206,6 @@ class_declaration_statement: // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.ClassToken) yylex.(*Parser).comments.AddFromToken(name, $3, comment.StringToken) - if $4 != nil { - yylex.(*Parser).comments.AddFromChildNode($$, $4) - } - if $5 != nil { - yylex.(*Parser).comments.AddFromChildNode($$, firstNode($5)) - } yylex.(*Parser).comments.AddFromToken($$, $7, comment.OpenCurlyBracesToken) yylex.(*Parser).comments.AddFromToken($$, $9, comment.CloseCurlyBracesToken) } @@ -1220,12 +1221,6 @@ class_declaration_statement: // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassToken) yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringToken) - if $3 != nil { - yylex.(*Parser).comments.AddFromChildNode($$, $3) - } - if $4 != nil { - yylex.(*Parser).comments.AddFromChildNode($$, firstNode($4)) - } yylex.(*Parser).comments.AddFromToken($$, $6, comment.OpenCurlyBracesToken) yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseCurlyBracesToken) } @@ -1292,9 +1287,6 @@ interface_declaration_statement: // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.InterfaceToken) yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringToken) - if $3 != nil { - yylex.(*Parser).comments.AddFromChildNode($$, firstNode($3)) - } yylex.(*Parser).comments.AddFromToken($$, $5, comment.OpenCurlyBracesToken) yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseCurlyBracesToken) } @@ -1305,7 +1297,10 @@ extends_from: { $$ = nil } | T_EXTENDS name { - $$ = $2; + $$ = stmt.NewClassExtends($2); + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExtendsToken) @@ -1317,10 +1312,13 @@ interface_extends_list: { $$ = nil } | T_EXTENDS name_list { - $$ = $2; + $$ = stmt.NewInterfaceExtends($2); + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken(firstNode($$), $1, comment.ExtendsToken) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExtendsToken) } ; @@ -1329,10 +1327,13 @@ implements_list: { $$ = nil } | T_IMPLEMENTS name_list { - $$ = $2; + $$ = stmt.NewClassImplements($2); + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken(firstNode($$), $1, comment.ImplementsToken) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ImplementsToken) } ; @@ -2432,12 +2433,6 @@ anonymous_class: // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassToken) - if $3 != nil { - yylex.(*Parser).comments.AddFromChildNode($$, $3) - } - if $4 != nil { - yylex.(*Parser).comments.AddFromChildNode($$, firstNode($4)) - } yylex.(*Parser).comments.AddFromToken($$, $6, comment.OpenCurlyBracesToken) yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseCurlyBracesToken) } diff --git a/php7/php7_test.go b/php7/php7_test.go index 5db2890..0d7cbc9 100644 --- a/php7/php7_test.go +++ b/php7/php7_test.go @@ -925,20 +925,8 @@ func TestPhp7(t *testing.T) { Modifiers: []node.Node{ &node.Identifier{Value: "final"}, }, - Extends: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "bar"}, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - ClassName: &node.Identifier{Value: "foo"}, - Modifiers: []node.Node{ - &node.Identifier{Value: "final"}, - }, - Implements: []node.Node{ - &name.Name{ + Extends: &stmt.ClassExtends{ + ClassName: &name.Name{ Parts: []node.Node{ &name.NamePart{Value: "bar"}, }, @@ -951,15 +939,33 @@ func TestPhp7(t *testing.T) { Modifiers: []node.Node{ &node.Identifier{Value: "final"}, }, - Implements: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "bar"}, + Implements: &stmt.ClassImplements{ + InterfaceNames: []node.Node{ + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "bar"}, + }, }, }, - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "baz"}, + }, + Stmts: []node.Node{}, + }, + &stmt.Class{ + ClassName: &node.Identifier{Value: "foo"}, + Modifiers: []node.Node{ + &node.Identifier{Value: "final"}, + }, + Implements: &stmt.ClassImplements{ + InterfaceNames: []node.Node{ + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "bar"}, + }, + }, + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "baz"}, + }, }, }, }, @@ -970,20 +976,24 @@ func TestPhp7(t *testing.T) { Class: &stmt.Class{ ArgumentList: &node.ArgumentList{}, - Extends: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "foo"}, - }, - }, - Implements: []node.Node{ - &name.Name{ + Extends: &stmt.ClassExtends{ + ClassName: &name.Name{ Parts: []node.Node{ - &name.NamePart{Value: "bar"}, + &name.NamePart{Value: "foo"}, }, }, - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "baz"}, + }, + Implements: &stmt.ClassImplements{ + InterfaceNames: []node.Node{ + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "bar"}, + }, + }, + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "baz"}, + }, }, }, }, @@ -1294,10 +1304,12 @@ func TestPhp7(t *testing.T) { &stmt.Interface{ PhpDocComment: "", InterfaceName: &node.Identifier{Value: "Foo"}, - Extends: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + Extends: &stmt.InterfaceExtends{ + InterfaceNames: []node.Node{ + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Bar"}, + }, }, }, }, @@ -1306,15 +1318,17 @@ func TestPhp7(t *testing.T) { &stmt.Interface{ PhpDocComment: "", InterfaceName: &node.Identifier{Value: "Foo"}, - Extends: []node.Node{ - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + Extends: &stmt.InterfaceExtends{ + InterfaceNames: []node.Node{ + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Bar"}, + }, }, - }, - &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Baz"}, + }, }, }, }, diff --git a/printer/printer.go b/printer/printer.go index df62c20..bccbb45 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1553,12 +1553,12 @@ func (p *Printer) printStmtClass(n node.Node) { if nn.Extends != nil { io.WriteString(p.w, " extends ") - p.Print(nn.Extends) + p.Print(nn.Extends.ClassName) } if nn.Implements != nil { io.WriteString(p.w, " implements ") - p.joinPrint(", ", nn.Implements) + p.joinPrint(", ", nn.Implements.InterfaceNames) } io.WriteString(p.w, "\n") @@ -1910,7 +1910,7 @@ func (p *Printer) printStmtInterface(n node.Node) { if nn.Extends != nil { io.WriteString(p.w, " extends ") - p.joinPrint(", ", nn.Extends) + p.joinPrint(", ", nn.Extends.InterfaceNames) } io.WriteString(p.w, "\n") diff --git a/printer/printer_test.go b/printer/printer_test.go index a34997e..e36d781 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -35,9 +35,11 @@ func TestPrintFile(t *testing.T) { &name.NamePart{Value: "Bar"}, }, }, - Extends: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + Extends: &stmt.ClassExtends{ + ClassName: &name.Name{ + Parts: []node.Node{ + &name.NamePart{Value: "Baz"}, + }, }, }, Stmts: []node.Node{ @@ -2482,10 +2484,14 @@ func TestPrintStmtClass(t *testing.T) { &stmt.Class{ Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, ClassName: &node.Identifier{Value: "Foo"}, - Extends: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, - Implements: []node.Node{ - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, + Extends: &stmt.ClassExtends{ + ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, + }, + Implements: &stmt.ClassImplements{ + InterfaceNames: []node.Node{ + &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, + &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, + }, }, Stmts: []node.Node{ &stmt.ClassConstList{ @@ -2533,10 +2539,14 @@ func TestPrintStmtAnonymousClass(t *testing.T) { }, }, }, - Extends: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, - Implements: []node.Node{ - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, + Extends: &stmt.ClassExtends{ + ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, + }, + Implements: &stmt.ClassImplements{ + InterfaceNames: []node.Node{ + &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, + &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, + }, }, Stmts: []node.Node{ &stmt.ClassConstList{ @@ -3382,9 +3392,11 @@ func TestPrintInterface(t *testing.T) { Stmts: []node.Node{ &stmt.Interface{ InterfaceName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Extends: []node.Node{ - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, + Extends: &stmt.InterfaceExtends{ + InterfaceNames: []node.Node{ + &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, + &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, + }, }, Stmts: []node.Node{ &stmt.ClassMethod{ diff --git a/visitor/namespace_resolver.go b/visitor/namespace_resolver.go index 056aff1..7bac124 100644 --- a/visitor/namespace_resolver.go +++ b/visitor/namespace_resolver.go @@ -66,11 +66,13 @@ func (nsr *NamespaceResolver) EnterNode(w walker.Walkable) bool { case *stmt.Class: if n.Extends != nil { - nsr.ResolveName(n.Extends, "") + nsr.ResolveName(n.Extends.ClassName, "") } - for _, interfaceName := range n.Implements { - nsr.ResolveName(interfaceName, "") + if n.Implements != nil { + for _, interfaceName := range n.Implements.InterfaceNames { + nsr.ResolveName(interfaceName, "") + } } if n.ClassName != nil { @@ -78,8 +80,10 @@ func (nsr *NamespaceResolver) EnterNode(w walker.Walkable) bool { } case *stmt.Interface: - for _, interfaceName := range n.Extends { - nsr.ResolveName(interfaceName, "") + if n.Extends != nil { + for _, interfaceName := range n.Extends.InterfaceNames { + nsr.ResolveName(interfaceName, "") + } } nsr.AddNamespacedName(n, n.InterfaceName.(*node.Identifier).Value) diff --git a/visitor/namespace_resolver_test.go b/visitor/namespace_resolver_test.go index a6f3131..4eb7700 100644 --- a/visitor/namespace_resolver_test.go +++ b/visitor/namespace_resolver_test.go @@ -411,9 +411,13 @@ func TestResolveClassName(t *testing.T) { class := &stmt.Class{ PhpDocComment: "", ClassName: &node.Identifier{Value: "A"}, - Extends: nameAB, - Implements: []node.Node{ - nameBC, + Extends: &stmt.ClassExtends{ + ClassName: nameAB, + }, + Implements: &stmt.ClassImplements{ + InterfaceNames: []node.Node{ + nameBC, + }, }, } @@ -442,9 +446,11 @@ func TestResolveInterfaceName(t *testing.T) { interfaceNode := &stmt.Interface{ PhpDocComment: "", InterfaceName: &node.Identifier{Value: "A"}, - Extends: []node.Node{ - nameAB, - nameBC, + Extends: &stmt.InterfaceExtends{ + InterfaceNames: []node.Node{ + nameAB, + nameBC, + }, }, } From ec0ef26bd6556ab9086c0948192626f2357cd9d0 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Mon, 14 May 2018 18:09:11 +0300 Subject: [PATCH 21/25] create expr.Reference node [wip] create expr.Reference node [wip] create expr.Reference node [wip] create expr.Reference node fix --- node/expr/n_array_item.go | 12 +- node/expr/n_closure_use.go | 8 +- node/expr/n_reference.go | 38 + node/expr/t_array_test.go | 11 +- node/expr/t_closure_test.go | 8 +- node/expr/t_list_test.go | 8 +- node/expr/t_reference_test.go | 41 ++ node/expr/t_short_array_test.go | 11 +- node/expr/t_short_list_test.go | 8 +- node/expr/t_visitor_test.go | 22 +- node/stmt/n_alt_foreach.go | 8 +- node/stmt/n_foreach.go | 8 +- node/stmt/t_foreach_test.go | 11 +- node/stmt/t_visitor_test.go | 6 +- php5/php5.go | 1142 +++++++++++++++---------------- php5/php5.y | 101 ++- php5/php5_test.go | 104 +-- php7/php7.go | 1063 ++++++++++++++-------------- php7/php7.y | 77 +-- php7/php7_test.go | 86 +-- printer/printer.go | 25 +- printer/printer_test.go | 55 +- 22 files changed, 1408 insertions(+), 1445 deletions(-) create mode 100644 node/expr/n_reference.go create mode 100644 node/expr/t_reference_test.go diff --git a/node/expr/n_array_item.go b/node/expr/n_array_item.go index 0c05df1..b651358 100644 --- a/node/expr/n_array_item.go +++ b/node/expr/n_array_item.go @@ -7,15 +7,13 @@ import ( // ArrayItem node type ArrayItem struct { - ByRef bool - Key node.Node - Val node.Node + Key node.Node + Val node.Node } // NewArrayItem node constructor -func NewArrayItem(Key node.Node, Val node.Node, ByRef bool) *ArrayItem { +func NewArrayItem(Key node.Node, Val node.Node) *ArrayItem { return &ArrayItem{ - ByRef, Key, Val, } @@ -23,9 +21,7 @@ func NewArrayItem(Key node.Node, Val node.Node, ByRef bool) *ArrayItem { // Attributes returns node attributes as map func (n *ArrayItem) Attributes() map[string]interface{} { - return map[string]interface{}{ - "ByRef": n.ByRef, - } + return nil } // Walk traverses nodes diff --git a/node/expr/n_closure_use.go b/node/expr/n_closure_use.go index 72d5e13..29e5922 100644 --- a/node/expr/n_closure_use.go +++ b/node/expr/n_closure_use.go @@ -7,23 +7,19 @@ import ( // ClosureUse node type ClosureUse struct { - ByRef bool Variable node.Node } // NewClosureUse node constructor -func NewClosureUse(Variable node.Node, ByRef bool) *ClosureUse { +func NewClosureUse(Variable node.Node) *ClosureUse { return &ClosureUse{ - ByRef, Variable, } } // Attributes returns node attributes as map func (n *ClosureUse) Attributes() map[string]interface{} { - return map[string]interface{}{ - "ByRef": n.ByRef, - } + return nil } // Walk traverses nodes diff --git a/node/expr/n_reference.go b/node/expr/n_reference.go new file mode 100644 index 0000000..9b864fc --- /dev/null +++ b/node/expr/n_reference.go @@ -0,0 +1,38 @@ +package expr + +import ( + "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/walker" +) + +// Reference node +type Reference struct { + Variable node.Node +} + +// NewReference node constructor +func NewReference(Variable node.Node) *Reference { + return &Reference{ + Variable, + } +} + +// Attributes returns node attributes as map +func (n *Reference) Attributes() map[string]interface{} { + return nil +} + +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true +func (n *Reference) Walk(v walker.Visitor) { + if v.EnterNode(n) == false { + return + } + + if n.Variable != nil { + vv := v.GetChildrenVisitor("Variable") + n.Variable.Walk(vv) + } + + v.LeaveNode(n) +} diff --git a/node/expr/t_array_test.go b/node/expr/t_array_test.go index 11923c0..99d997a 100644 --- a/node/expr/t_array_test.go +++ b/node/expr/t_array_test.go @@ -47,8 +47,7 @@ func TestArrayItem(t *testing.T) { Expr: &expr.Array{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, }, }, @@ -76,13 +75,11 @@ func TestArrayItems(t *testing.T) { Expr: &expr.Array{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Key: &scalar.Lnumber{Value: "1"}, - Val: &scalar.Lnumber{Value: "1"}, + Key: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, &expr.ArrayItem{ - ByRef: true, - Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, }, }, }, diff --git a/node/expr/t_closure_test.go b/node/expr/t_closure_test.go index 882a8c0..abfc831 100644 --- a/node/expr/t_closure_test.go +++ b/node/expr/t_closure_test.go @@ -66,12 +66,10 @@ func TestClosureUse(t *testing.T) { }, Uses: []node.Node{ &expr.ClosureUse{ - ByRef: false, Variable: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, }, &expr.ClosureUse{ - ByRef: true, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}, + Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, }, }, Stmts: []node.Node{}, @@ -115,11 +113,9 @@ func TestClosureUse2(t *testing.T) { }, Uses: []node.Node{ &expr.ClosureUse{ - ByRef: true, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "c"}}}, }, &expr.ClosureUse{ - ByRef: false, Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}, }, }, diff --git a/node/expr/t_list_test.go b/node/expr/t_list_test.go index 21a26bb..ecdabbd 100644 --- a/node/expr/t_list_test.go +++ b/node/expr/t_list_test.go @@ -51,8 +51,7 @@ func TestList(t *testing.T) { Variable: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, }, }, }, @@ -83,7 +82,6 @@ func TestListArrayIndex(t *testing.T) { Variable: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, Val: &expr.ArrayDimFetch{ Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, }, @@ -117,12 +115,10 @@ func TestListList(t *testing.T) { Variable: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, Val: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, }, }, }, diff --git a/node/expr/t_reference_test.go b/node/expr/t_reference_test.go new file mode 100644 index 0000000..9f83687 --- /dev/null +++ b/node/expr/t_reference_test.go @@ -0,0 +1,41 @@ +package expr_test + +import ( + "bytes" + "testing" + + "github.com/z7zmey/php-parser/node/expr" + + "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/node/stmt" + "github.com/z7zmey/php-parser/php5" + "github.com/z7zmey/php-parser/php7" +) + +func TestForeachWithRef(t *testing.T) { + t.Helper() + src := ` &$v) {}` + + expected := &node.Root{ + Stmts: []node.Node{ + &stmt.Foreach{ + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, + Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}}, + Stmt: &stmt.StmtList{ + Stmts: []node.Node{}, + }, + }, + }, + } + + php7parser := php7.NewParser(bytes.NewBufferString(src), "test.php") + php7parser.Parse() + actual := php7parser.GetRootNode() + assertEqual(t, expected, actual) + + php5parser := php5.NewParser(bytes.NewBufferString(src), "test.php") + php5parser.Parse() + actual = php5parser.GetRootNode() + assertEqual(t, expected, actual) +} diff --git a/node/expr/t_short_array_test.go b/node/expr/t_short_array_test.go index fe19c6b..adecd20 100644 --- a/node/expr/t_short_array_test.go +++ b/node/expr/t_short_array_test.go @@ -47,8 +47,7 @@ func TestShortArrayItem(t *testing.T) { Expr: &expr.ShortArray{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, }, }, @@ -76,13 +75,11 @@ func TestShortArrayItems(t *testing.T) { Expr: &expr.ShortArray{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Key: &scalar.Lnumber{Value: "1"}, - Val: &scalar.Lnumber{Value: "1"}, + Key: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, &expr.ArrayItem{ - ByRef: true, - Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, }, }, }, diff --git a/node/expr/t_short_list_test.go b/node/expr/t_short_list_test.go index 3a1a95e..9492ef9 100644 --- a/node/expr/t_short_list_test.go +++ b/node/expr/t_short_list_test.go @@ -23,8 +23,7 @@ func TestShortList(t *testing.T) { Variable: &expr.ShortList{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, }, }, }, @@ -50,7 +49,6 @@ func TestShortListArrayIndex(t *testing.T) { Variable: &expr.ShortList{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, Val: &expr.ArrayDimFetch{ Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, }, @@ -79,12 +77,10 @@ func TestShortListList(t *testing.T) { Variable: &expr.ShortList{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, Val: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, }, }, }, diff --git a/node/expr/t_visitor_test.go b/node/expr/t_visitor_test.go index 1434ee7..28409ac 100644 --- a/node/expr/t_visitor_test.go +++ b/node/expr/t_visitor_test.go @@ -32,20 +32,18 @@ var nodesToTest = []struct { }, { &expr.ArrayItem{ - ByRef: false, - Key: &scalar.String{Value: "key"}, - Val: &scalar.Lnumber{Value: "1"}, + Key: &scalar.String{Value: "key"}, + Val: &scalar.Lnumber{Value: "1"}, }, []string{"Key", "Val"}, - map[string]interface{}{"ByRef": false}, + map[string]interface{}{}, }, { &expr.Array{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Key: &scalar.String{Value: "key"}, - Val: &scalar.Lnumber{Value: "1"}, + Key: &scalar.String{Value: "key"}, + Val: &scalar.Lnumber{Value: "1"}, }, }, }, @@ -83,11 +81,10 @@ var nodesToTest = []struct { }, { &expr.ClosureUse{ - ByRef: false, Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, }, []string{"Variable"}, - map[string]interface{}{"ByRef": false}, + map[string]interface{}{}, }, { &expr.Closure{ @@ -252,6 +249,13 @@ var nodesToTest = []struct { []string{"Variable", "Property"}, map[string]interface{}{}, }, + { + &expr.Reference{ + Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, + []string{"Variable"}, + map[string]interface{}{}, + }, { &expr.RequireOnce{ Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, diff --git a/node/stmt/n_alt_foreach.go b/node/stmt/n_alt_foreach.go index 950445a..deaa4c4 100644 --- a/node/stmt/n_alt_foreach.go +++ b/node/stmt/n_alt_foreach.go @@ -7,7 +7,6 @@ import ( // AltForeach node type AltForeach struct { - ByRef bool Expr node.Node Key node.Node Variable node.Node @@ -15,9 +14,8 @@ type AltForeach struct { } // NewAltForeach node constructor -func NewAltForeach(Expr node.Node, Key node.Node, Variable node.Node, Stmt node.Node, ByRef bool) *AltForeach { +func NewAltForeach(Expr node.Node, Key node.Node, Variable node.Node, Stmt node.Node) *AltForeach { return &AltForeach{ - ByRef, Expr, Key, Variable, @@ -27,9 +25,7 @@ func NewAltForeach(Expr node.Node, Key node.Node, Variable node.Node, Stmt node. // Attributes returns node attributes as map func (n *AltForeach) Attributes() map[string]interface{} { - return map[string]interface{}{ - "ByRef": n.ByRef, - } + return nil } // Walk traverses nodes diff --git a/node/stmt/n_foreach.go b/node/stmt/n_foreach.go index 2ae2c48..b82d2f5 100644 --- a/node/stmt/n_foreach.go +++ b/node/stmt/n_foreach.go @@ -7,7 +7,6 @@ import ( // Foreach node type Foreach struct { - ByRef bool Expr node.Node Key node.Node Variable node.Node @@ -15,9 +14,8 @@ type Foreach struct { } // NewForeach node constructor -func NewForeach(Expr node.Node, Key node.Node, Variable node.Node, Stmt node.Node, ByRef bool) *Foreach { +func NewForeach(Expr node.Node, Key node.Node, Variable node.Node, Stmt node.Node) *Foreach { return &Foreach{ - ByRef, Expr, Key, Variable, @@ -27,9 +25,7 @@ func NewForeach(Expr node.Node, Key node.Node, Variable node.Node, Stmt node.Nod // Attributes returns node attributes as map func (n *Foreach) Attributes() map[string]interface{} { - return map[string]interface{}{ - "ByRef": n.ByRef, - } + return nil } // Walk traverses nodes diff --git a/node/stmt/t_foreach_test.go b/node/stmt/t_foreach_test.go index ca20890..80479dd 100644 --- a/node/stmt/t_foreach_test.go +++ b/node/stmt/t_foreach_test.go @@ -140,10 +140,9 @@ func TestForeachWithRef(t *testing.T) { expected := &node.Root{ Stmts: []node.Node{ &stmt.Foreach{ - ByRef: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, + Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}}, Stmt: &stmt.StmtList{Stmts: []node.Node{}}, }, }, @@ -166,14 +165,12 @@ func TestForeachWithList(t *testing.T) { expected := &node.Root{ Stmts: []node.Node{ &stmt.Foreach{ - ByRef: false, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, Variable: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, }, }, }, diff --git a/node/stmt/t_visitor_test.go b/node/stmt/t_visitor_test.go index f8f5c84..7527dab 100644 --- a/node/stmt/t_visitor_test.go +++ b/node/stmt/t_visitor_test.go @@ -224,25 +224,23 @@ var nodesToTest = []struct { }, { &stmt.Foreach{ - ByRef: true, Expr: &stmt.Expression{}, Key: &expr.Variable{}, Variable: &expr.Variable{}, Stmt: &stmt.StmtList{}, }, []string{"Expr", "Key", "Variable", "Stmt"}, - map[string]interface{}{"ByRef": true}, + map[string]interface{}{}, }, { &stmt.AltForeach{ - ByRef: true, Expr: &stmt.Expression{}, Key: &expr.Variable{}, Variable: &expr.Variable{}, Stmt: &stmt.StmtList{}, }, []string{"Expr", "Key", "Variable", "Stmt"}, - map[string]interface{}{"ByRef": true}, + map[string]interface{}{}, }, { &stmt.Function{ diff --git a/php5/php5.go b/php5/php5.go index 916f894..9fe75aa 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -25,7 +25,6 @@ type yySymType struct { node node.Node token *scanner.Token list []node.Node - foreachVariable foreachVariable simpleIndirectReference simpleIndirectReference ClassExtends *stmt.ClassExtends @@ -347,11 +346,6 @@ const yyInitialStackSize = 16 //line php5/php5.y:4015 -type foreachVariable struct { - node node.Node - byRef bool -} - type simpleIndirectReference struct { all []*expr.Variable last *expr.Variable @@ -1624,41 +1618,41 @@ var yyPgo = [...]int{ 73, 68, 61, 1068, 1067, 1066, 35, 1065, 1063, 4, 1062, 1061, 1060, 17, 1059, 1058, 1057, 1056, 51, 5, 1055, 1054, 1053, 1051, 1049, 2, 1048, 631, 1047, 18, - 22, 1046, 1045, 1043, 15, 1042, 1041, 1040, 1037, 1033, - 39, 0, 1032, 1030, 1029, 117, 1028, 1027, 553, 1026, - 1024, 42, 8, 1018, 9, 1017, 1013, 1007, 14, 49, - 1001, 1000, 998, 995, 993, 992, 3, 991, 16, 990, - 988, 985, 28, 983, 982, 980, 976, 974, 971, 962, - 21, 961, 959, 958, 25, 955, 23, 12, 953, 40, - 945, 939, 937, 933, 41, 6, 19, 13, 930, 853, + 22, 1046, 1045, 1043, 15, 1042, 1041, 6, 19, 1040, + 1037, 1033, 39, 0, 1032, 1030, 1029, 117, 1028, 1027, + 553, 1026, 1024, 42, 8, 1018, 9, 1017, 1013, 1007, + 14, 49, 1001, 1000, 998, 995, 993, 992, 3, 991, + 16, 990, 988, 985, 28, 983, 982, 980, 976, 974, + 971, 962, 21, 961, 959, 958, 25, 955, 23, 12, + 953, 40, 945, 939, 937, 933, 41, 13, 930, 853, 7, 20, } var yyR1 = [...]int{ - 0, 149, 90, 90, 91, 91, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 92, 92, - 4, 4, 4, 4, 93, 93, 5, 5, 5, 5, - 94, 94, 6, 6, 6, 6, 53, 53, 95, 95, + 0, 149, 92, 92, 93, 93, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 94, 94, + 4, 4, 4, 4, 95, 95, 5, 5, 5, 5, + 96, 96, 6, 6, 6, 6, 53, 53, 97, 97, 24, 24, 24, 24, 24, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 113, 113, 58, 58, 114, - 114, 115, 115, 59, 111, 111, 56, 51, 52, 147, + 26, 26, 26, 26, 26, 115, 115, 58, 58, 116, + 116, 117, 117, 59, 113, 113, 56, 51, 52, 147, 147, 148, 148, 60, 61, 61, 64, 64, 64, 64, - 87, 87, 2, 89, 89, 88, 88, 122, 122, 146, - 146, 145, 145, 145, 85, 85, 84, 84, 57, 57, - 112, 112, 82, 82, 82, 82, 109, 109, 109, 150, - 150, 86, 86, 105, 105, 106, 106, 54, 54, 55, - 55, 116, 116, 117, 117, 63, 63, 62, 62, 62, - 62, 80, 80, 80, 123, 123, 68, 68, 68, 68, - 96, 96, 27, 27, 27, 97, 97, 97, 97, 118, - 118, 65, 65, 65, 65, 67, 124, 124, 81, 81, - 125, 125, 126, 126, 69, 69, 70, 127, 127, 73, - 73, 72, 71, 71, 74, 74, 83, 83, 119, 119, - 120, 120, 128, 128, 75, 75, 75, 75, 75, 75, - 121, 121, 121, 121, 66, 66, 110, 110, 108, 108, - 107, 107, 134, 134, 132, 132, 133, 133, 133, 135, - 135, 42, 15, 15, 15, 15, 15, 15, 15, 15, + 89, 89, 2, 91, 91, 90, 90, 124, 124, 88, + 88, 87, 87, 87, 85, 85, 84, 84, 57, 57, + 114, 114, 82, 82, 82, 82, 111, 111, 111, 150, + 150, 86, 86, 107, 107, 108, 108, 54, 54, 55, + 55, 118, 118, 119, 119, 63, 63, 62, 62, 62, + 62, 80, 80, 80, 125, 125, 68, 68, 68, 68, + 98, 98, 27, 27, 27, 99, 99, 99, 99, 120, + 120, 65, 65, 65, 65, 67, 126, 126, 81, 81, + 127, 127, 128, 128, 69, 69, 70, 129, 129, 73, + 73, 72, 71, 71, 74, 74, 83, 83, 121, 121, + 122, 122, 130, 130, 75, 75, 75, 75, 75, 75, + 123, 123, 123, 123, 66, 66, 112, 112, 110, 110, + 109, 109, 136, 136, 134, 134, 135, 135, 135, 137, + 137, 42, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, @@ -1666,27 +1660,27 @@ var yyR1 = [...]int{ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 50, 50, 50, 50, - 47, 47, 47, 47, 46, 46, 1, 104, 104, 103, - 103, 103, 103, 23, 23, 23, 23, 23, 23, 23, + 47, 47, 47, 47, 46, 46, 1, 106, 106, 105, + 105, 105, 105, 23, 23, 23, 23, 23, 23, 23, 23, 11, 11, 11, 11, 45, 45, 45, 43, 43, - 41, 41, 142, 142, 141, 49, 49, 49, 129, 129, - 129, 79, 79, 7, 7, 7, 7, 7, 7, 7, + 41, 41, 144, 144, 143, 49, 49, 49, 131, 131, + 131, 79, 79, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 28, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 35, 35, 35, 35, 29, 29, 29, 29, 29, 29, - 29, 130, 130, 151, 151, 131, 131, 131, 131, 14, - 14, 48, 48, 16, 17, 18, 19, 19, 143, 143, - 136, 138, 138, 76, 137, 137, 137, 40, 40, 44, + 29, 132, 132, 151, 151, 133, 133, 133, 133, 14, + 14, 48, 48, 16, 17, 18, 19, 19, 145, 145, + 138, 140, 140, 76, 139, 139, 139, 40, 40, 44, 44, 12, 22, 22, 20, 20, 20, 21, 21, 21, - 10, 10, 10, 9, 9, 13, 13, 139, 139, 140, - 140, 140, 39, 39, 144, 144, 102, 102, 38, 38, - 38, 101, 101, 100, 100, 100, 100, 100, 100, 100, - 100, 98, 98, 98, 98, 33, 33, 33, 33, 33, + 10, 10, 10, 9, 9, 13, 13, 141, 141, 142, + 142, 142, 39, 39, 146, 146, 104, 104, 38, 38, + 38, 103, 103, 102, 102, 102, 102, 102, 102, 102, + 102, 100, 100, 100, 100, 33, 33, 33, 33, 33, 33, 34, 34, 34, 37, 37, 37, 37, 37, 37, - 37, 37, 99, 99, 36, 36, 30, 30, 31, 32, + 37, 37, 101, 101, 36, 36, 30, 30, 31, 32, } var yyR2 = [...]int{ @@ -1745,7 +1739,7 @@ var yyR2 = [...]int{ } var yyChk = [...]int{ - -1000, -149, -90, -3, 2, -25, -51, -52, 51, 79, + -1000, -149, -92, -3, 2, -25, -51, -52, 51, 79, 44, -53, -26, 10, -60, -61, 38, 142, 7, 21, 20, 23, 30, 34, 35, 39, -50, 46, 98, 19, 14, -14, 48, 25, 27, 144, 40, 43, 36, -1, @@ -1755,99 +1749,99 @@ var yyChk = [...]int{ 112, 113, 6, 156, -29, -47, -46, 141, 96, -20, 91, 49, 50, 4, 5, 84, 85, 86, 11, -35, -32, -7, 140, 74, 62, 18, 60, 148, -21, -22, - -23, -30, -91, 82, -11, 8, 9, 66, 67, 81, - 63, 64, 65, 80, -10, -144, -44, -12, -40, -9, - 157, 12, 146, -91, 142, 82, 10, -92, 37, 38, - -4, -91, 82, 144, 158, 145, 10, -95, -48, 146, + -23, -30, -93, 82, -11, 8, 9, 66, 67, 81, + 63, 64, 65, 80, -10, -146, -44, -12, -40, -9, + 157, 12, 146, -93, 142, 82, 10, -94, 37, 38, + -4, -93, 82, 144, 158, 145, 10, -97, -48, 146, -48, -25, -1, 79, 146, -48, 144, -14, 97, 98, - 144, -14, 144, -15, -19, -14, 144, -96, -27, 12, - 157, -97, -1, 12, -110, -14, 144, 129, 130, 87, + 144, -14, 144, -15, -19, -14, 144, -98, -27, 12, + 157, -99, -1, 12, -112, -14, 144, 129, 130, 87, 89, 88, 159, 151, 161, 167, 153, 152, 162, 131, 163, 164, 132, 133, 134, 135, 136, 137, 165, 138, 166, 139, 90, 150, 146, 146, 146, 142, -14, 10, -147, 151, 10, 10, -15, -19, -14, 52, 52, 160, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 146, -14, 104, 105, -18, -19, -91, 79, + 127, 128, 146, -14, 104, 105, -18, -19, -93, 79, 82, -11, -12, 98, -18, -14, -14, -14, -14, -42, -14, -50, -14, -14, -14, -14, -14, -14, -14, -49, - 146, -48, -14, 148, 148, -129, 17, -98, -33, 12, - 76, 77, -14, 57, -43, -11, -41, -91, 79, 82, - -21, -10, -144, -12, 146, 146, -14, -14, 146, -14, - -14, 148, -98, 17, 17, 75, -98, 148, 146, -101, - -100, -14, 151, 148, 148, 82, -80, 146, -91, 78, + 146, -48, -14, 148, 148, -131, 17, -100, -33, 12, + 76, 77, -14, 57, -43, -11, -41, -93, 79, 82, + -21, -10, -146, -12, 146, 146, -14, -14, 146, -14, + -14, 148, -100, 17, 17, 75, -100, 148, 146, -103, + -102, -14, 151, 148, 148, 82, -80, 146, -93, 78, 148, 142, -10, 157, 78, -80, 142, 147, 144, 142, - -90, -91, 144, 158, -93, -5, -91, 82, -94, -6, - -91, 82, 29, -91, 10, 160, -24, 143, 2, -25, + -92, -93, 144, 158, -95, -5, -93, 82, -96, -6, + -93, 82, 29, -93, 10, 160, -24, 143, 2, -25, -51, -52, 51, -25, 145, -86, -25, 145, 21, -147, - -108, -107, -14, -82, 142, 145, 144, 144, 144, 144, + -110, -109, -14, -82, 142, 145, 144, 144, 144, 144, 144, 158, -16, 142, -19, 144, 158, -147, 160, 144, 158, -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, -43, -14, 145, -111, - -56, -19, -19, -15, -112, 10, -95, 144, 144, 10, - 146, -87, 55, -89, 55, 58, -14, 151, -14, -14, + -14, -14, -14, -14, -14, -14, -43, -14, 145, -113, + -56, -19, -19, -15, -114, 10, -97, 144, 144, 10, + 146, -89, 55, -91, 55, 58, -14, 151, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -102, -38, -19, 59, 82, -91, 78, 78, 147, 147, + -104, -38, -19, 59, 82, -93, 78, 78, 147, 147, 147, 147, -13, -14, -13, 141, -33, -33, 17, 148, - 57, -14, 11, -19, -139, -140, -40, -39, -10, -144, - 10, 142, -79, -80, 78, 82, -91, 57, -10, 78, - -99, -36, -19, -15, -19, -15, -14, -13, 140, 75, - 75, -13, -101, 149, -151, 158, 58, -17, -19, -13, - -13, 10, 147, -123, -50, -68, -15, -19, 151, 83, + 57, -14, 11, -19, -141, -142, -40, -39, -10, -146, + 10, 142, -79, -80, 78, 82, -93, 57, -10, 78, + -101, -36, -19, -15, -19, -15, -14, -13, 140, 75, + 75, -13, -103, 149, -151, 158, 58, -17, -19, -13, + -13, 10, 147, -125, -50, -68, -15, -19, 151, 83, -80, -39, -40, 10, 52, -13, -14, -39, -40, 10, - -14, 144, -90, 143, -80, -4, 144, 158, 29, -91, - 144, 158, 29, -91, 10, 29, 160, -28, -77, -7, - -31, -91, 79, 82, 60, 148, -8, 62, -78, 18, - 74, -11, 154, 155, 153, 152, 146, 146, -105, -95, - -95, -48, 144, 158, -109, 144, -109, 144, -27, -14, + -14, 144, -92, 143, -80, -4, 144, 158, 29, -93, + 144, 158, 29, -93, 10, 29, 160, -28, -77, -7, + -31, -93, 79, 82, 60, 148, -8, 62, -78, 18, + 74, -11, 154, 155, 153, 152, 146, 146, -107, -97, + -97, -48, 144, 158, -111, 144, -111, 144, -27, -14, 12, 146, -28, -14, 145, -14, 147, 158, 29, 29, - 147, 158, 160, 143, 146, -116, -117, -63, -62, 60, - 61, -45, -91, 79, 82, -88, 56, -45, 142, -122, - -45, -15, -19, -19, 91, 147, 158, 146, -91, -135, - -133, -132, -134, 148, -136, 57, 149, 149, -34, 10, - 13, 12, 10, 143, 148, 143, -137, -76, -138, -80, - 148, 142, -10, -14, -40, -91, -139, -40, 147, 158, + 147, 158, 160, 143, 146, -118, -119, -63, -62, 60, + 61, -45, -93, 79, 82, -90, 56, -45, 142, -124, + -45, -15, -19, -19, 91, 147, 158, 146, -93, -137, + -135, -134, -136, 148, -138, 57, 149, 149, -34, 10, + 13, 12, 10, 143, 148, 143, -139, -76, -140, -80, + 148, 142, -10, -14, -40, -93, -141, -40, 147, 158, 147, 147, 147, 149, 149, 147, -14, 151, -14, 151, 149, 149, 147, 158, 147, -17, -14, -80, -80, 149, 143, -80, -80, 143, 143, -5, 10, 29, -6, 10, 29, 10, -28, 148, 153, 152, 162, 131, 163, 164, 159, 151, 161, 132, 133, 167, 88, 89, 87, 130, 129, 134, 135, 136, 137, 165, 166, 138, 139, 150, - 82, -91, 146, -130, -131, -77, 17, 78, -77, -77, - -77, -77, -77, 147, -54, 93, 94, -106, 22, 144, - -108, -14, 143, 32, 33, -109, 31, -109, 143, 160, - -116, -14, 144, -56, -145, -19, 151, 59, -145, -57, - -25, 145, 10, -28, -113, 41, -116, 147, 158, -147, - 82, -91, 142, -122, -118, 158, -43, 160, -38, -102, - 148, -134, -136, -13, -139, 149, -14, -143, 148, 148, - -13, -14, 143, -142, -36, 58, -17, -17, -68, 10, + 82, -93, 146, -132, -133, -77, 17, 78, -77, -77, + -77, -77, -77, 147, -54, 93, 94, -108, 22, 144, + -110, -14, 143, 32, 33, -111, 31, -111, 143, 160, + -118, -14, 144, -56, -87, -19, 151, 59, -87, -57, + -25, 145, 10, -28, -115, 41, -118, 147, 158, -147, + 82, -93, 142, -124, -120, 158, -43, 160, -38, -104, + 148, -136, -138, -13, -141, 149, -14, -145, 148, 148, + -13, -14, 143, -144, -36, 58, -17, -17, -68, 10, 10, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, 145, -77, -91, - -130, 149, -151, 158, 58, 10, 52, 147, 144, -48, + -77, -77, -77, -77, -77, -77, -77, 145, -77, -93, + -132, 149, -151, 158, 58, 10, 52, 147, 144, -48, -25, -55, 93, 94, 144, 144, -14, -150, 145, 144, - 143, 144, 31, -28, 147, -146, 58, -19, 146, -146, - -95, 160, -58, 42, 146, 147, -104, 44, -63, -148, - 83, -91, -118, 143, -65, -119, -66, -67, -120, -128, + 143, 144, 31, -28, 147, -88, 58, -19, 146, -88, + -97, 160, -58, 42, 146, 147, -106, 44, -63, -148, + 83, -93, -120, 143, -65, -121, -66, -67, -122, -130, 47, 38, 44, -75, 103, 102, 101, 98, 99, 100, - -45, -79, -14, 147, -13, 149, -137, 149, -136, -13, - -13, 149, 143, -141, 57, -14, 151, 149, -77, 145, - 147, -77, -77, -25, 95, -48, 145, -108, -150, -95, - 144, -104, 147, -145, -102, 147, 28, -28, 142, -45, - 142, 142, 146, 12, 143, -121, 12, 144, 158, -1, - -75, 10, -124, -45, 149, 143, 149, 149, -139, -17, - -77, 58, 144, 145, -95, 147, -95, 142, -84, -25, - 145, 147, -84, 144, -95, 12, -95, -95, -103, 12, + -45, -79, -14, 147, -13, 149, -139, 149, -138, -13, + -13, 149, 143, -143, 57, -14, 151, 149, -77, 145, + 147, -77, -77, -25, 95, -48, 145, -110, -150, -97, + 144, -106, 147, -87, -104, 147, 28, -28, 142, -45, + 142, 142, 146, 12, 143, -123, 12, 144, 158, -1, + -75, 10, -126, -45, 149, 143, 149, 149, -141, -17, + -77, 58, 144, 145, -97, 147, -97, 142, -84, -25, + 145, 147, -84, 144, -97, 12, -97, -97, -105, 12, 151, 160, 144, 158, 160, 10, -147, 160, -81, 158, - 144, 142, -77, -95, -85, -25, 145, -95, -95, 143, + 144, 142, -77, -97, -85, -25, 145, -97, -97, 143, 147, 143, 143, 147, 158, 12, -28, 12, -28, 160, - 10, -28, -45, -125, -126, -69, -70, -71, -72, -73, - -45, 10, -95, 143, 26, 142, 12, 151, 160, -28, + 10, -28, -45, -127, -128, -69, -70, -71, -72, -73, + -45, 10, -97, 143, 26, 142, 12, 151, 160, -28, 146, 143, -69, 144, 144, 45, 29, 78, 24, 144, - -95, 12, -28, -116, -127, -45, -74, -75, 10, 144, - 143, 147, 158, 10, -114, -115, -59, 41, -83, 144, - 142, -45, -59, 146, -95, -45, 143, 12, 147, 142, - -95, 143, + -97, 12, -28, -118, -129, -45, -74, -75, 10, 144, + 143, 147, 158, 10, -116, -117, -59, 41, -83, 144, + 142, -45, -59, 146, -97, -45, 143, 12, 147, 142, + -97, 143, } var yyDef = [...]int{ @@ -2983,29 +2977,25 @@ yydefault: yyDollar = yyS[yypt-8 : yypt+1] //line php5/php5.y:803 { - if yyDollar[6].foreachVariable.node == nil { + if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { case *stmt.Foreach: n.Expr = yyDollar[3].node - n.ByRef = yyDollar[5].foreachVariable.byRef - n.Variable = yyDollar[5].foreachVariable.node + n.Variable = yyDollar[5].node case *stmt.AltForeach: n.Expr = yyDollar[3].node - n.ByRef = yyDollar[5].foreachVariable.byRef - n.Variable = yyDollar[5].foreachVariable.node + n.Variable = yyDollar[5].node } } else { switch n := yyDollar[8].node.(type) { case *stmt.Foreach: n.Expr = yyDollar[3].node - n.Key = yyDollar[5].foreachVariable.node - n.ByRef = yyDollar[6].foreachVariable.byRef - n.Variable = yyDollar[6].foreachVariable.node + n.Key = yyDollar[5].node + n.Variable = yyDollar[6].node case *stmt.AltForeach: n.Expr = yyDollar[3].node - n.Key = yyDollar[5].foreachVariable.node - n.ByRef = yyDollar[6].foreachVariable.byRef - n.Variable = yyDollar[6].foreachVariable.node + n.Key = yyDollar[5].node + n.Variable = yyDollar[6].node } } @@ -3016,31 +3006,27 @@ yydefault: } case 69: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:836 + //line php5/php5.y:832 { - if yyDollar[6].foreachVariable.node == nil { + if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { case *stmt.Foreach: n.Expr = yyDollar[3].node - n.ByRef = yyDollar[5].foreachVariable.byRef - n.Variable = yyDollar[5].foreachVariable.node + n.Variable = yyDollar[5].node case *stmt.AltForeach: n.Expr = yyDollar[3].node - n.ByRef = yyDollar[5].foreachVariable.byRef - n.Variable = yyDollar[5].foreachVariable.node + n.Variable = yyDollar[5].node } } else { switch n := yyDollar[8].node.(type) { case *stmt.Foreach: n.Expr = yyDollar[3].node - n.Key = yyDollar[5].foreachVariable.node - n.ByRef = yyDollar[6].foreachVariable.byRef - n.Variable = yyDollar[6].foreachVariable.node + n.Key = yyDollar[5].node + n.Variable = yyDollar[6].node case *stmt.AltForeach: n.Expr = yyDollar[3].node - n.Key = yyDollar[5].foreachVariable.node - n.ByRef = yyDollar[6].foreachVariable.byRef - n.Variable = yyDollar[6].foreachVariable.node + n.Key = yyDollar[5].node + n.Variable = yyDollar[6].node } } @@ -3051,7 +3037,7 @@ yydefault: } case 70: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:869 + //line php5/php5.y:861 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) @@ -3059,7 +3045,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:875 + //line php5/php5.y:867 { yyVAL.node = stmt.NewNop() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3067,7 +3053,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:881 + //line php5/php5.y:873 { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3081,7 +3067,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:893 + //line php5/php5.y:885 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -3089,7 +3075,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:899 + //line php5/php5.y:891 { label := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3101,13 +3087,13 @@ yydefault: } case 75: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:912 + //line php5/php5.y:904 { yyVAL.list = []node.Node{} } case 76: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:914 + //line php5/php5.y:906 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3125,13 +3111,13 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:932 + //line php5/php5.y:924 { yyVAL.node = nil } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:934 + //line php5/php5.y:926 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3139,31 +3125,31 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:943 + //line php5/php5.y:935 { yyVAL.list = yyDollar[1].list } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:945 + //line php5/php5.y:937 { yyVAL.list = []node.Node{} } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:950 + //line php5/php5.y:942 { yyVAL.list = []node.Node{yyDollar[1].node} } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:952 + //line php5/php5.y:944 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:957 + //line php5/php5.y:949 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3179,61 +3165,61 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:974 + //line php5/php5.y:966 { yyVAL.list = []node.Node{yyDollar[1].node} } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:976 + //line php5/php5.y:968 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:981 + //line php5/php5.y:973 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:986 + //line php5/php5.y:978 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:991 + //line php5/php5.y:983 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:996 + //line php5/php5.y:988 { yyVAL.token = nil } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:998 + //line php5/php5.y:990 { yyVAL.token = yyDollar[1].token } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1003 + //line php5/php5.y:995 { yyVAL.token = nil } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1005 + //line php5/php5.y:997 { yyVAL.token = yyDollar[1].token } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:1010 + //line php5/php5.y:1002 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3245,7 +3231,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:1023 + //line php5/php5.y:1015 { switch n := yyDollar[1].node.(type) { case *stmt.Class: @@ -3268,7 +3254,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1044 + //line php5/php5.y:1036 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3280,7 +3266,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1058 + //line php5/php5.y:1050 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3288,7 +3274,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1064 + //line php5/php5.y:1056 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3300,7 +3286,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1074 + //line php5/php5.y:1066 { yyVAL.node = stmt.NewTrait(nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3308,7 +3294,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1080 + //line php5/php5.y:1072 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3320,13 +3306,13 @@ yydefault: } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1093 + //line php5/php5.y:1085 { yyVAL.ClassExtends = nil } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1095 + //line php5/php5.y:1087 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3335,19 +3321,19 @@ yydefault: } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1105 + //line php5/php5.y:1097 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1110 + //line php5/php5.y:1102 { yyVAL.InterfaceExtends = nil } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1112 + //line php5/php5.y:1104 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -3356,13 +3342,13 @@ yydefault: } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1122 + //line php5/php5.y:1114 { yyVAL.ClassImplements = nil } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1124 + //line php5/php5.y:1116 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -3371,59 +3357,59 @@ yydefault: } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1134 + //line php5/php5.y:1126 { yyVAL.list = []node.Node{yyDollar[1].node} } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1136 + //line php5/php5.y:1128 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1141 + //line php5/php5.y:1133 { - yyVAL.foreachVariable = foreachVariable{nil, false} + yyVAL.node = nil } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1143 + //line php5/php5.y:1135 { - yyVAL.foreachVariable = yyDollar[2].foreachVariable + yyVAL.node = yyDollar[2].node } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1148 + //line php5/php5.y:1140 { - yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} + yyVAL.node = yyDollar[1].node } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1150 + //line php5/php5.y:1142 { - yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} + yyVAL.node = expr.NewReference(yyDollar[2].node) } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1152 + //line php5/php5.y:1144 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yyVAL.foreachVariable = foreachVariable{list, false} + yyVAL.node = list yylex.(*Parser).comments.AddComments(list, yyDollar[1].token.Comments()) } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1162 + //line php5/php5.y:1154 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1167 + //line php5/php5.y:1159 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -3433,30 +3419,30 @@ yydefault: } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1179 + //line php5/php5.y:1171 { - yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node, false) + yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1184 + //line php5/php5.y:1176 { stmtList := stmt.NewStmtList(yyDollar[2].list) - yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList, false) + yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1196 + //line php5/php5.y:1188 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1198 + //line php5/php5.y:1190 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3464,7 +3450,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1208 + //line php5/php5.y:1200 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3478,7 +3464,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1220 + //line php5/php5.y:1212 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3492,7 +3478,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1236 + //line php5/php5.y:1228 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3502,7 +3488,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1244 + //line php5/php5.y:1236 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3512,7 +3498,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1252 + //line php5/php5.y:1244 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -3522,7 +3508,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1260 + //line php5/php5.y:1252 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -3533,13 +3519,13 @@ yydefault: } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1273 + //line php5/php5.y:1265 { yyVAL.list = []node.Node{} } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1275 + //line php5/php5.y:1267 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) @@ -3548,7 +3534,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1282 + //line php5/php5.y:1274 { _default := stmt.NewDefault(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) @@ -3557,14 +3543,14 @@ yydefault: } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1299 + //line php5/php5.y:1291 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1304 + //line php5/php5.y:1296 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -3574,13 +3560,13 @@ yydefault: } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1317 + //line php5/php5.y:1309 { yyVAL.list = nil } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1319 + //line php5/php5.y:1311 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) @@ -3590,13 +3576,13 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1331 + //line php5/php5.y:1323 { yyVAL.list = nil } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1333 + //line php5/php5.y:1325 { stmts := stmt.NewStmtList(yyDollar[5].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[5].list)) @@ -3609,13 +3595,13 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1348 + //line php5/php5.y:1340 { yyVAL.node = nil } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1350 + //line php5/php5.y:1342 { yyVAL.node = stmt.NewElse(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3623,13 +3609,13 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1360 + //line php5/php5.y:1352 { yyVAL.node = nil } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1362 + //line php5/php5.y:1354 { stmts := stmt.NewStmtList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) @@ -3640,31 +3626,31 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1375 + //line php5/php5.y:1367 { yyVAL.list = yyDollar[1].list } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1377 + //line php5/php5.y:1369 { yyVAL.list = nil } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1382 + //line php5/php5.y:1374 { yyVAL.list = []node.Node{yyDollar[1].node} } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1384 + //line php5/php5.y:1376 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1389 + //line php5/php5.y:1381 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3692,7 +3678,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1415 + //line php5/php5.y:1407 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3720,13 +3706,13 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1445 + //line php5/php5.y:1437 { yyVAL.node = nil } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1447 + //line php5/php5.y:1439 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3734,7 +3720,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1453 + //line php5/php5.y:1445 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3742,13 +3728,13 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1459 + //line php5/php5.y:1451 { yyVAL.node = yyDollar[1].node } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1465 + //line php5/php5.y:1457 { yyVAL.node = node.NewArgumentList(nil) @@ -3757,7 +3743,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1472 + //line php5/php5.y:1464 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -3766,7 +3752,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1479 + //line php5/php5.y:1471 { arg := node.NewArgument(yyDollar[2].node, false, false) yyVAL.node = node.NewArgumentList([]node.Node{arg}) @@ -3777,19 +3763,19 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1492 + //line php5/php5.y:1484 { yyVAL.list = []node.Node{yyDollar[1].node} } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1494 + //line php5/php5.y:1486 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1499 + //line php5/php5.y:1491 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3797,7 +3783,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1505 + //line php5/php5.y:1497 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3805,7 +3791,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1511 + //line php5/php5.y:1503 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -3813,7 +3799,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1517 + //line php5/php5.y:1509 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3821,19 +3807,19 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1526 + //line php5/php5.y:1518 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1528 + //line php5/php5.y:1520 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1534 + //line php5/php5.y:1526 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3845,7 +3831,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1544 + //line php5/php5.y:1536 { yyVAL.node = expr.NewVariable(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3853,7 +3839,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1550 + //line php5/php5.y:1542 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3861,7 +3847,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1560 + //line php5/php5.y:1552 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3880,7 +3866,7 @@ yydefault: } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1577 + //line php5/php5.y:1569 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3899,7 +3885,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1594 + //line php5/php5.y:1586 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3918,7 +3904,7 @@ yydefault: } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1611 + //line php5/php5.y:1603 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3937,19 +3923,19 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1633 + //line php5/php5.y:1625 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1635 + //line php5/php5.y:1627 { yyVAL.list = []node.Node{} } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1641 + //line php5/php5.y:1633 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) @@ -3957,19 +3943,19 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1647 + //line php5/php5.y:1639 { yyVAL.node = yyDollar[1].node } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1649 + //line php5/php5.y:1641 { yyVAL.node = yyDollar[1].node } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1651 + //line php5/php5.y:1643 { name := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3987,7 +3973,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1670 + //line php5/php5.y:1662 { var adaptationList *stmt.TraitAdaptationList switch n := yyDollar[3].node.(type) { @@ -4003,19 +3989,19 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1687 + //line php5/php5.y:1679 { yyVAL.list = []node.Node{yyDollar[1].node} } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1689 + //line php5/php5.y:1681 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1694 + //line php5/php5.y:1686 { yyVAL.node = stmt.NewNop() @@ -4023,7 +4009,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1700 + //line php5/php5.y:1692 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4031,43 +4017,43 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1709 + //line php5/php5.y:1701 { yyVAL.list = nil } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1711 + //line php5/php5.y:1703 { yyVAL.list = yyDollar[1].list } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1716 + //line php5/php5.y:1708 { yyVAL.list = []node.Node{yyDollar[1].node} } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1718 + //line php5/php5.y:1710 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1723 + //line php5/php5.y:1715 { yyVAL.node = yyDollar[1].node } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1725 + //line php5/php5.y:1717 { yyVAL.node = yyDollar[1].node } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1730 + //line php5/php5.y:1722 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) @@ -4075,19 +4061,19 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1739 + //line php5/php5.y:1731 { yyVAL.list = []node.Node{yyDollar[1].node} } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1741 + //line php5/php5.y:1733 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1746 + //line php5/php5.y:1738 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4099,13 +4085,13 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1756 + //line php5/php5.y:1748 { yyVAL.node = yyDollar[1].node } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1761 + //line php5/php5.y:1753 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4117,7 +4103,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1774 + //line php5/php5.y:1766 { alias := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -4129,7 +4115,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1784 + //line php5/php5.y:1776 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4137,19 +4123,19 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1793 + //line php5/php5.y:1785 { yyVAL.node = nil } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1795 + //line php5/php5.y:1787 { yyVAL.node = yyDollar[1].node } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1800 + //line php5/php5.y:1792 { yyVAL.node = stmt.NewNop() @@ -4157,7 +4143,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1806 + //line php5/php5.y:1798 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -4165,13 +4151,13 @@ yydefault: } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1815 + //line php5/php5.y:1807 { yyVAL.list = yyDollar[1].list } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1817 + //line php5/php5.y:1809 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4181,31 +4167,31 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1828 + //line php5/php5.y:1820 { yyVAL.list = nil } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1830 + //line php5/php5.y:1822 { yyVAL.list = yyDollar[1].list } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1835 + //line php5/php5.y:1827 { yyVAL.list = []node.Node{yyDollar[1].node} } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1837 + //line php5/php5.y:1829 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 204: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1842 + //line php5/php5.y:1834 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4213,7 +4199,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1848 + //line php5/php5.y:1840 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4221,7 +4207,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1854 + //line php5/php5.y:1846 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4229,7 +4215,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1860 + //line php5/php5.y:1852 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4237,7 +4223,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1866 + //line php5/php5.y:1858 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4245,7 +4231,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1872 + //line php5/php5.y:1864 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4253,7 +4239,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1881 + //line php5/php5.y:1873 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4271,7 +4257,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1897 + //line php5/php5.y:1889 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4289,7 +4275,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1913 + //line php5/php5.y:1905 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4307,7 +4293,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1929 + //line php5/php5.y:1921 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4325,7 +4311,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1948 + //line php5/php5.y:1940 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4342,7 +4328,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1963 + //line php5/php5.y:1955 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -4358,55 +4344,55 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1980 + //line php5/php5.y:1972 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1982 + //line php5/php5.y:1974 { yyVAL.list = []node.Node{yyDollar[1].node} } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1988 + //line php5/php5.y:1980 { yyVAL.list = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1990 + //line php5/php5.y:1982 { yyVAL.list = yyDollar[1].list } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1995 + //line php5/php5.y:1987 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1997 + //line php5/php5.y:1989 { yyVAL.list = []node.Node{yyDollar[1].node} } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2002 + //line php5/php5.y:1994 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2004 + //line php5/php5.y:1996 { yyVAL.list = yyDollar[1].list } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2009 + //line php5/php5.y:2001 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -4415,7 +4401,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2016 + //line php5/php5.y:2008 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -4424,37 +4410,37 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2026 + //line php5/php5.y:2018 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2028 + //line php5/php5.y:2020 { yyVAL.list = yyDollar[1].list } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2030 + //line php5/php5.y:2022 { yyVAL.list = yyDollar[1].list } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2035 + //line php5/php5.y:2027 { yyVAL.list = nil } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2037 + //line php5/php5.y:2029 { yyVAL.list = yyDollar[1].list } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2042 + //line php5/php5.y:2034 { if yyDollar[3].node != nil { @@ -4469,7 +4455,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:2058 + //line php5/php5.y:2050 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -4481,7 +4467,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2068 + //line php5/php5.y:2060 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4489,7 +4475,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2074 + //line php5/php5.y:2066 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4497,7 +4483,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:2080 + //line php5/php5.y:2072 { var _new *expr.New @@ -4516,7 +4502,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2097 + //line php5/php5.y:2089 { yyVAL.node = expr.NewClone(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4524,7 +4510,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2103 + //line php5/php5.y:2095 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4532,7 +4518,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2109 + //line php5/php5.y:2101 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4540,7 +4526,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2115 + //line php5/php5.y:2107 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4548,7 +4534,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2121 + //line php5/php5.y:2113 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4556,7 +4542,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2127 + //line php5/php5.y:2119 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4564,7 +4550,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2133 + //line php5/php5.y:2125 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4572,7 +4558,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2139 + //line php5/php5.y:2131 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4580,7 +4566,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2145 + //line php5/php5.y:2137 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4588,7 +4574,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2151 + //line php5/php5.y:2143 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4596,7 +4582,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2157 + //line php5/php5.y:2149 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4604,7 +4590,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2163 + //line php5/php5.y:2155 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4612,7 +4598,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2169 + //line php5/php5.y:2161 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4620,7 +4606,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2175 + //line php5/php5.y:2167 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4628,7 +4614,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2181 + //line php5/php5.y:2173 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4636,7 +4622,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2187 + //line php5/php5.y:2179 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4644,7 +4630,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2193 + //line php5/php5.y:2185 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4652,7 +4638,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2199 + //line php5/php5.y:2191 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4660,7 +4646,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2205 + //line php5/php5.y:2197 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4668,7 +4654,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2211 + //line php5/php5.y:2203 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4676,7 +4662,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2217 + //line php5/php5.y:2209 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4684,7 +4670,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2223 + //line php5/php5.y:2215 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4692,7 +4678,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2229 + //line php5/php5.y:2221 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4700,7 +4686,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2235 + //line php5/php5.y:2227 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4708,7 +4694,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2241 + //line php5/php5.y:2233 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4716,7 +4702,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2247 + //line php5/php5.y:2239 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4724,7 +4710,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2253 + //line php5/php5.y:2245 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4732,7 +4718,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2259 + //line php5/php5.y:2251 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4740,7 +4726,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2265 + //line php5/php5.y:2257 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4748,7 +4734,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2271 + //line php5/php5.y:2263 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4756,7 +4742,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2277 + //line php5/php5.y:2269 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4764,7 +4750,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2283 + //line php5/php5.y:2275 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4772,7 +4758,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2289 + //line php5/php5.y:2281 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4780,7 +4766,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2295 + //line php5/php5.y:2287 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4788,7 +4774,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2301 + //line php5/php5.y:2293 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4796,7 +4782,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2307 + //line php5/php5.y:2299 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4804,7 +4790,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2313 + //line php5/php5.y:2305 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4812,7 +4798,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2319 + //line php5/php5.y:2311 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4820,7 +4806,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2325 + //line php5/php5.y:2317 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4828,7 +4814,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2331 + //line php5/php5.y:2323 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4836,7 +4822,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2337 + //line php5/php5.y:2329 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4844,7 +4830,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2343 + //line php5/php5.y:2335 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4852,7 +4838,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2349 + //line php5/php5.y:2341 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4860,7 +4846,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2355 + //line php5/php5.y:2347 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4868,7 +4854,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2361 + //line php5/php5.y:2353 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4876,7 +4862,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2367 + //line php5/php5.y:2359 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4884,7 +4870,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2373 + //line php5/php5.y:2365 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4892,19 +4878,19 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2379 + //line php5/php5.y:2371 { yyVAL.node = yyDollar[1].node } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2381 + //line php5/php5.y:2373 { yyVAL.node = yyDollar[1].node } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2383 + //line php5/php5.y:2375 { yyVAL.node = yyDollar[2].node @@ -4932,7 +4918,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2409 + //line php5/php5.y:2401 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -4940,7 +4926,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2415 + //line php5/php5.y:2407 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4948,13 +4934,13 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2421 + //line php5/php5.y:2413 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2423 + //line php5/php5.y:2415 { yyVAL.node = cast.NewInt(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4962,7 +4948,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2429 + //line php5/php5.y:2421 { yyVAL.node = cast.NewDouble(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4970,7 +4956,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2435 + //line php5/php5.y:2427 { yyVAL.node = cast.NewString(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4978,7 +4964,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2441 + //line php5/php5.y:2433 { yyVAL.node = cast.NewArray(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4986,7 +4972,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2447 + //line php5/php5.y:2439 { yyVAL.node = cast.NewObject(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4994,7 +4980,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2453 + //line php5/php5.y:2445 { yyVAL.node = cast.NewBool(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5002,7 +4988,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2459 + //line php5/php5.y:2451 { yyVAL.node = cast.NewUnset(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5010,7 +4996,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2465 + //line php5/php5.y:2457 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -5022,7 +5008,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2475 + //line php5/php5.y:2467 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5030,25 +5016,25 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2481 + //line php5/php5.y:2473 { yyVAL.node = yyDollar[1].node } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2483 + //line php5/php5.y:2475 { yyVAL.node = yyDollar[1].node } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2485 + //line php5/php5.y:2477 { yyVAL.node = yyDollar[1].node } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2487 + //line php5/php5.y:2479 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5056,7 +5042,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2493 + //line php5/php5.y:2485 { yyVAL.node = expr.NewPrint(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5064,7 +5050,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2499 + //line php5/php5.y:2491 { yyVAL.node = expr.NewYield(nil, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5072,7 +5058,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:2505 + //line php5/php5.y:2497 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].list, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) @@ -5081,7 +5067,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:2512 + //line php5/php5.y:2504 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) @@ -5090,7 +5076,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2522 + //line php5/php5.y:2514 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5098,7 +5084,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2528 + //line php5/php5.y:2520 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5106,7 +5092,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2534 + //line php5/php5.y:2526 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5114,7 +5100,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2540 + //line php5/php5.y:2532 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5122,7 +5108,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2549 + //line php5/php5.y:2541 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5130,7 +5116,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2555 + //line php5/php5.y:2547 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5138,7 +5124,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2561 + //line php5/php5.y:2553 { str := scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(str, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5150,7 +5136,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2571 + //line php5/php5.y:2563 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5158,7 +5144,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2580 + //line php5/php5.y:2572 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5166,7 +5152,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2586 + //line php5/php5.y:2578 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5174,25 +5160,25 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2595 + //line php5/php5.y:2587 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2600 + //line php5/php5.y:2592 { yyVAL.list = []node.Node{} } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2602 + //line php5/php5.y:2594 { yyVAL.list = yyDollar[3].list } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2607 + //line php5/php5.y:2599 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5202,7 +5188,7 @@ yydefault: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).comments.AddComments(variable, yyDollar[3].token.Comments()) - use := expr.NewClosureUse(variable, false) + use := expr.NewClosureUse(variable) yylex.(*Parser).positions.AddPosition(use, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).comments.AddComments(use, yyDollar[3].token.Comments()) @@ -5210,7 +5196,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2623 + //line php5/php5.y:2615 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -5220,7 +5206,9 @@ yydefault: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yylex.(*Parser).comments.AddComments(variable, yyDollar[3].token.Comments()) - use := expr.NewClosureUse(variable, true) + reference := expr.NewReference(variable) + + use := expr.NewClosureUse(reference) yylex.(*Parser).positions.AddPosition(use, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[4].token)) yylex.(*Parser).comments.AddComments(use, yyDollar[3].token.Comments()) @@ -5228,7 +5216,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2639 + //line php5/php5.y:2633 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5238,7 +5226,7 @@ yydefault: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - use := expr.NewClosureUse(variable, false) + use := expr.NewClosureUse(variable) yylex.(*Parser).positions.AddPosition(use, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).comments.AddComments(use, yyDollar[1].token.Comments()) @@ -5246,7 +5234,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2655 + //line php5/php5.y:2649 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5256,7 +5244,9 @@ yydefault: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - use := expr.NewClosureUse(variable, true) + reference := expr.NewReference(variable) + + use := expr.NewClosureUse(reference) yylex.(*Parser).positions.AddPosition(use, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) yylex.(*Parser).comments.AddComments(use, yyDollar[1].token.Comments()) @@ -5264,7 +5254,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2674 + //line php5/php5.y:2670 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5276,7 +5266,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2684 + //line php5/php5.y:2680 { funcName := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5288,7 +5278,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2694 + //line php5/php5.y:2690 { funcName := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5300,7 +5290,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2704 + //line php5/php5.y:2700 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5308,7 +5298,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2710 + //line php5/php5.y:2706 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5316,7 +5306,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2716 + //line php5/php5.y:2712 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5324,7 +5314,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2722 + //line php5/php5.y:2718 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5332,7 +5322,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2728 + //line php5/php5.y:2724 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) @@ -5340,7 +5330,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2737 + //line php5/php5.y:2733 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5348,7 +5338,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2743 + //line php5/php5.y:2739 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5356,7 +5346,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2749 + //line php5/php5.y:2745 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5364,7 +5354,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2755 + //line php5/php5.y:2751 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5372,7 +5362,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2764 + //line php5/php5.y:2760 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5380,7 +5370,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2770 + //line php5/php5.y:2766 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5388,7 +5378,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2776 + //line php5/php5.y:2772 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5396,19 +5386,19 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2785 + //line php5/php5.y:2781 { yyVAL.node = yyDollar[1].node } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2787 + //line php5/php5.y:2783 { yyVAL.node = yyDollar[1].node } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2792 + //line php5/php5.y:2788 { yyVAL.node = yyDollar[1].node @@ -5446,79 +5436,79 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2828 + //line php5/php5.y:2824 { yyVAL.node = yyDollar[1].node } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2834 + //line php5/php5.y:2830 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2836 + //line php5/php5.y:2832 { yyVAL.list = []node.Node{} } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2842 + //line php5/php5.y:2838 { yyVAL.list = yyDollar[2].list } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2847 + //line php5/php5.y:2843 { yyVAL.node = nil } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2849 + //line php5/php5.y:2845 { yyVAL.node = nil } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2851 + //line php5/php5.y:2847 { yyVAL.node = yyDollar[1].node } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2856 + //line php5/php5.y:2852 { yyVAL.list = []node.Node{} } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2858 + //line php5/php5.y:2854 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2860 + //line php5/php5.y:2856 { yyVAL.list = yyDollar[1].list } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2865 + //line php5/php5.y:2861 { yyVAL.node = nil } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2867 + //line php5/php5.y:2863 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2872 + //line php5/php5.y:2868 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5526,7 +5516,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2878 + //line php5/php5.y:2874 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5534,7 +5524,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2884 + //line php5/php5.y:2880 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5542,7 +5532,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2890 + //line php5/php5.y:2886 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5550,7 +5540,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2896 + //line php5/php5.y:2892 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5558,7 +5548,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2902 + //line php5/php5.y:2898 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5566,7 +5556,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2908 + //line php5/php5.y:2904 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5574,7 +5564,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2914 + //line php5/php5.y:2910 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5582,7 +5572,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2920 + //line php5/php5.y:2916 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5590,7 +5580,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2926 + //line php5/php5.y:2922 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5598,7 +5588,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2932 + //line php5/php5.y:2928 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5610,7 +5600,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2942 + //line php5/php5.y:2938 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -5618,7 +5608,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2951 + //line php5/php5.y:2947 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5630,25 +5620,25 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2964 + //line php5/php5.y:2960 { yyVAL.node = yyDollar[1].node } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2969 + //line php5/php5.y:2965 { yyVAL.node = yyDollar[1].node } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2971 + //line php5/php5.y:2967 { yyVAL.node = yyDollar[1].node } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2973 + //line php5/php5.y:2969 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5660,7 +5650,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2983 + //line php5/php5.y:2979 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5672,7 +5662,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2993 + //line php5/php5.y:2989 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5684,7 +5674,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3003 + //line php5/php5.y:2999 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5692,7 +5682,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3009 + //line php5/php5.y:3005 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5700,13 +5690,13 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3015 + //line php5/php5.y:3011 { yyVAL.node = yyDollar[1].node } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3017 + //line php5/php5.y:3013 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5714,13 +5704,13 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3023 + //line php5/php5.y:3019 { yyVAL.node = yyDollar[1].node } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3028 + //line php5/php5.y:3024 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5728,7 +5718,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3034 + //line php5/php5.y:3030 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5736,7 +5726,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3040 + //line php5/php5.y:3036 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5744,7 +5734,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3046 + //line php5/php5.y:3042 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5752,7 +5742,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3052 + //line php5/php5.y:3048 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5760,7 +5750,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3058 + //line php5/php5.y:3054 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5768,7 +5758,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3064 + //line php5/php5.y:3060 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5776,7 +5766,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3070 + //line php5/php5.y:3066 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5784,7 +5774,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3076 + //line php5/php5.y:3072 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5792,7 +5782,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3082 + //line php5/php5.y:3078 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5800,7 +5790,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3088 + //line php5/php5.y:3084 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5808,7 +5798,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3094 + //line php5/php5.y:3090 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5816,7 +5806,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3100 + //line php5/php5.y:3096 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5824,7 +5814,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3106 + //line php5/php5.y:3102 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5832,7 +5822,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3112 + //line php5/php5.y:3108 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5840,7 +5830,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3118 + //line php5/php5.y:3114 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5848,7 +5838,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3124 + //line php5/php5.y:3120 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5856,7 +5846,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3130 + //line php5/php5.y:3126 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5864,7 +5854,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3136 + //line php5/php5.y:3132 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5872,7 +5862,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3142 + //line php5/php5.y:3138 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5880,7 +5870,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3148 + //line php5/php5.y:3144 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5888,7 +5878,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3154 + //line php5/php5.y:3150 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5896,7 +5886,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3160 + //line php5/php5.y:3156 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5904,7 +5894,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3166 + //line php5/php5.y:3162 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5912,7 +5902,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3172 + //line php5/php5.y:3168 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5920,7 +5910,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3178 + //line php5/php5.y:3174 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5928,7 +5918,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3184 + //line php5/php5.y:3180 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5936,7 +5926,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3190 + //line php5/php5.y:3186 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5944,7 +5934,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3196 + //line php5/php5.y:3192 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5952,7 +5942,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3202 + //line php5/php5.y:3198 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -5960,7 +5950,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3208 + //line php5/php5.y:3204 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5968,7 +5958,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3214 + //line php5/php5.y:3210 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5976,19 +5966,19 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3220 + //line php5/php5.y:3216 { yyVAL.node = yyDollar[2].node } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3225 + //line php5/php5.y:3221 { yyVAL.node = yyDollar[1].node } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3227 + //line php5/php5.y:3223 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -6000,7 +5990,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3237 + //line php5/php5.y:3233 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -6012,7 +6002,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3247 + //line php5/php5.y:3243 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -6024,7 +6014,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3260 + //line php5/php5.y:3256 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6036,25 +6026,25 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3270 + //line php5/php5.y:3266 { yyVAL.node = yyDollar[1].node } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3272 + //line php5/php5.y:3268 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3274 + //line php5/php5.y:3270 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3276 + //line php5/php5.y:3272 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6062,7 +6052,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3282 + //line php5/php5.y:3278 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6070,7 +6060,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3288 + //line php5/php5.y:3284 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6078,21 +6068,21 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3297 + //line php5/php5.y:3293 { yyVAL.list = nil } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3299 + //line php5/php5.y:3295 { yyVAL.list = yyDollar[1].list } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3309 + //line php5/php5.y:3305 { - arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) + arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[3].node]) @@ -6100,9 +6090,9 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3317 + //line php5/php5.y:3313 { - arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) + arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[3].node]) @@ -6110,9 +6100,9 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3325 + //line php5/php5.y:3321 { - arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) + arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[1].node]) @@ -6120,9 +6110,9 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3333 + //line php5/php5.y:3329 { - arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) + arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[1].node]) @@ -6130,49 +6120,49 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3344 + //line php5/php5.y:3340 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3346 + //line php5/php5.y:3342 { yyVAL.node = yyDollar[1].node } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3351 + //line php5/php5.y:3347 { yyVAL.node = yyDollar[2].node } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3353 + //line php5/php5.y:3349 { yyVAL.node = yyDollar[2].node } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3359 + //line php5/php5.y:3355 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3365 + //line php5/php5.y:3361 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3370 + //line php5/php5.y:3366 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3375 + //line php5/php5.y:3371 { yyVAL.node = yyDollar[1].node @@ -6227,25 +6217,25 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3428 + //line php5/php5.y:3424 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3433 + //line php5/php5.y:3429 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3435 + //line php5/php5.y:3431 { yyVAL.list = []node.Node{} } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3441 + //line php5/php5.y:3437 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -6256,7 +6246,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3453 + //line php5/php5.y:3449 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6265,7 +6255,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3460 + //line php5/php5.y:3456 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6274,38 +6264,38 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3470 + //line php5/php5.y:3466 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3478 + //line php5/php5.y:3474 { yyVAL.list = []node.Node{yyDollar[1].node} } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3480 + //line php5/php5.y:3476 { yyVAL.list = yyDollar[1].list } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3482 + //line php5/php5.y:3478 { yyVAL.list = nil } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3487 + //line php5/php5.y:3483 { yyVAL.node = yyDollar[1].node } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3489 + //line php5/php5.y:3485 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6317,7 +6307,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3502 + //line php5/php5.y:3498 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6325,7 +6315,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3508 + //line php5/php5.y:3504 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6333,13 +6323,13 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3518 + //line php5/php5.y:3514 { yyVAL.node = yyDollar[1].node } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3523 + //line php5/php5.y:3519 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6347,7 +6337,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3529 + //line php5/php5.y:3525 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6355,31 +6345,31 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3537 + //line php5/php5.y:3533 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3538 + //line php5/php5.y:3534 { yyVAL.node = yyDollar[1].node } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3539 + //line php5/php5.y:3535 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3545 + //line php5/php5.y:3541 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3547 + //line php5/php5.y:3543 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6391,13 +6381,13 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3557 + //line php5/php5.y:3553 { yyVAL.node = yyDollar[1].node } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3562 + //line php5/php5.y:3558 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6405,7 +6395,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3568 + //line php5/php5.y:3564 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6413,13 +6403,13 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3574 + //line php5/php5.y:3570 { yyVAL.node = yyDollar[1].node } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3580 + //line php5/php5.y:3576 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6431,7 +6421,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3590 + //line php5/php5.y:3586 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6439,25 +6429,25 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3599 + //line php5/php5.y:3595 { yyVAL.node = nil } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3601 + //line php5/php5.y:3597 { yyVAL.node = yyDollar[1].node } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3607 + //line php5/php5.y:3603 { yyVAL.list = yyDollar[1].list } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3609 + //line php5/php5.y:3605 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6466,7 +6456,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3619 + //line php5/php5.y:3615 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6475,7 +6465,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3626 + //line php5/php5.y:3622 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6484,7 +6474,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3633 + //line php5/php5.y:3629 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6493,7 +6483,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3643 + //line php5/php5.y:3639 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6501,13 +6491,13 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3649 + //line php5/php5.y:3645 { yyVAL.node = yyDollar[2].node } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3654 + //line php5/php5.y:3650 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6517,7 +6507,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3662 + //line php5/php5.y:3658 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6531,13 +6521,13 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3677 + //line php5/php5.y:3673 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3679 + //line php5/php5.y:3675 { if yyDollar[1].node == nil { yyVAL.list = []node.Node{} @@ -6547,47 +6537,47 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3691 + //line php5/php5.y:3687 { - yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) + yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3697 + //line php5/php5.y:3693 { item := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) yylex.(*Parser).comments.AddComments(item, yyDollar[1].token.Comments()) - yyVAL.node = expr.NewArrayItem(nil, item, false) + yyVAL.node = expr.NewArrayItem(nil, item) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(item)) yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[item]) } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3707 + //line php5/php5.y:3703 { yyVAL.node = nil } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3713 + //line php5/php5.y:3709 { yyVAL.list = []node.Node{} } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3715 + //line php5/php5.y:3711 { yyVAL.list = yyDollar[1].list } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3720 + //line php5/php5.y:3716 { - arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node, false) + arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[3].node]) @@ -6595,9 +6585,9 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3728 + //line php5/php5.y:3724 { - arrayItem := expr.NewArrayItem(nil, yyDollar[3].node, false) + arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[3].node]) @@ -6605,9 +6595,9 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3736 + //line php5/php5.y:3732 { - arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) + arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[1].node]) @@ -6615,9 +6605,9 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3744 + //line php5/php5.y:3740 { - arrayItem := expr.NewArrayItem(nil, yyDollar[1].node, false) + arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[1].node]) @@ -6625,9 +6615,10 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3752 + //line php5/php5.y:3748 { - arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[6].node, true) + reference := expr.NewReference(yyDollar[6].node) + arrayItem := expr.NewArrayItem(yyDollar[3].node, reference) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[3].node]) @@ -6635,9 +6626,10 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3760 + //line php5/php5.y:3757 { - arrayItem := expr.NewArrayItem(nil, yyDollar[4].node, true) + reference := expr.NewReference(yyDollar[4].node) + arrayItem := expr.NewArrayItem(nil, reference) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) yylex.(*Parser).comments.AddComments(arrayItem, yyDollar[3].token.Comments()) @@ -6645,9 +6637,10 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3768 + //line php5/php5.y:3766 { - arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) + reference := expr.NewReference(yyDollar[4].node) + arrayItem := expr.NewArrayItem(yyDollar[1].node, reference) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[1].node]) @@ -6655,9 +6648,10 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3776 + //line php5/php5.y:3775 { - arrayItem := expr.NewArrayItem(nil, yyDollar[2].node, true) + reference := expr.NewReference(yyDollar[2].node) + arrayItem := expr.NewArrayItem(nil, reference) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) yylex.(*Parser).comments.AddComments(arrayItem, yyDollar[1].token.Comments()) diff --git a/php5/php5.y b/php5/php5.y index 704f4a1..3687f9f 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -22,7 +22,6 @@ import ( node node.Node token *scanner.Token list []node.Node - foreachVariable foreachVariable simpleIndirectReference simpleIndirectReference ClassExtends *stmt.ClassExtends @@ -248,6 +247,8 @@ import ( %type switch_case_list %type method_body %type foreach_statement for_statement while_statement +%type foreach_variable foreach_optional_arg + %type extends_from %type implements_list %type interface_extends_list @@ -266,7 +267,6 @@ import ( %type dynamic_class_name_variable_properties variable_properties %type simple_indirect_reference -%type foreach_variable foreach_optional_arg %type is_reference is_variadic %% @@ -801,29 +801,25 @@ unticked_statement: } | T_FOREACH '(' variable T_AS foreach_variable foreach_optional_arg ')' foreach_statement { - if $6.node == nil { + if $6 == nil { switch n := $8.(type) { case *stmt.Foreach : n.Expr = $3 - n.ByRef = $5.byRef - n.Variable = $5.node + n.Variable = $5 case *stmt.AltForeach : n.Expr = $3 - n.ByRef = $5.byRef - n.Variable = $5.node + n.Variable = $5 } } else { switch n := $8.(type) { case *stmt.Foreach : n.Expr = $3 - n.Key = $5.node - n.ByRef = $6.byRef - n.Variable = $6.node + n.Key = $5 + n.Variable = $6 case *stmt.AltForeach : n.Expr = $3 - n.Key = $5.node - n.ByRef = $6.byRef - n.Variable = $6.node + n.Key = $5 + n.Variable = $6 } } @@ -834,29 +830,25 @@ unticked_statement: } | T_FOREACH '(' expr_without_variable T_AS foreach_variable foreach_optional_arg ')' foreach_statement { - if $6.node == nil { + if $6 == nil { switch n := $8.(type) { case *stmt.Foreach : n.Expr = $3 - n.ByRef = $5.byRef - n.Variable = $5.node + n.Variable = $5 case *stmt.AltForeach : n.Expr = $3 - n.ByRef = $5.byRef - n.Variable = $5.node + n.Variable = $5 } } else { switch n := $8.(type) { case *stmt.Foreach : n.Expr = $3 - n.Key = $5.node - n.ByRef = $6.byRef - n.Variable = $6.node + n.Key = $5 + n.Variable = $6 case *stmt.AltForeach : n.Expr = $3 - n.Key = $5.node - n.ByRef = $6.byRef - n.Variable = $6.node + n.Key = $5 + n.Variable = $6 } } @@ -1138,21 +1130,21 @@ interface_list: foreach_optional_arg: /* empty */ - { $$ = foreachVariable{nil, false} } + { $$ = nil } | T_DOUBLE_ARROW foreach_variable { $$ = $2 } ; foreach_variable: variable - { $$ = foreachVariable{$1, false} } + { $$ = $1 } | '&' variable - { $$ = foreachVariable{$2, true} } + { $$ = expr.NewReference($2) } | T_LIST '(' assignment_list ')' { list := expr.NewList($3) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - $$ = foreachVariable{list, false} + $$ = list yylex.(*Parser).comments.AddComments(list, $1.Comments()) } ; @@ -1177,13 +1169,13 @@ for_statement: foreach_statement: statement { - $$ = stmt.NewForeach(nil, nil, nil, $1, false) + $$ = stmt.NewForeach(nil, nil, nil, $1) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) } | ':' inner_statement_list T_ENDFOREACH ';' { stmtList := stmt.NewStmtList($2) - $$ = stmt.NewAltForeach(nil, nil, nil, stmtList, false) + $$ = stmt.NewAltForeach(nil, nil, nil, stmtList) yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) @@ -2613,7 +2605,7 @@ lexical_var_list: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).comments.AddComments(variable, $3.Comments()) - use := expr.NewClosureUse(variable, false) + use := expr.NewClosureUse(variable) yylex.(*Parser).positions.AddPosition(use, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).comments.AddComments(use, $3.Comments()) @@ -2629,7 +2621,9 @@ lexical_var_list: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).comments.AddComments(variable, $3.Comments()) - use := expr.NewClosureUse(variable, true) + reference := expr.NewReference(variable) + + use := expr.NewClosureUse(reference) yylex.(*Parser).positions.AddPosition(use, yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) yylex.(*Parser).comments.AddComments(use, $3.Comments()) @@ -2645,7 +2639,7 @@ lexical_var_list: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - use := expr.NewClosureUse(variable, false) + use := expr.NewClosureUse(variable) yylex.(*Parser).positions.AddPosition(use, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).comments.AddComments(use, $1.Comments()) @@ -2661,7 +2655,9 @@ lexical_var_list: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - use := expr.NewClosureUse(variable, true) + reference := expr.NewReference(variable) + + use := expr.NewClosureUse(reference) yylex.(*Parser).positions.AddPosition(use, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) yylex.(*Parser).comments.AddComments(use, $1.Comments()) @@ -3307,7 +3303,7 @@ possible_comma: non_empty_static_array_pair_list: non_empty_static_array_pair_list ',' static_scalar_value T_DOUBLE_ARROW static_scalar_value { - arrayItem := expr.NewArrayItem($3, $5, false) + arrayItem := expr.NewArrayItem($3, $5) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$3]) @@ -3315,7 +3311,7 @@ non_empty_static_array_pair_list: } | non_empty_static_array_pair_list ',' static_scalar_value { - arrayItem := expr.NewArrayItem(nil, $3, false) + arrayItem := expr.NewArrayItem(nil, $3) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition($3)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$3]) @@ -3323,7 +3319,7 @@ non_empty_static_array_pair_list: } | static_scalar_value T_DOUBLE_ARROW static_scalar_value { - arrayItem := expr.NewArrayItem($1, $3, false) + arrayItem := expr.NewArrayItem($1, $3) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$1]) @@ -3331,7 +3327,7 @@ non_empty_static_array_pair_list: } | static_scalar_value { - arrayItem := expr.NewArrayItem(nil, $1, false) + arrayItem := expr.NewArrayItem(nil, $1) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$1]) @@ -3689,7 +3685,7 @@ assignment_list: assignment_list_element: variable { - $$ = expr.NewArrayItem(nil, $1, false) + $$ = expr.NewArrayItem(nil, $1) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) } @@ -3699,7 +3695,7 @@ assignment_list_element: yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) yylex.(*Parser).comments.AddComments(item, $1.Comments()) - $$ = expr.NewArrayItem(nil, item, false) + $$ = expr.NewArrayItem(nil, item) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition(item)) yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[item]) } @@ -3718,7 +3714,7 @@ array_pair_list: non_empty_array_pair_list: non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { - arrayItem := expr.NewArrayItem($3, $5, false) + arrayItem := expr.NewArrayItem($3, $5) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$3]) @@ -3726,7 +3722,7 @@ non_empty_array_pair_list: } | non_empty_array_pair_list ',' expr { - arrayItem := expr.NewArrayItem(nil, $3, false) + arrayItem := expr.NewArrayItem(nil, $3) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition($3)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$3]) @@ -3734,7 +3730,7 @@ non_empty_array_pair_list: } | expr T_DOUBLE_ARROW expr { - arrayItem := expr.NewArrayItem($1, $3, false) + arrayItem := expr.NewArrayItem($1, $3) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$1]) @@ -3742,7 +3738,7 @@ non_empty_array_pair_list: } | expr { - arrayItem := expr.NewArrayItem(nil, $1, false) + arrayItem := expr.NewArrayItem(nil, $1) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition($1)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$1]) @@ -3750,7 +3746,8 @@ non_empty_array_pair_list: } | non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_variable { - arrayItem := expr.NewArrayItem($3, $6, true) + reference := expr.NewReference($6) + arrayItem := expr.NewArrayItem($3, reference) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($3, $6)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$3]) @@ -3758,7 +3755,8 @@ non_empty_array_pair_list: } | non_empty_array_pair_list ',' '&' w_variable { - arrayItem := expr.NewArrayItem(nil, $4, true) + reference := expr.NewReference($4) + arrayItem := expr.NewArrayItem(nil, reference) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) yylex.(*Parser).comments.AddComments(arrayItem, $3.Comments()) @@ -3766,7 +3764,8 @@ non_empty_array_pair_list: } | expr T_DOUBLE_ARROW '&' w_variable { - arrayItem := expr.NewArrayItem($1, $4, true) + reference := expr.NewReference($4) + arrayItem := expr.NewArrayItem($1, reference) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$1]) @@ -3774,7 +3773,8 @@ non_empty_array_pair_list: } | '&' w_variable { - arrayItem := expr.NewArrayItem(nil, $2, true) + reference := expr.NewReference($2) + arrayItem := expr.NewArrayItem(nil, reference) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) yylex.(*Parser).comments.AddComments(arrayItem, $1.Comments()) @@ -4014,11 +4014,6 @@ class_name_scalar: %% -type foreachVariable struct { - node node.Node - byRef bool -} - type simpleIndirectReference struct { all []*expr.Variable last *expr.Variable diff --git a/php5/php5_test.go b/php5/php5_test.go index 44de74c..a10fe16 100644 --- a/php5/php5_test.go +++ b/php5/php5_test.go @@ -1065,21 +1065,20 @@ func TestPhp5(t *testing.T) { Stmt: &stmt.StmtList{Stmts: []node.Node{}}, }, &stmt.Foreach{ - ByRef: true, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, + Variable: &expr.Reference{ + Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, + }, + Stmt: &stmt.StmtList{Stmts: []node.Node{}}, }, &stmt.Foreach{ - ByRef: false, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, Variable: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, }, }, }, @@ -1905,8 +1904,7 @@ func TestPhp5(t *testing.T) { Expr: &expr.Array{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, }, }, @@ -1915,13 +1913,11 @@ func TestPhp5(t *testing.T) { Expr: &expr.Array{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Key: &scalar.Lnumber{Value: "1"}, - Val: &scalar.Lnumber{Value: "1"}, + Key: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, &expr.ArrayItem{ - ByRef: true, - Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, }, }, }, @@ -1930,9 +1926,8 @@ func TestPhp5(t *testing.T) { Expr: &expr.Array{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: true, - Key: &scalar.Lnumber{Value: "3"}, - Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Key: &scalar.Lnumber{Value: "3"}, + Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, }, }, }, @@ -1941,22 +1936,18 @@ func TestPhp5(t *testing.T) { Expr: &expr.Array{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: true, - Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, }, &expr.ArrayItem{ - ByRef: false, - Key: &scalar.Lnumber{Value: "1"}, - Val: &scalar.Lnumber{Value: "1"}, + Key: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, &expr.ArrayItem{ - ByRef: false, - Val: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, &expr.ArrayItem{ - ByRef: true, - Key: &scalar.Lnumber{Value: "3"}, - Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Key: &scalar.Lnumber{Value: "3"}, + Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, }, }, }, @@ -2019,12 +2010,10 @@ func TestPhp5(t *testing.T) { }, Uses: []node.Node{ &expr.ClosureUse{ - ByRef: false, Variable: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, }, &expr.ClosureUse{ - ByRef: true, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}, + Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, }, }, Stmts: []node.Node{}, @@ -2049,11 +2038,9 @@ func TestPhp5(t *testing.T) { }, Uses: []node.Node{ &expr.ClosureUse{ - ByRef: true, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "c"}}}, }, &expr.ClosureUse{ - ByRef: false, Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}, }, }, @@ -2286,12 +2273,10 @@ func TestPhp5(t *testing.T) { Variable: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, }, &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, }, }, @@ -2303,7 +2288,6 @@ func TestPhp5(t *testing.T) { Variable: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, Val: &expr.ArrayDimFetch{ Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, }, @@ -2318,12 +2302,10 @@ func TestPhp5(t *testing.T) { Variable: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, Val: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, }, }, }, @@ -2450,8 +2432,7 @@ func TestPhp5(t *testing.T) { Expr: &expr.ShortArray{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, }, }, @@ -2460,13 +2441,11 @@ func TestPhp5(t *testing.T) { Expr: &expr.ShortArray{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Key: &scalar.Lnumber{Value: "1"}, - Val: &scalar.Lnumber{Value: "1"}, + Key: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, &expr.ArrayItem{ - ByRef: true, - Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, }, }, }, @@ -3025,12 +3004,10 @@ func TestPhp5(t *testing.T) { Variable: &expr.Array{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, Val: &expr.ShortArray{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &scalar.Lnumber{Value: "0"}, + Val: &scalar.Lnumber{Value: "0"}, }, }, }, @@ -3127,8 +3104,7 @@ func TestPhp5(t *testing.T) { Variable: &expr.ShortArray{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, }, }, @@ -3578,13 +3554,11 @@ func TestPhp5(t *testing.T) { Expr: &expr.Array{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Key: &scalar.Lnumber{Value: "1"}, - Val: &scalar.Lnumber{Value: "1"}, + Key: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, &expr.ArrayItem{ - ByRef: false, - Val: &scalar.Lnumber{Value: "2"}, + Val: &scalar.Lnumber{Value: "2"}, }, }, }, @@ -3599,13 +3573,11 @@ func TestPhp5(t *testing.T) { Variable: &expr.ShortArray{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, &expr.ArrayItem{ - ByRef: false, - Key: &scalar.Lnumber{Value: "2"}, - Val: &scalar.Lnumber{Value: "2"}, + Key: &scalar.Lnumber{Value: "2"}, + Val: &scalar.Lnumber{Value: "2"}, }, }, }, diff --git a/php7/php7.go b/php7/php7.go index f41d3b7..21da154 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -22,12 +22,11 @@ import ( //line php7/php7.y:22 type yySymType struct { - yys int - node node.Node - token *scanner.Token - list []node.Node - foreachVariable foreachVariable - str string + yys int + node node.Node + token *scanner.Token + list []node.Node + str string ClassExtends *stmt.ClassExtends ClassImplements *stmt.ClassImplements @@ -346,12 +345,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:4281 - -type foreachVariable struct { - node node.Node - byRef bool -} +//line php7/php7.y:4279 //line yacctab:1 var yyExca = [...]int{ @@ -2119,7 +2113,7 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:299 + //line php7/php7.y:298 { yylex.(*Parser).rootNode = node.NewRoot(yyDollar[1].list) @@ -2128,463 +2122,463 @@ yydefault: } case 2: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 3: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 5: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 10: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 11: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 12: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 13: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 14: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 15: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 16: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 17: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 18: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 21: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 22: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 23: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 24: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 27: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 28: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 29: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 30: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 33: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 34: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 35: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 36: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 37: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 38: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 39: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 44: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 46: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 47: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 48: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 49: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 50: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 51: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 52: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 53: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 54: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 55: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 56: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 57: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 58: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 59: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 60: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 61: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 62: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 63: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 64: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 66: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 67: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 68: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:314 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 69: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:318 { yyVAL.token = yyDollar[1].token } case 70: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 72: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 73: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 74: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 75: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:320 + //line php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 76: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:325 + //line php7/php7.y:324 { yyVAL.token = yyDollar[1].token } case 77: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:327 + //line php7/php7.y:326 { yyVAL.token = yyDollar[1].token } case 78: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:332 + //line php7/php7.y:331 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2592,13 +2586,13 @@ yydefault: } case 79: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:338 + //line php7/php7.y:337 { yyVAL.list = []node.Node{} } case 80: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:343 + //line php7/php7.y:342 { namePart := name.NewNamePart(yyDollar[1].token.Value) yyVAL.list = []node.Node{namePart} @@ -2611,7 +2605,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:354 + //line php7/php7.y:353 { namePart := name.NewNamePart(yyDollar[3].token.Value) yyVAL.list = append(yyDollar[1].list, namePart) @@ -2625,7 +2619,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:369 + //line php7/php7.y:368 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -2634,7 +2628,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:376 + //line php7/php7.y:375 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -2647,7 +2641,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:387 + //line php7/php7.y:386 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -2659,44 +2653,44 @@ yydefault: } case 85: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:400 + //line php7/php7.y:399 { // error yyVAL.node = nil } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:405 + //line php7/php7.y:404 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:407 + //line php7/php7.y:406 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:409 + //line php7/php7.y:408 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:411 + //line php7/php7.y:410 { yyVAL.node = yyDollar[1].node } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:413 + //line php7/php7.y:412 { yyVAL.node = yyDollar[1].node } case 91: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:415 + //line php7/php7.y:414 { yyVAL.node = stmt.NewHaltCompiler() @@ -2711,7 +2705,7 @@ yydefault: } case 92: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:428 + //line php7/php7.y:427 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2726,7 +2720,7 @@ yydefault: } case 93: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:441 + //line php7/php7.y:440 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2742,7 +2736,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:455 + //line php7/php7.y:454 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2756,7 +2750,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:467 + //line php7/php7.y:466 { yyVAL.node = yyDollar[2].node @@ -2769,7 +2763,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:478 + //line php7/php7.y:477 { yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) @@ -2782,7 +2776,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:489 + //line php7/php7.y:488 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2795,7 +2789,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:500 + //line php7/php7.y:499 { yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) @@ -2808,7 +2802,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:511 + //line php7/php7.y:510 { yyVAL.node = stmt.NewConstList(yyDollar[2].list) @@ -2821,7 +2815,7 @@ yydefault: } case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:525 + //line php7/php7.y:524 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2833,7 +2827,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:535 + //line php7/php7.y:534 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2845,7 +2839,7 @@ yydefault: } case 102: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:548 + //line php7/php7.y:547 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2864,7 +2858,7 @@ yydefault: } case 103: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:565 + //line php7/php7.y:564 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2884,7 +2878,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:586 + //line php7/php7.y:585 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2903,7 +2897,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:603 + //line php7/php7.y:602 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2923,19 +2917,19 @@ yydefault: } case 106: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:624 + //line php7/php7.y:623 { yyVAL.token = nil } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:626 + //line php7/php7.y:625 { yyVAL.token = yyDollar[1].token } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:631 + //line php7/php7.y:630 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2944,13 +2938,13 @@ yydefault: } case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:638 + //line php7/php7.y:637 { yyVAL.list = []node.Node{yyDollar[1].node} } case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:643 + //line php7/php7.y:642 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2959,13 +2953,13 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:650 + //line php7/php7.y:649 { yyVAL.list = []node.Node{yyDollar[1].node} } case 112: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:655 + //line php7/php7.y:654 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2974,25 +2968,25 @@ yydefault: } case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:662 + //line php7/php7.y:661 { yyVAL.list = []node.Node{yyDollar[1].node} } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:667 + //line php7/php7.y:666 { yyVAL.node = yyDollar[1].node } case 115: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:669 + //line php7/php7.y:668 { yyVAL.node = yyDollar[2].node.(*stmt.Use).SetUseType(yyDollar[1].node) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:674 + //line php7/php7.y:673 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -3003,7 +2997,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:683 + //line php7/php7.y:682 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -3020,13 +3014,13 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:701 + //line php7/php7.y:700 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:703 + //line php7/php7.y:702 { yyVAL.node = yyDollar[2].node @@ -3035,7 +3029,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:713 + //line php7/php7.y:712 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3044,13 +3038,13 @@ yydefault: } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:720 + //line php7/php7.y:719 { yyVAL.list = []node.Node{yyDollar[1].node} } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:725 + //line php7/php7.y:724 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3058,50 +3052,50 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:731 + //line php7/php7.y:730 { yyVAL.list = []node.Node{} } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:736 + //line php7/php7.y:735 { // error yyVAL.node = nil } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:741 + //line php7/php7.y:740 { yyVAL.node = yyDollar[1].node } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:743 + //line php7/php7.y:742 { yyVAL.node = yyDollar[1].node } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:745 + //line php7/php7.y:744 { yyVAL.node = yyDollar[1].node } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:747 + //line php7/php7.y:746 { yyVAL.node = yyDollar[1].node } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:749 + //line php7/php7.y:748 { yyVAL.node = yyDollar[1].node } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:751 + //line php7/php7.y:750 { yyVAL.node = stmt.NewHaltCompiler() @@ -3116,7 +3110,7 @@ yydefault: } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:766 + //line php7/php7.y:765 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3129,19 +3123,19 @@ yydefault: } case 132: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:777 + //line php7/php7.y:776 { yyVAL.node = yyDollar[1].node } case 133: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:779 + //line php7/php7.y:778 { yyVAL.node = yyDollar[1].node } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:781 + //line php7/php7.y:780 { switch n := yyDollar[5].node.(type) { case *stmt.While: @@ -3162,7 +3156,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:800 + //line php7/php7.y:799 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) @@ -3178,7 +3172,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:814 + //line php7/php7.y:813 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -3205,7 +3199,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:839 + //line php7/php7.y:838 { switch n := yyDollar[5].node.(type) { case *stmt.Switch: @@ -3228,7 +3222,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:860 + //line php7/php7.y:859 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3241,7 +3235,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:871 + //line php7/php7.y:870 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3254,7 +3248,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:882 + //line php7/php7.y:881 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3267,7 +3261,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:893 + //line php7/php7.y:892 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3280,7 +3274,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:904 + //line php7/php7.y:903 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3293,7 +3287,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:915 + //line php7/php7.y:914 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3306,7 +3300,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:926 + //line php7/php7.y:925 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3318,7 +3312,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:936 + //line php7/php7.y:935 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3330,7 +3324,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:946 + //line php7/php7.y:945 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3348,17 +3342,15 @@ yydefault: } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:962 + //line php7/php7.y:961 { switch n := yyDollar[7].node.(type) { case *stmt.Foreach: n.Expr = yyDollar[3].node - n.ByRef = yyDollar[5].foreachVariable.byRef - n.Variable = yyDollar[5].foreachVariable.node + n.Variable = yyDollar[5].node case *stmt.AltForeach: n.Expr = yyDollar[3].node - n.ByRef = yyDollar[5].foreachVariable.byRef - n.Variable = yyDollar[5].foreachVariable.node + n.Variable = yyDollar[5].node } yyVAL.node = yyDollar[7].node @@ -3374,19 +3366,17 @@ yydefault: } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:986 + //line php7/php7.y:983 { switch n := yyDollar[9].node.(type) { case *stmt.Foreach: n.Expr = yyDollar[3].node n.Key = yyDollar[5].node - n.ByRef = yyDollar[7].foreachVariable.byRef - n.Variable = yyDollar[7].foreachVariable.node + n.Variable = yyDollar[7].node case *stmt.AltForeach: n.Expr = yyDollar[3].node n.Key = yyDollar[5].node - n.ByRef = yyDollar[7].foreachVariable.byRef - n.Variable = yyDollar[7].foreachVariable.node + n.Variable = yyDollar[7].node } yyVAL.node = yyDollar[9].node @@ -3403,7 +3393,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1013 + //line php7/php7.y:1008 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) @@ -3417,7 +3407,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1025 + //line php7/php7.y:1020 { yyVAL.node = stmt.NewNop() @@ -3429,7 +3419,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1035 + //line php7/php7.y:1030 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3446,7 +3436,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1050 + //line php7/php7.y:1045 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3459,7 +3449,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1061 + //line php7/php7.y:1056 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3475,7 +3465,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1075 + //line php7/php7.y:1070 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -3490,13 +3480,13 @@ yydefault: } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1090 + //line php7/php7.y:1085 { yyVAL.list = []node.Node{} } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1092 + //line php7/php7.y:1087 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[5].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -3518,13 +3508,13 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1114 + //line php7/php7.y:1109 { yyVAL.list = []node.Node{yyDollar[1].node} } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1116 + //line php7/php7.y:1111 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3533,13 +3523,13 @@ yydefault: } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1126 + //line php7/php7.y:1121 { yyVAL.node = nil } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1128 + //line php7/php7.y:1123 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3553,13 +3543,13 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1143 + //line php7/php7.y:1138 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1145 + //line php7/php7.y:1140 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3568,13 +3558,13 @@ yydefault: } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1155 + //line php7/php7.y:1150 { yyVAL.node = yyDollar[1].node } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1160 + //line php7/php7.y:1155 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) @@ -3596,31 +3586,31 @@ yydefault: } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1184 + //line php7/php7.y:1179 { yyVAL.token = nil } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1186 + //line php7/php7.y:1181 { yyVAL.token = yyDollar[1].token } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1191 + //line php7/php7.y:1186 { yyVAL.token = nil } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1193 + //line php7/php7.y:1188 { yyVAL.token = yyDollar[1].token } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1198 + //line php7/php7.y:1193 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].ClassExtends, yyDollar[5].ClassImplements, yyDollar[8].list, yyDollar[6].str) @@ -3637,7 +3627,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1213 + //line php7/php7.y:1208 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -3654,19 +3644,19 @@ yydefault: } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1231 + //line php7/php7.y:1226 { yyVAL.list = []node.Node{yyDollar[1].node} } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1233 + //line php7/php7.y:1228 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1238 + //line php7/php7.y:1233 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3678,7 +3668,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1248 + //line php7/php7.y:1243 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3690,7 +3680,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1261 + //line php7/php7.y:1256 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3707,7 +3697,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1279 + //line php7/php7.y:1274 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[6].list, yyDollar[4].str) @@ -3724,13 +3714,13 @@ yydefault: } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1297 + //line php7/php7.y:1292 { yyVAL.ClassExtends = nil } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1299 + //line php7/php7.y:1294 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3742,13 +3732,13 @@ yydefault: } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1312 + //line php7/php7.y:1307 { yyVAL.InterfaceExtends = nil } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1314 + //line php7/php7.y:1309 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -3760,13 +3750,13 @@ yydefault: } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1327 + //line php7/php7.y:1322 { yyVAL.ClassImplements = nil } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1329 + //line php7/php7.y:1324 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -3778,54 +3768,52 @@ yydefault: } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1342 + //line php7/php7.y:1337 { - yyVAL.foreachVariable = foreachVariable{yyDollar[1].node, false} + yyVAL.node = yyDollar[1].node } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1344 + //line php7/php7.y:1341 { - yyVAL.foreachVariable = foreachVariable{yyDollar[2].node, true} + yyVAL.node = expr.NewReference(yyDollar[2].node) // save position yylex.(*Parser).positions.AddPosition(yyDollar[2].node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyDollar[2].node, yyDollar[1].token, comment.AmpersandToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AmpersandToken) } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1354 + //line php7/php7.y:1351 { - list := expr.NewList(yyDollar[3].list) - yyVAL.foreachVariable = foreachVariable{list, false} + yyVAL.node = expr.NewList(yyDollar[3].list) // save position - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yylex.(*Parser).comments.AddFromToken(list, yyDollar[1].token, comment.ListToken) - yylex.(*Parser).comments.AddFromToken(list, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(list, yyDollar[4].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ListToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1367 + //line php7/php7.y:1363 { - list := expr.NewShortList(yyDollar[2].list) - yyVAL.foreachVariable = foreachVariable{list, false} + yyVAL.node = expr.NewShortList(yyDollar[2].list) // save position - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) // save comments - yylex.(*Parser).comments.AddFromToken(list, yyDollar[1].token, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(list, yyDollar[3].token, comment.CloseSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseSquareBracket) } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1382 + //line php7/php7.y:1377 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -3834,7 +3822,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1389 + //line php7/php7.y:1384 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -3850,19 +3838,19 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1406 + //line php7/php7.y:1401 { - yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node, false) + yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1413 + //line php7/php7.y:1408 { stmtList := stmt.NewStmtList(yyDollar[2].list) - yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList, false) + yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) // save position yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -3875,13 +3863,13 @@ yydefault: } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1430 + //line php7/php7.y:1425 { yyVAL.node = yyDollar[1].node } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1432 + //line php7/php7.y:1427 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3895,7 +3883,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1447 + //line php7/php7.y:1442 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3910,7 +3898,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1460 + //line php7/php7.y:1455 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3926,7 +3914,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1474 + //line php7/php7.y:1469 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -3942,7 +3930,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1488 + //line php7/php7.y:1483 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -3960,13 +3948,13 @@ yydefault: } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1507 + //line php7/php7.y:1502 { yyVAL.list = []node.Node{} } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1509 + //line php7/php7.y:1504 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -3980,7 +3968,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1521 + //line php7/php7.y:1516 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -3994,19 +3982,19 @@ yydefault: } case 200: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1536 + //line php7/php7.y:1531 { yyVAL.token = yyDollar[1].token } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1538 + //line php7/php7.y:1533 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1543 + //line php7/php7.y:1538 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4015,7 +4003,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1550 + //line php7/php7.y:1545 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4031,7 +4019,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1567 + //line php7/php7.y:1562 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -4045,7 +4033,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1579 + //line php7/php7.y:1574 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -4061,13 +4049,13 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1596 + //line php7/php7.y:1591 { yyVAL.node = yyDollar[1].node } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1598 + //line php7/php7.y:1593 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4081,7 +4069,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1613 + //line php7/php7.y:1608 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4098,7 +4086,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1628 + //line php7/php7.y:1623 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4116,7 +4104,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1647 + //line php7/php7.y:1642 { yyVAL.node = yyDollar[1].node @@ -4129,7 +4117,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1658 + //line php7/php7.y:1653 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4148,25 +4136,25 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1678 + //line php7/php7.y:1673 { yyVAL.list = yyDollar[1].list } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1680 + //line php7/php7.y:1675 { yyVAL.list = nil } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1685 + //line php7/php7.y:1680 { yyVAL.list = []node.Node{yyDollar[1].node} } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1687 + //line php7/php7.y:1682 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4175,7 +4163,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1697 + //line php7/php7.y:1692 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4214,7 +4202,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1734 + //line php7/php7.y:1729 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4253,25 +4241,25 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1774 + //line php7/php7.y:1769 { yyVAL.node = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1776 + //line php7/php7.y:1771 { yyVAL.node = yyDollar[1].node } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1781 + //line php7/php7.y:1776 { yyVAL.node = yyDollar[1].node } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1783 + //line php7/php7.y:1778 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4283,7 +4271,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1796 + //line php7/php7.y:1791 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4295,7 +4283,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1806 + //line php7/php7.y:1801 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4307,19 +4295,19 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1816 + //line php7/php7.y:1811 { yyVAL.node = yyDollar[1].node } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1821 + //line php7/php7.y:1816 { yyVAL.node = nil } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1823 + //line php7/php7.y:1818 { yyVAL.node = yyDollar[2].node @@ -4328,7 +4316,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1833 + //line php7/php7.y:1828 { yyVAL.node = node.NewArgumentList(nil) @@ -4337,7 +4325,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1840 + //line php7/php7.y:1835 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4346,13 +4334,13 @@ yydefault: } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1850 + //line php7/php7.y:1845 { yyVAL.list = []node.Node{yyDollar[1].node} } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1852 + //line php7/php7.y:1847 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4361,7 +4349,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1862 + //line php7/php7.y:1857 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4370,7 +4358,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1869 + //line php7/php7.y:1864 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4382,7 +4370,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1882 + //line php7/php7.y:1877 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4391,19 +4379,19 @@ yydefault: } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1889 + //line php7/php7.y:1884 { yyVAL.list = []node.Node{yyDollar[1].node} } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1894 + //line php7/php7.y:1889 { yyVAL.node = yyDollar[1].node } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1899 + //line php7/php7.y:1894 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4412,13 +4400,13 @@ yydefault: } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1906 + //line php7/php7.y:1901 { yyVAL.list = []node.Node{yyDollar[1].node} } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1911 + //line php7/php7.y:1906 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4434,7 +4422,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1925 + //line php7/php7.y:1920 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4451,19 +4439,19 @@ yydefault: } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1943 + //line php7/php7.y:1938 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1945 + //line php7/php7.y:1940 { yyVAL.list = []node.Node{} } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1950 + //line php7/php7.y:1945 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4475,7 +4463,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1960 + //line php7/php7.y:1955 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4488,7 +4476,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1971 + //line php7/php7.y:1966 { var adaptationList *stmt.TraitAdaptationList @@ -4510,7 +4498,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:1991 + //line php7/php7.y:1986 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) @@ -4534,13 +4522,13 @@ yydefault: } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2016 + //line php7/php7.y:2011 { yyVAL.list = []node.Node{yyDollar[1].node} } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2018 + //line php7/php7.y:2013 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4549,7 +4537,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2028 + //line php7/php7.y:2023 { yyVAL.node = stmt.NewNop() @@ -4561,7 +4549,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2038 + //line php7/php7.y:2033 { yyVAL.node = stmt.NewTraitAdaptationList(nil) @@ -4573,7 +4561,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2048 + //line php7/php7.y:2043 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4585,19 +4573,19 @@ yydefault: } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2061 + //line php7/php7.y:2056 { yyVAL.list = []node.Node{yyDollar[1].node} } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2063 + //line php7/php7.y:2058 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2068 + //line php7/php7.y:2063 { yyVAL.node = yyDollar[1].node @@ -4606,7 +4594,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2075 + //line php7/php7.y:2070 { yyVAL.node = yyDollar[1].node @@ -4615,7 +4603,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2085 + //line php7/php7.y:2080 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4627,7 +4615,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2098 + //line php7/php7.y:2093 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4642,7 +4630,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2111 + //line php7/php7.y:2106 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4657,7 +4645,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2124 + //line php7/php7.y:2119 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -4672,7 +4660,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2137 + //line php7/php7.y:2132 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -4684,7 +4672,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2150 + //line php7/php7.y:2145 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -4698,13 +4686,13 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2162 + //line php7/php7.y:2157 { yyVAL.node = yyDollar[1].node } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2167 + //line php7/php7.y:2162 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -4719,7 +4707,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2183 + //line php7/php7.y:2178 { yyVAL.node = stmt.NewNop() @@ -4731,7 +4719,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2193 + //line php7/php7.y:2188 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -4744,13 +4732,13 @@ yydefault: } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2207 + //line php7/php7.y:2202 { yyVAL.list = yyDollar[1].list } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2209 + //line php7/php7.y:2204 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -4763,31 +4751,31 @@ yydefault: } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2223 + //line php7/php7.y:2218 { yyVAL.list = nil } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2225 + //line php7/php7.y:2220 { yyVAL.list = yyDollar[1].list } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2230 + //line php7/php7.y:2225 { yyVAL.list = []node.Node{yyDollar[1].node} } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2232 + //line php7/php7.y:2227 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2237 + //line php7/php7.y:2232 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4799,7 +4787,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2247 + //line php7/php7.y:2242 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4811,7 +4799,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2257 + //line php7/php7.y:2252 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4823,7 +4811,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2267 + //line php7/php7.y:2262 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4835,7 +4823,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2277 + //line php7/php7.y:2272 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4847,7 +4835,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2287 + //line php7/php7.y:2282 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4859,7 +4847,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2300 + //line php7/php7.y:2295 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4868,13 +4856,13 @@ yydefault: } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2307 + //line php7/php7.y:2302 { yyVAL.list = []node.Node{yyDollar[1].node} } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2312 + //line php7/php7.y:2307 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4890,7 +4878,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2326 + //line php7/php7.y:2321 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4907,7 +4895,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2344 + //line php7/php7.y:2339 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4916,13 +4904,13 @@ yydefault: } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2351 + //line php7/php7.y:2346 { yyVAL.list = []node.Node{yyDollar[1].node} } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2356 + //line php7/php7.y:2351 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4937,7 +4925,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2372 + //line php7/php7.y:2367 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4952,7 +4940,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2388 + //line php7/php7.y:2383 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4961,31 +4949,31 @@ yydefault: } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2395 + //line php7/php7.y:2390 { yyVAL.list = []node.Node{yyDollar[1].node} } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2400 + //line php7/php7.y:2395 { yyVAL.node = yyDollar[1].node } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2405 + //line php7/php7.y:2400 { yyVAL.list = nil } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2407 + //line php7/php7.y:2402 { yyVAL.list = yyDollar[1].list } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2412 + //line php7/php7.y:2407 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4994,13 +4982,13 @@ yydefault: } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2419 + //line php7/php7.y:2414 { yyVAL.list = []node.Node{yyDollar[1].node} } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:2424 + //line php7/php7.y:2419 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -5018,7 +5006,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2443 + //line php7/php7.y:2438 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -5033,7 +5021,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2456 + //line php7/php7.y:2451 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -5045,7 +5033,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2469 + //line php7/php7.y:2464 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5062,7 +5050,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:2484 + //line php7/php7.y:2479 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5078,7 +5066,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2498 + //line php7/php7.y:2493 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5090,7 +5078,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2508 + //line php7/php7.y:2503 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5103,7 +5091,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2519 + //line php7/php7.y:2514 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5115,7 +5103,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2529 + //line php7/php7.y:2524 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5127,7 +5115,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2539 + //line php7/php7.y:2534 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5139,7 +5127,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2549 + //line php7/php7.y:2544 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5151,7 +5139,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2559 + //line php7/php7.y:2554 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5163,7 +5151,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2569 + //line php7/php7.y:2564 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5175,7 +5163,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2579 + //line php7/php7.y:2574 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5187,7 +5175,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2589 + //line php7/php7.y:2584 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5199,7 +5187,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2599 + //line php7/php7.y:2594 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5211,7 +5199,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2609 + //line php7/php7.y:2604 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5223,7 +5211,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2619 + //line php7/php7.y:2614 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5235,7 +5223,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2629 + //line php7/php7.y:2624 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5247,7 +5235,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2639 + //line php7/php7.y:2634 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5259,7 +5247,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2649 + //line php7/php7.y:2644 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5271,7 +5259,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2659 + //line php7/php7.y:2654 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5283,7 +5271,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2669 + //line php7/php7.y:2664 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5295,7 +5283,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2679 + //line php7/php7.y:2674 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5307,7 +5295,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2689 + //line php7/php7.y:2684 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5319,7 +5307,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2699 + //line php7/php7.y:2694 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5331,7 +5319,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2709 + //line php7/php7.y:2704 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5343,7 +5331,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2719 + //line php7/php7.y:2714 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5355,7 +5343,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2729 + //line php7/php7.y:2724 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5367,7 +5355,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2739 + //line php7/php7.y:2734 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5379,7 +5367,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2749 + //line php7/php7.y:2744 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5391,7 +5379,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2759 + //line php7/php7.y:2754 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5403,7 +5391,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2769 + //line php7/php7.y:2764 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5415,7 +5403,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2779 + //line php7/php7.y:2774 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5427,7 +5415,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2789 + //line php7/php7.y:2784 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5439,7 +5427,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2799 + //line php7/php7.y:2794 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5451,7 +5439,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2809 + //line php7/php7.y:2804 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5463,7 +5451,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2819 + //line php7/php7.y:2814 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5475,7 +5463,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2829 + //line php7/php7.y:2824 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5487,7 +5475,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2839 + //line php7/php7.y:2834 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5499,7 +5487,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2849 + //line php7/php7.y:2844 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5511,7 +5499,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2859 + //line php7/php7.y:2854 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -5523,7 +5511,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2869 + //line php7/php7.y:2864 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -5535,7 +5523,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2879 + //line php7/php7.y:2874 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -5547,7 +5535,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2889 + //line php7/php7.y:2884 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -5559,7 +5547,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2899 + //line php7/php7.y:2894 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5571,7 +5559,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2909 + //line php7/php7.y:2904 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5583,7 +5571,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2919 + //line php7/php7.y:2914 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -5595,7 +5583,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2929 + //line php7/php7.y:2924 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -5607,7 +5595,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2939 + //line php7/php7.y:2934 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -5619,7 +5607,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2949 + //line php7/php7.y:2944 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5631,7 +5619,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2959 + //line php7/php7.y:2954 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -5643,7 +5631,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2969 + //line php7/php7.y:2964 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5655,7 +5643,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2979 + //line php7/php7.y:2974 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -5667,7 +5655,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2989 + //line php7/php7.y:2984 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -5679,7 +5667,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2999 + //line php7/php7.y:2994 { yyVAL.node = yyDollar[2].node @@ -5689,13 +5677,13 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3007 + //line php7/php7.y:3002 { yyVAL.node = yyDollar[1].node } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3009 + //line php7/php7.y:3004 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -5708,7 +5696,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3020 + //line php7/php7.y:3015 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -5721,7 +5709,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3031 + //line php7/php7.y:3026 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -5733,13 +5721,13 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3041 + //line php7/php7.y:3036 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3043 + //line php7/php7.y:3038 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -5751,7 +5739,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3053 + //line php7/php7.y:3048 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -5763,7 +5751,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3063 + //line php7/php7.y:3058 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -5775,7 +5763,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3073 + //line php7/php7.y:3068 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -5787,7 +5775,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3083 + //line php7/php7.y:3078 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -5799,7 +5787,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3093 + //line php7/php7.y:3088 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -5811,7 +5799,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3103 + //line php7/php7.y:3098 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -5823,7 +5811,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3113 + //line php7/php7.y:3108 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -5839,7 +5827,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3127 + //line php7/php7.y:3122 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -5851,13 +5839,13 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3137 + //line php7/php7.y:3132 { yyVAL.node = yyDollar[1].node } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3139 + //line php7/php7.y:3134 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -5870,7 +5858,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3150 + //line php7/php7.y:3145 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -5882,7 +5870,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3160 + //line php7/php7.y:3155 { yyVAL.node = expr.NewYield(nil, nil) @@ -5894,7 +5882,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3170 + //line php7/php7.y:3165 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -5906,7 +5894,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3180 + //line php7/php7.y:3175 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -5919,7 +5907,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3191 + //line php7/php7.y:3186 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -5931,7 +5919,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3201 + //line php7/php7.y:3196 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) @@ -5950,7 +5938,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:3218 + //line php7/php7.y:3213 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].list, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) @@ -5970,38 +5958,38 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3239 + //line php7/php7.y:3234 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3247 + //line php7/php7.y:3242 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3249 + //line php7/php7.y:3244 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3254 + //line php7/php7.y:3249 { yyVAL.list = []node.Node{} } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3256 + //line php7/php7.y:3251 { yyVAL.list = yyDollar[3].list } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3261 + //line php7/php7.y:3256 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6010,17 +5998,17 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3268 + //line php7/php7.y:3263 { yyVAL.list = []node.Node{yyDollar[1].node} } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3273 + //line php7/php7.y:3268 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) - yyVAL.node = expr.NewClosureUse(variable, false) + yyVAL.node = expr.NewClosureUse(variable) // save position yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6032,11 +6020,12 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3287 + //line php7/php7.y:3282 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) variable := expr.NewVariable(identifier) - yyVAL.node = expr.NewClosureUse(variable, true) + reference := expr.NewReference(variable) + yyVAL.node = expr.NewClosureUse(reference) // save position yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6045,11 +6034,11 @@ yydefault: // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AmpersandToken) - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[2].token, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(reference, yyDollar[2].token, comment.VariableToken) } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3305 + //line php7/php7.y:3301 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6058,7 +6047,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3312 + //line php7/php7.y:3308 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6070,7 +6059,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3322 + //line php7/php7.y:3318 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6082,7 +6071,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3332 + //line php7/php7.y:3328 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6091,7 +6080,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3342 + //line php7/php7.y:3338 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6103,67 +6092,67 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3352 + //line php7/php7.y:3348 { yyVAL.node = yyDollar[1].node } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3357 + //line php7/php7.y:3353 { yyVAL.node = yyDollar[1].node } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3359 + //line php7/php7.y:3355 { yyVAL.node = yyDollar[1].node } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3364 + //line php7/php7.y:3360 { yyVAL.node = nil } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3366 + //line php7/php7.y:3362 { yyVAL.node = yyDollar[2].node } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3371 + //line php7/php7.y:3367 { yyVAL.list = []node.Node{} } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3373 + //line php7/php7.y:3369 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3375 + //line php7/php7.y:3371 { yyVAL.list = yyDollar[1].list } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3380 + //line php7/php7.y:3376 { yyVAL.node = nil } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3382 + //line php7/php7.y:3378 { yyVAL.node = yyDollar[1].node } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3387 + //line php7/php7.y:3383 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6177,7 +6166,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3399 + //line php7/php7.y:3395 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6190,7 +6179,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3410 + //line php7/php7.y:3406 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6202,7 +6191,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3423 + //line php7/php7.y:3419 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6214,7 +6203,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3433 + //line php7/php7.y:3429 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6226,7 +6215,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3443 + //line php7/php7.y:3439 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6238,7 +6227,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3453 + //line php7/php7.y:3449 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6250,7 +6239,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3463 + //line php7/php7.y:3459 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6262,7 +6251,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3473 + //line php7/php7.y:3469 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6274,7 +6263,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3483 + //line php7/php7.y:3479 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6286,7 +6275,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3493 + //line php7/php7.y:3489 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6298,7 +6287,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3503 + //line php7/php7.y:3499 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6310,7 +6299,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3513 + //line php7/php7.y:3509 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6322,7 +6311,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3523 + //line php7/php7.y:3519 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -6336,7 +6325,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3535 + //line php7/php7.y:3531 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -6348,7 +6337,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3545 + //line php7/php7.y:3541 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -6360,7 +6349,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3555 + //line php7/php7.y:3551 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -6372,19 +6361,19 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3565 + //line php7/php7.y:3561 { yyVAL.node = yyDollar[1].node } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3567 + //line php7/php7.y:3563 { yyVAL.node = yyDollar[1].node } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3572 + //line php7/php7.y:3568 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -6393,7 +6382,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3579 + //line php7/php7.y:3575 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6408,7 +6397,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3592 + //line php7/php7.y:3588 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6423,43 +6412,43 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3608 + //line php7/php7.y:3604 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3610 + //line php7/php7.y:3606 { yyVAL.node = yyDollar[1].node } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3615 + //line php7/php7.y:3611 { yyVAL.node = nil } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3617 + //line php7/php7.y:3613 { yyVAL.node = yyDollar[1].node } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3622 + //line php7/php7.y:3618 { yyVAL.node = yyDollar[1].node } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3627 + //line php7/php7.y:3623 { yyVAL.node = yyDollar[1].node } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3629 + //line php7/php7.y:3625 { yyVAL.node = yyDollar[2].node @@ -6469,19 +6458,19 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3637 + //line php7/php7.y:3633 { yyVAL.node = yyDollar[1].node } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3642 + //line php7/php7.y:3638 { yyVAL.node = yyDollar[1].node } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3644 + //line php7/php7.y:3640 { yyVAL.node = yyDollar[2].node @@ -6491,19 +6480,19 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3652 + //line php7/php7.y:3648 { yyVAL.node = yyDollar[1].node } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3657 + //line php7/php7.y:3653 { yyVAL.node = yyDollar[1].node } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3659 + //line php7/php7.y:3655 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6516,7 +6505,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3670 + //line php7/php7.y:3666 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6529,7 +6518,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3681 + //line php7/php7.y:3677 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6542,7 +6531,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3692 + //line php7/php7.y:3688 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6554,25 +6543,25 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3702 + //line php7/php7.y:3698 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3707 + //line php7/php7.y:3703 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3709 + //line php7/php7.y:3705 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3711 + //line php7/php7.y:3707 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6584,7 +6573,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3724 + //line php7/php7.y:3720 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6598,7 +6587,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3736 + //line php7/php7.y:3732 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -6612,7 +6601,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3748 + //line php7/php7.y:3744 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6624,7 +6613,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3761 + //line php7/php7.y:3757 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6636,7 +6625,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3771 + //line php7/php7.y:3767 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6648,13 +6637,13 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3784 + //line php7/php7.y:3780 { yyVAL.node = yyDollar[1].node } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3786 + //line php7/php7.y:3782 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6667,7 +6656,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3797 + //line php7/php7.y:3793 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6680,7 +6669,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3808 + //line php7/php7.y:3804 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6692,7 +6681,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3818 + //line php7/php7.y:3814 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6704,7 +6693,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3828 + //line php7/php7.y:3824 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6716,7 +6705,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3841 + //line php7/php7.y:3837 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6728,7 +6717,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3851 + //line php7/php7.y:3847 { yyVAL.node = yyDollar[2].node @@ -6738,13 +6727,13 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3859 + //line php7/php7.y:3855 { yyVAL.node = yyDollar[1].node } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3864 + //line php7/php7.y:3860 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6756,7 +6745,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3874 + //line php7/php7.y:3870 { yyVAL.node = yyDollar[2].node @@ -6766,13 +6755,13 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3882 + //line php7/php7.y:3878 { yyVAL.node = yyDollar[1].node } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3887 + //line php7/php7.y:3883 { if yyDollar[1].list[len(yyDollar[1].list)-1] == nil { yyVAL.list = yyDollar[1].list[:len(yyDollar[1].list)-1] @@ -6782,19 +6771,19 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3898 + //line php7/php7.y:3894 { yyVAL.node = nil } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3900 + //line php7/php7.y:3896 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3905 + //line php7/php7.y:3901 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6803,15 +6792,15 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3912 + //line php7/php7.y:3908 { yyVAL.list = []node.Node{yyDollar[1].node} } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3917 + //line php7/php7.y:3913 { - yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node, false) + yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6821,45 +6810,47 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3927 + //line php7/php7.y:3923 { - yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node, false) + yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3934 + //line php7/php7.y:3930 { - yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[4].node, true) + reference := expr.NewReference(yyDollar[4].node) + yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DoubleArrowToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AmpersandToken) + yylex.(*Parser).comments.AddFromToken(reference, yyDollar[3].token, comment.AmpersandToken) } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3945 + //line php7/php7.y:3942 { - yyVAL.node = expr.NewArrayItem(nil, yyDollar[2].node, true) + reference := expr.NewReference(yyDollar[2].node) + yyVAL.node = expr.NewArrayItem(nil, reference) // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) // save comments - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AmpersandToken) + yylex.(*Parser).comments.AddFromToken(reference, yyDollar[1].token, comment.AmpersandToken) } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3955 + //line php7/php7.y:3953 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) - yyVAL.node = expr.NewArrayItem(yyDollar[1].node, list, false) + yyVAL.node = expr.NewArrayItem(yyDollar[1].node, list) // save position yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[6].token)) @@ -6873,11 +6864,11 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3971 + //line php7/php7.y:3969 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) - yyVAL.node = expr.NewArrayItem(nil, list, false) + yyVAL.node = expr.NewArrayItem(nil, list) // save position yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6890,13 +6881,13 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3989 + //line php7/php7.y:3987 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3991 + //line php7/php7.y:3989 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -6909,13 +6900,13 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4002 + //line php7/php7.y:4000 { yyVAL.list = []node.Node{yyDollar[1].node} } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4004 + //line php7/php7.y:4002 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -6928,7 +6919,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4018 + //line php7/php7.y:4016 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6942,7 +6933,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4030 + //line php7/php7.y:4028 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6960,7 +6951,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4046 + //line php7/php7.y:4044 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6980,7 +6971,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4064 + //line php7/php7.y:4062 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6993,7 +6984,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4075 + //line php7/php7.y:4073 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -7009,7 +7000,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:4089 + //line php7/php7.y:4087 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -7029,13 +7020,13 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4107 + //line php7/php7.y:4105 { yyVAL.node = yyDollar[2].node } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4113 + //line php7/php7.y:4111 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7047,7 +7038,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4123 + //line php7/php7.y:4121 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7064,7 +7055,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4138 + //line php7/php7.y:4136 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -7095,7 +7086,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4167 + //line php7/php7.y:4165 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(identifier) @@ -7109,7 +7100,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:4182 + //line php7/php7.y:4180 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -7126,7 +7117,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4197 + //line php7/php7.y:4195 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -7140,7 +7131,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4209 + //line php7/php7.y:4207 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -7152,7 +7143,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4219 + //line php7/php7.y:4217 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -7164,7 +7155,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4229 + //line php7/php7.y:4227 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -7178,7 +7169,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4241 + //line php7/php7.y:4239 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -7190,7 +7181,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4251 + //line php7/php7.y:4249 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -7202,13 +7193,13 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4264 + //line php7/php7.y:4262 { yyVAL.list = []node.Node{yyDollar[1].node} } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4266 + //line php7/php7.y:4264 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -7217,7 +7208,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4276 + //line php7/php7.y:4274 { yyVAL.node = yyDollar[1].node } diff --git a/php7/php7.y b/php7/php7.y index 9cee1c3..3aa2c61 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -23,7 +23,6 @@ import ( node node.Node token *scanner.Token list []node.Node - foreachVariable foreachVariable str string ClassExtends *stmt.ClassExtends @@ -275,7 +274,7 @@ import ( %type member_modifier %type use_type -%type foreach_variable +%type foreach_variable %type encaps_list backticks_expr namespace_name catch_name_list catch_list class_const_list @@ -963,12 +962,10 @@ statement: switch n := $7.(type) { case *stmt.Foreach : n.Expr = $3 - n.ByRef = $5.byRef - n.Variable = $5.node + n.Variable = $5 case *stmt.AltForeach : n.Expr = $3 - n.ByRef = $5.byRef - n.Variable = $5.node + n.Variable = $5 } $$ = $7 @@ -988,13 +985,11 @@ statement: case *stmt.Foreach : n.Expr = $3 n.Key = $5 - n.ByRef = $7.byRef - n.Variable = $7.node + n.Variable = $7 case *stmt.AltForeach : n.Expr = $3 n.Key = $5 - n.ByRef = $7.byRef - n.Variable = $7.node + n.Variable = $7 } $$ = $9 @@ -1339,41 +1334,41 @@ implements_list: foreach_variable: variable - { $$ = foreachVariable{$1, false} } + { + $$ = $1 + } | '&' variable { - $$ = foreachVariable{$2, true} + $$ = expr.NewReference($2) // save position yylex.(*Parser).positions.AddPosition($2, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($2, $1, comment.AmpersandToken) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.AmpersandToken) } | T_LIST '(' array_pair_list ')' { - list := expr.NewList($3) - $$ = foreachVariable{list, false} + $$ = expr.NewList($3) // save position - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - yylex.(*Parser).comments.AddFromToken(list, $1, comment.ListToken) - yylex.(*Parser).comments.AddFromToken(list, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(list, $4, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ListToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) } | '[' array_pair_list ']' { - list := expr.NewShortList($2) - $$ = foreachVariable{list, false} + $$ = expr.NewShortList($2) // save position - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) // save comments - yylex.(*Parser).comments.AddFromToken(list, $1, comment.OpenSquareBracket) - yylex.(*Parser).comments.AddFromToken(list, $3, comment.CloseSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseSquareBracket) } ; @@ -1404,7 +1399,7 @@ for_statement: foreach_statement: statement { - $$ = stmt.NewForeach(nil, nil, nil, $1, false) + $$ = stmt.NewForeach(nil, nil, nil, $1) // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) @@ -1412,7 +1407,7 @@ foreach_statement: | ':' inner_statement_list T_ENDFOREACH ';' { stmtList := stmt.NewStmtList($2) - $$ = stmt.NewAltForeach(nil, nil, nil, stmtList, false) + $$ = stmt.NewAltForeach(nil, nil, nil, stmtList) // save position yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) @@ -3273,7 +3268,7 @@ lexical_var: { identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) variable := expr.NewVariable(identifier) - $$ = expr.NewClosureUse(variable, false) + $$ = expr.NewClosureUse(variable) // save position yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) @@ -3287,7 +3282,8 @@ lexical_var: { identifier := node.NewIdentifier(strings.TrimLeft($2.Value, "$")) variable := expr.NewVariable(identifier) - $$ = expr.NewClosureUse(variable, true) + reference := expr.NewReference(variable) + $$ = expr.NewClosureUse(reference) // save position yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) @@ -3296,7 +3292,7 @@ lexical_var: // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.AmpersandToken) - yylex.(*Parser).comments.AddFromToken(variable, $2, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(reference, $2, comment.VariableToken) } ; @@ -3915,7 +3911,7 @@ non_empty_array_pair_list: array_pair: expr T_DOUBLE_ARROW expr { - $$ = expr.NewArrayItem($1, $3, false) + $$ = expr.NewArrayItem($1, $3) // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) @@ -3925,37 +3921,39 @@ array_pair: } | expr { - $$ = expr.NewArrayItem(nil, $1, false) + $$ = expr.NewArrayItem(nil, $1) // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) } | expr T_DOUBLE_ARROW '&' variable { - $$ = expr.NewArrayItem($1, $4, true) + reference := expr.NewReference($4) + $$ = expr.NewArrayItem($1, reference) // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) // save comments yylex.(*Parser).comments.AddFromToken($$, $2, comment.DoubleArrowToken) - yylex.(*Parser).comments.AddFromToken($$, $3, comment.AmpersandToken) + yylex.(*Parser).comments.AddFromToken(reference, $3, comment.AmpersandToken) } | '&' variable { - $$ = expr.NewArrayItem(nil, $2, true) + reference := expr.NewReference($2) + $$ = expr.NewArrayItem(nil, reference) // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) // save comments - yylex.(*Parser).comments.AddFromToken($$, $1, comment.AmpersandToken) + yylex.(*Parser).comments.AddFromToken(reference, $1, comment.AmpersandToken) } | expr T_DOUBLE_ARROW T_LIST '(' array_pair_list ')' { // TODO: Cannot use list() as standalone expression list := expr.NewList($5) - $$ = expr.NewArrayItem($1, list, false) + $$ = expr.NewArrayItem($1, list) // save position yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($3, $6)) @@ -3971,7 +3969,7 @@ array_pair: { // TODO: Cannot use list() as standalone expression list := expr.NewList($3) - $$ = expr.NewArrayItem(nil, list, false) + $$ = expr.NewArrayItem(nil, list) // save position yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) @@ -4279,8 +4277,3 @@ isset_variable: ///////////////////////////////////////////////////////////////////////// %% - -type foreachVariable struct { - node node.Node - byRef bool -} diff --git a/php7/php7_test.go b/php7/php7_test.go index 0d7cbc9..17797ea 100644 --- a/php7/php7_test.go +++ b/php7/php7_test.go @@ -1155,35 +1155,32 @@ func TestPhp7(t *testing.T) { Stmt: &stmt.StmtList{Stmts: []node.Node{}}, }, &stmt.Foreach{ - ByRef: true, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, - Stmt: &stmt.StmtList{Stmts: []node.Node{}}, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, + Variable: &expr.Reference{ + Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, + }, + Stmt: &stmt.StmtList{Stmts: []node.Node{}}, }, &stmt.Foreach{ - ByRef: false, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, Variable: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, }, }, }, Stmt: &stmt.StmtList{Stmts: []node.Node{}}, }, &stmt.Foreach{ - ByRef: false, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, + Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, Variable: &expr.ShortList{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, }, }, }, @@ -2062,8 +2059,7 @@ func TestPhp7(t *testing.T) { Expr: &expr.Array{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, }, }, @@ -2072,13 +2068,11 @@ func TestPhp7(t *testing.T) { Expr: &expr.Array{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Key: &scalar.Lnumber{Value: "1"}, - Val: &scalar.Lnumber{Value: "1"}, + Key: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, &expr.ArrayItem{ - ByRef: true, - Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, }, }, }, @@ -2147,12 +2141,10 @@ func TestPhp7(t *testing.T) { }, Uses: []node.Node{ &expr.ClosureUse{ - ByRef: false, Variable: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, }, &expr.ClosureUse{ - ByRef: true, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}, + Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, }, }, Stmts: []node.Node{}, @@ -2339,8 +2331,7 @@ func TestPhp7(t *testing.T) { Variable: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, }, }, }, @@ -2352,7 +2343,6 @@ func TestPhp7(t *testing.T) { Variable: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, Val: &expr.ArrayDimFetch{ Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, }, @@ -2367,12 +2357,10 @@ func TestPhp7(t *testing.T) { Variable: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, Val: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, }, }, }, @@ -2478,8 +2466,7 @@ func TestPhp7(t *testing.T) { Expr: &expr.ShortArray{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, }, }, @@ -2488,13 +2475,11 @@ func TestPhp7(t *testing.T) { Expr: &expr.ShortArray{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Key: &scalar.Lnumber{Value: "1"}, - Val: &scalar.Lnumber{Value: "1"}, + Key: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, &expr.ArrayItem{ - ByRef: true, - Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, }, }, }, @@ -2504,8 +2489,7 @@ func TestPhp7(t *testing.T) { Variable: &expr.ShortList{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, }, }, }, @@ -2517,7 +2501,6 @@ func TestPhp7(t *testing.T) { Variable: &expr.ShortList{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, Val: &expr.ArrayDimFetch{ Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, }, @@ -2532,12 +2515,10 @@ func TestPhp7(t *testing.T) { Variable: &expr.ShortList{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, Val: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, }, }, }, @@ -3133,8 +3114,7 @@ func TestPhp7(t *testing.T) { Variable: &expr.ShortArray{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, }, }, }, @@ -3169,8 +3149,7 @@ func TestPhp7(t *testing.T) { Variable: &expr.ShortArray{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &scalar.Lnumber{Value: "1"}, + Val: &scalar.Lnumber{Value: "1"}, }, }, }, @@ -3227,18 +3206,15 @@ func TestPhp7(t *testing.T) { Expr: &expr.ShortArray{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: true, - Key: &scalar.Lnumber{Value: "1"}, - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Key: &scalar.Lnumber{Value: "1"}, + Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, }, &expr.ArrayItem{ - ByRef: false, - Key: &scalar.Lnumber{Value: "2"}, + Key: &scalar.Lnumber{Value: "2"}, Val: &expr.List{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, }, }, diff --git a/printer/printer.go b/printer/printer.go index bccbb45..3cf0b5a 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -272,6 +272,8 @@ func (p *Printer) printNode(n node.Node) { p.printExprPrint(n) case *expr.PropertyFetch: p.printExprPropertyFetch(n) + case *expr.Reference: + p.printExprReference(n) case *expr.Require: p.printExprRequire(n) case *expr.RequireOnce: @@ -964,10 +966,6 @@ func (p *Printer) printExprArrayItem(n node.Node) { io.WriteString(p.w, " => ") } - if nn.ByRef { - io.WriteString(p.w, "&") - } - p.Print(nn.Val) } @@ -1008,11 +1006,6 @@ func (p *Printer) printExprClone(n node.Node) { func (p *Printer) printExprClosureUse(n node.Node) { nn := n.(*expr.ClosureUse) - - if nn.ByRef { - io.WriteString(p.w, "&") - } - p.Print(nn.Variable) } @@ -1211,6 +1204,13 @@ func (p *Printer) printExprPropertyFetch(n node.Node) { p.Print(nn.Property) } +func (p *Printer) printExprReference(n node.Node) { + nn := n.(*expr.Reference) + + io.WriteString(p.w, "&") + p.Print(nn.Variable) +} + func (p *Printer) printExprRequire(n node.Node) { nn := n.(*expr.Require) @@ -1382,10 +1382,6 @@ func (p *Printer) printStmtAltForeach(n node.Node) { io.WriteString(p.w, " => ") } - if nn.ByRef { - io.WriteString(p.w, "&") - } - p.Print(nn.Variable) io.WriteString(p.w, ") :\n") @@ -1769,9 +1765,6 @@ func (p *Printer) printStmtForeach(n node.Node) { io.WriteString(p.w, " => ") } - if nn.ByRef { - io.WriteString(p.w, "&") - } p.Print(nn.Variable) io.WriteString(p.w, ")") diff --git a/printer/printer_test.go b/printer/printer_test.go index e36d781..f741cb8 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -1245,9 +1245,8 @@ func TestPrintExprArrayItemWithKey(t *testing.T) { p := printer.NewPrinter(o, " ") p.Print(&expr.ArrayItem{ - ByRef: false, - Key: &scalar.String{Value: "'Hello'"}, - Val: &expr.Variable{VarName: &node.Identifier{Value: "world"}}, + Key: &scalar.String{Value: "'Hello'"}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "world"}}, }) expected := `'Hello' => $world` @@ -1263,8 +1262,7 @@ func TestPrintExprArrayItem(t *testing.T) { p := printer.NewPrinter(o, " ") p.Print(&expr.ArrayItem{ - ByRef: true, - Val: &expr.Variable{VarName: &node.Identifier{Value: "world"}}, + Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "world"}}}, }) expected := `&$world` @@ -1282,18 +1280,15 @@ func TestPrintExprArray(t *testing.T) { p.Print(&expr.Array{ Items: []node.Node{ &expr.ArrayItem{ - ByRef: false, - Key: &scalar.String{Value: "'Hello'"}, - Val: &expr.Variable{VarName: &node.Identifier{Value: "world"}}, + Key: &scalar.String{Value: "'Hello'"}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "world"}}, }, &expr.ArrayItem{ - ByRef: true, - Key: &scalar.Lnumber{Value: "2"}, - Val: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Key: &scalar.Lnumber{Value: "2"}, + Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}, }, &expr.ArrayItem{ - ByRef: false, - Val: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Val: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }, }, }) @@ -1376,8 +1371,7 @@ func TestPrintExprClosureUse(t *testing.T) { p := printer.NewPrinter(o, " ") p.Print(&expr.ClosureUse{ - ByRef: true, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}, }) expected := `&$var` @@ -1406,11 +1400,9 @@ func TestPrintExprClosure(t *testing.T) { }, Uses: []node.Node{ &expr.ClosureUse{ - ByRef: true, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, }, &expr.ClosureUse{ - ByRef: false, Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, }, @@ -1795,6 +1787,22 @@ func TestPrintPropertyFetch(t *testing.T) { } } +func TestPrintExprReference(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrinter(o, " ") + p.Print(&expr.Reference{ + Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + }) + + expected := `&$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + func TestPrintRequire(t *testing.T) { o := bytes.NewBufferString("") @@ -1854,9 +1862,8 @@ func TestPrintExprShortArray(t *testing.T) { Val: &expr.Variable{VarName: &node.Identifier{Value: "world"}}, }, &expr.ArrayItem{ - ByRef: true, - Key: &scalar.Lnumber{Value: "2"}, - Val: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Key: &scalar.Lnumber{Value: "2"}, + Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}, }, &expr.ArrayItem{ Val: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, @@ -2200,10 +2207,9 @@ func TestPrintAltForeach(t *testing.T) { p.Print(&stmt.Namespace{ Stmts: []node.Node{ &stmt.AltForeach{ - ByRef: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, Key: &expr.Variable{VarName: &node.Identifier{Value: "key"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "val"}}, + Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "val"}}}, Stmt: &stmt.StmtList{ Stmts: []node.Node{ &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, @@ -3141,10 +3147,9 @@ func TestPrintStmtForeachNop(t *testing.T) { p := printer.NewPrinter(o, " ") p.Print(&stmt.Foreach{ - ByRef: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, + Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}}, Stmt: &stmt.Nop{}, }) From 6ccca996a8356004eca41f7ef50ace40d4352e56 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Fri, 25 May 2018 09:38:44 +0300 Subject: [PATCH 22/25] changing ClosureUse node purpose Now ClosureUse is a container node for variable and reference nodes --- node/expr/n_closure.go | 16 +- node/expr/n_closure_use.go | 16 +- node/expr/t_closure_test.go | 22 +- node/expr/t_visitor_test.go | 10 +- node/t_node_test.go | 4 - php5/php5.go | 1173 +++++++++++++++++------------------ php5/php5.y | 36 +- php5/php5_test.go | 24 +- php7/php7.go | 1104 +++++++++++++++++---------------- php7/php7.y | 29 +- php7/php7_test.go | 14 +- printer/printer.go | 12 +- printer/printer_test.go | 17 +- 13 files changed, 1225 insertions(+), 1252 deletions(-) diff --git a/node/expr/n_closure.go b/node/expr/n_closure.go index 8725c6e..26d9949 100644 --- a/node/expr/n_closure.go +++ b/node/expr/n_closure.go @@ -11,19 +11,19 @@ type Closure struct { Static bool PhpDocComment string Params []node.Node - Uses []node.Node + ClosureUse *ClosureUse ReturnType node.Node Stmts []node.Node } // NewClosure node constructor -func NewClosure(Params []node.Node, Uses []node.Node, ReturnType node.Node, Stmts []node.Node, Static bool, ReturnsRef bool, PhpDocComment string) *Closure { +func NewClosure(Params []node.Node, ClosureUse *ClosureUse, ReturnType node.Node, Stmts []node.Node, Static bool, ReturnsRef bool, PhpDocComment string) *Closure { return &Closure{ ReturnsRef, Static, PhpDocComment, Params, - Uses, + ClosureUse, ReturnType, Stmts, } @@ -54,13 +54,9 @@ func (n *Closure) Walk(v walker.Visitor) { } } - if n.Uses != nil { - vv := v.GetChildrenVisitor("Uses") - for _, nn := range n.Uses { - if nn != nil { - nn.Walk(vv) - } - } + if n.ClosureUse != nil { + vv := v.GetChildrenVisitor("ClosureUse") + n.ClosureUse.Walk(vv) } if n.ReturnType != nil { diff --git a/node/expr/n_closure_use.go b/node/expr/n_closure_use.go index 29e5922..6225208 100644 --- a/node/expr/n_closure_use.go +++ b/node/expr/n_closure_use.go @@ -7,13 +7,13 @@ import ( // ClosureUse node type ClosureUse struct { - Variable node.Node + Uses []node.Node } // NewClosureUse node constructor -func NewClosureUse(Variable node.Node) *ClosureUse { +func NewClosureUse(Uses []node.Node) *ClosureUse { return &ClosureUse{ - Variable, + Uses, } } @@ -29,9 +29,13 @@ func (n *ClosureUse) Walk(v walker.Visitor) { return } - if n.Variable != nil { - vv := v.GetChildrenVisitor("Variable") - n.Variable.Walk(vv) + if n.Uses != nil { + vv := v.GetChildrenVisitor("Uses") + for _, nn := range n.Uses { + if nn != nil { + nn.Walk(vv) + } + } } v.LeaveNode(n) diff --git a/node/expr/t_closure_test.go b/node/expr/t_closure_test.go index abfc831..b5752f2 100644 --- a/node/expr/t_closure_test.go +++ b/node/expr/t_closure_test.go @@ -24,7 +24,6 @@ func TestClosure(t *testing.T) { ReturnsRef: false, Static: false, PhpDocComment: "", - Uses: []node.Node{}, Stmts: []node.Node{}, }, }, @@ -64,12 +63,10 @@ func TestClosureUse(t *testing.T) { Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, }, - Uses: []node.Node{ - &expr.ClosureUse{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - }, - &expr.ClosureUse{ - Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + ClosureUse: &expr.ClosureUse{ + Uses: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, }, }, Stmts: []node.Node{}, @@ -111,12 +108,10 @@ func TestClosureUse2(t *testing.T) { Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, }, - Uses: []node.Node{ - &expr.ClosureUse{ - Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "c"}}}, - }, - &expr.ClosureUse{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}, + ClosureUse: &expr.ClosureUse{ + Uses: []node.Node{ + &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "c"}}}, + &expr.Variable{VarName: &node.Identifier{Value: "d"}}, }, }, Stmts: []node.Node{}, @@ -146,7 +141,6 @@ func TestClosureReturnType(t *testing.T) { ReturnsRef: false, Static: false, PhpDocComment: "", - Uses: []node.Node{}, ReturnType: &name.Name{ Parts: []node.Node{&name.NamePart{Value: "void"}}, }, diff --git a/node/expr/t_visitor_test.go b/node/expr/t_visitor_test.go index 28409ac..90d6741 100644 --- a/node/expr/t_visitor_test.go +++ b/node/expr/t_visitor_test.go @@ -81,9 +81,11 @@ var nodesToTest = []struct { }, { &expr.ClosureUse{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Uses: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + }, }, - []string{"Variable"}, + []string{"Uses"}, map[string]interface{}{}, }, { @@ -92,11 +94,11 @@ var nodesToTest = []struct { Static: false, PhpDocComment: "", Params: []node.Node{&node.Parameter{}}, - Uses: []node.Node{&expr.ClosureUse{}}, + ClosureUse: &expr.ClosureUse{}, ReturnType: &name.Name{}, Stmts: []node.Node{&stmt.Nop{}}, }, - []string{"Params", "Uses", "ReturnType", "Stmts"}, + []string{"Params", "ClosureUse", "ReturnType", "Stmts"}, map[string]interface{}{"ReturnsRef": true, "Static": false, "PhpDocComment": ""}, }, { diff --git a/node/t_node_test.go b/node/t_node_test.go index 656bdb3..f7c351c 100644 --- a/node/t_node_test.go +++ b/node/t_node_test.go @@ -298,7 +298,6 @@ func TestPhp7ParameterNode(t *testing.T) { &stmt.Expression{ Expr: &expr.Closure{ Params: expectedParams, - Uses: []node.Node{}, Stmts: []node.Node{}, }, }, @@ -306,7 +305,6 @@ func TestPhp7ParameterNode(t *testing.T) { Expr: &expr.Closure{ Static: true, Params: expectedParams, - Uses: []node.Node{}, Stmts: []node.Node{}, }, }, @@ -368,7 +366,6 @@ func TestPhp5ParameterNode(t *testing.T) { &stmt.Expression{ Expr: &expr.Closure{ Params: expectedParams, - Uses: []node.Node{}, Stmts: []node.Node{}, }, }, @@ -376,7 +373,6 @@ func TestPhp5ParameterNode(t *testing.T) { Expr: &expr.Closure{ Static: true, Params: expectedParams, - Uses: []node.Node{}, Stmts: []node.Node{}, }, }, diff --git a/php5/php5.go b/php5/php5.go index 9fe75aa..2a96dba 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -30,6 +30,7 @@ type yySymType struct { ClassExtends *stmt.ClassExtends ClassImplements *stmt.ClassImplements InterfaceExtends *stmt.InterfaceExtends + ClosureUse *expr.ClosureUse } const T_INCLUDE = 57346 @@ -344,7 +345,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:4015 +//line php5/php5.y:4005 type simpleIndirectReference struct { all []*expr.Variable @@ -1619,8 +1620,8 @@ var yyPgo = [...]int{ 1062, 1061, 1060, 17, 1059, 1058, 1057, 1056, 51, 5, 1055, 1054, 1053, 1051, 1049, 2, 1048, 631, 1047, 18, 22, 1046, 1045, 1043, 15, 1042, 1041, 6, 19, 1040, - 1037, 1033, 39, 0, 1032, 1030, 1029, 117, 1028, 1027, - 553, 1026, 1024, 42, 8, 1018, 9, 1017, 1013, 1007, + 1037, 1033, 9, 39, 0, 1032, 1030, 1029, 117, 1028, + 1027, 553, 1026, 1024, 42, 8, 1018, 1017, 1013, 1007, 14, 49, 1001, 1000, 998, 995, 993, 992, 3, 991, 16, 990, 988, 985, 28, 983, 982, 980, 976, 974, 971, 962, 21, 961, 959, 958, 25, 955, 23, 12, @@ -1629,10 +1630,10 @@ var yyPgo = [...]int{ } var yyR1 = [...]int{ - 0, 149, 92, 92, 93, 93, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 94, 94, - 4, 4, 4, 4, 95, 95, 5, 5, 5, 5, - 96, 96, 6, 6, 6, 6, 53, 53, 97, 97, + 0, 149, 93, 93, 94, 94, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 95, 95, + 4, 4, 4, 4, 96, 96, 5, 5, 5, 5, + 97, 97, 6, 6, 6, 6, 53, 53, 98, 98, 24, 24, 24, 24, 24, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, @@ -1645,7 +1646,7 @@ var yyR1 = [...]int{ 150, 86, 86, 107, 107, 108, 108, 54, 54, 55, 55, 118, 118, 119, 119, 63, 63, 62, 62, 62, 62, 80, 80, 80, 125, 125, 68, 68, 68, 68, - 98, 98, 27, 27, 27, 99, 99, 99, 99, 120, + 99, 99, 27, 27, 27, 100, 100, 100, 100, 120, 120, 65, 65, 65, 65, 67, 126, 126, 81, 81, 127, 127, 128, 128, 69, 69, 70, 129, 129, 73, 73, 72, 71, 71, 74, 74, 83, 83, 121, 121, @@ -1660,8 +1661,8 @@ var yyR1 = [...]int{ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 50, 50, 50, 50, - 47, 47, 47, 47, 46, 46, 1, 106, 106, 105, - 105, 105, 105, 23, 23, 23, 23, 23, 23, 23, + 47, 47, 47, 47, 46, 46, 1, 92, 92, 106, + 106, 106, 106, 23, 23, 23, 23, 23, 23, 23, 23, 11, 11, 11, 11, 45, 45, 45, 43, 43, 41, 41, 144, 144, 143, 49, 49, 49, 131, 131, 131, 79, 79, 7, 7, 7, 7, 7, 7, 7, @@ -1676,11 +1677,11 @@ var yyR1 = [...]int{ 138, 140, 140, 76, 139, 139, 139, 40, 40, 44, 44, 12, 22, 22, 20, 20, 20, 21, 21, 21, 10, 10, 10, 9, 9, 13, 13, 141, 141, 142, - 142, 142, 39, 39, 146, 146, 104, 104, 38, 38, - 38, 103, 103, 102, 102, 102, 102, 102, 102, 102, - 102, 100, 100, 100, 100, 33, 33, 33, 33, 33, + 142, 142, 39, 39, 146, 146, 105, 105, 38, 38, + 38, 104, 104, 103, 103, 103, 103, 103, 103, 103, + 103, 101, 101, 101, 101, 33, 33, 33, 33, 33, 33, 34, 34, 34, 37, 37, 37, 37, 37, 37, - 37, 37, 101, 101, 36, 36, 30, 30, 31, 32, + 37, 37, 102, 102, 36, 36, 30, 30, 31, 32, } var yyR2 = [...]int{ @@ -1739,7 +1740,7 @@ var yyR2 = [...]int{ } var yyChk = [...]int{ - -1000, -149, -92, -3, 2, -25, -51, -52, 51, 79, + -1000, -149, -93, -3, 2, -25, -51, -52, 51, 79, 44, -53, -26, 10, -60, -61, 38, 142, 7, 21, 20, 23, 30, 34, 35, 39, -50, 46, 98, 19, 14, -14, 48, 25, 27, 144, 40, 43, 36, -1, @@ -1749,99 +1750,99 @@ var yyChk = [...]int{ 112, 113, 6, 156, -29, -47, -46, 141, 96, -20, 91, 49, 50, 4, 5, 84, 85, 86, 11, -35, -32, -7, 140, 74, 62, 18, 60, 148, -21, -22, - -23, -30, -93, 82, -11, 8, 9, 66, 67, 81, + -23, -30, -94, 82, -11, 8, 9, 66, 67, 81, 63, 64, 65, 80, -10, -146, -44, -12, -40, -9, - 157, 12, 146, -93, 142, 82, 10, -94, 37, 38, - -4, -93, 82, 144, 158, 145, 10, -97, -48, 146, + 157, 12, 146, -94, 142, 82, 10, -95, 37, 38, + -4, -94, 82, 144, 158, 145, 10, -98, -48, 146, -48, -25, -1, 79, 146, -48, 144, -14, 97, 98, - 144, -14, 144, -15, -19, -14, 144, -98, -27, 12, - 157, -99, -1, 12, -112, -14, 144, 129, 130, 87, + 144, -14, 144, -15, -19, -14, 144, -99, -27, 12, + 157, -100, -1, 12, -112, -14, 144, 129, 130, 87, 89, 88, 159, 151, 161, 167, 153, 152, 162, 131, 163, 164, 132, 133, 134, 135, 136, 137, 165, 138, 166, 139, 90, 150, 146, 146, 146, 142, -14, 10, -147, 151, 10, 10, -15, -19, -14, 52, 52, 160, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 146, -14, 104, 105, -18, -19, -93, 79, + 127, 128, 146, -14, 104, 105, -18, -19, -94, 79, 82, -11, -12, 98, -18, -14, -14, -14, -14, -42, -14, -50, -14, -14, -14, -14, -14, -14, -14, -49, - 146, -48, -14, 148, 148, -131, 17, -100, -33, 12, - 76, 77, -14, 57, -43, -11, -41, -93, 79, 82, + 146, -48, -14, 148, 148, -131, 17, -101, -33, 12, + 76, 77, -14, 57, -43, -11, -41, -94, 79, 82, -21, -10, -146, -12, 146, 146, -14, -14, 146, -14, - -14, 148, -100, 17, 17, 75, -100, 148, 146, -103, - -102, -14, 151, 148, 148, 82, -80, 146, -93, 78, + -14, 148, -101, 17, 17, 75, -101, 148, 146, -104, + -103, -14, 151, 148, 148, 82, -80, 146, -94, 78, 148, 142, -10, 157, 78, -80, 142, 147, 144, 142, - -92, -93, 144, 158, -95, -5, -93, 82, -96, -6, - -93, 82, 29, -93, 10, 160, -24, 143, 2, -25, + -93, -94, 144, 158, -96, -5, -94, 82, -97, -6, + -94, 82, 29, -94, 10, 160, -24, 143, 2, -25, -51, -52, 51, -25, 145, -86, -25, 145, 21, -147, -110, -109, -14, -82, 142, 145, 144, 144, 144, 144, 144, 158, -16, 142, -19, 144, 158, -147, 160, 144, 158, -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, -43, -14, 145, -113, - -56, -19, -19, -15, -114, 10, -97, 144, 144, 10, + -56, -19, -19, -15, -114, 10, -98, 144, 144, 10, 146, -89, 55, -91, 55, 58, -14, 151, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -104, -38, -19, 59, 82, -93, 78, 78, 147, 147, + -105, -38, -19, 59, 82, -94, 78, 78, 147, 147, 147, 147, -13, -14, -13, 141, -33, -33, 17, 148, 57, -14, 11, -19, -141, -142, -40, -39, -10, -146, - 10, 142, -79, -80, 78, 82, -93, 57, -10, 78, - -101, -36, -19, -15, -19, -15, -14, -13, 140, 75, - 75, -13, -103, 149, -151, 158, 58, -17, -19, -13, + 10, 142, -79, -80, 78, 82, -94, 57, -10, 78, + -102, -36, -19, -15, -19, -15, -14, -13, 140, 75, + 75, -13, -104, 149, -151, 158, 58, -17, -19, -13, -13, 10, 147, -125, -50, -68, -15, -19, 151, 83, -80, -39, -40, 10, 52, -13, -14, -39, -40, 10, - -14, 144, -92, 143, -80, -4, 144, 158, 29, -93, - 144, 158, 29, -93, 10, 29, 160, -28, -77, -7, - -31, -93, 79, 82, 60, 148, -8, 62, -78, 18, - 74, -11, 154, 155, 153, 152, 146, 146, -107, -97, - -97, -48, 144, 158, -111, 144, -111, 144, -27, -14, + -14, 144, -93, 143, -80, -4, 144, 158, 29, -94, + 144, 158, 29, -94, 10, 29, 160, -28, -77, -7, + -31, -94, 79, 82, 60, 148, -8, 62, -78, 18, + 74, -11, 154, 155, 153, 152, 146, 146, -107, -98, + -98, -48, 144, 158, -111, 144, -111, 144, -27, -14, 12, 146, -28, -14, 145, -14, 147, 158, 29, 29, 147, 158, 160, 143, 146, -118, -119, -63, -62, 60, - 61, -45, -93, 79, 82, -90, 56, -45, 142, -124, - -45, -15, -19, -19, 91, 147, 158, 146, -93, -137, + 61, -45, -94, 79, 82, -90, 56, -45, 142, -124, + -45, -15, -19, -19, 91, 147, 158, 146, -94, -137, -135, -134, -136, 148, -138, 57, 149, 149, -34, 10, 13, 12, 10, 143, 148, 143, -139, -76, -140, -80, - 148, 142, -10, -14, -40, -93, -141, -40, 147, 158, + 148, 142, -10, -14, -40, -94, -141, -40, 147, 158, 147, 147, 147, 149, 149, 147, -14, 151, -14, 151, 149, 149, 147, 158, 147, -17, -14, -80, -80, 149, 143, -80, -80, 143, 143, -5, 10, 29, -6, 10, 29, 10, -28, 148, 153, 152, 162, 131, 163, 164, 159, 151, 161, 132, 133, 167, 88, 89, 87, 130, 129, 134, 135, 136, 137, 165, 166, 138, 139, 150, - 82, -93, 146, -132, -133, -77, 17, 78, -77, -77, + 82, -94, 146, -132, -133, -77, 17, 78, -77, -77, -77, -77, -77, 147, -54, 93, 94, -108, 22, 144, -110, -14, 143, 32, 33, -111, 31, -111, 143, 160, -118, -14, 144, -56, -87, -19, 151, 59, -87, -57, -25, 145, 10, -28, -115, 41, -118, 147, 158, -147, - 82, -93, 142, -124, -120, 158, -43, 160, -38, -104, + 82, -94, 142, -124, -120, 158, -43, 160, -38, -105, 148, -136, -138, -13, -141, 149, -14, -145, 148, 148, -13, -14, 143, -144, -36, 58, -17, -17, -68, 10, 10, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, 145, -77, -93, + -77, -77, -77, -77, -77, -77, -77, 145, -77, -94, -132, 149, -151, 158, 58, 10, 52, 147, 144, -48, -25, -55, 93, 94, 144, 144, -14, -150, 145, 144, 143, 144, 31, -28, 147, -88, 58, -19, 146, -88, - -97, 160, -58, 42, 146, 147, -106, 44, -63, -148, - 83, -93, -120, 143, -65, -121, -66, -67, -122, -130, + -98, 160, -58, 42, 146, 147, -92, 44, -63, -148, + 83, -94, -120, 143, -65, -121, -66, -67, -122, -130, 47, 38, 44, -75, 103, 102, 101, 98, 99, 100, -45, -79, -14, 147, -13, 149, -139, 149, -138, -13, -13, 149, 143, -143, 57, -14, 151, 149, -77, 145, - 147, -77, -77, -25, 95, -48, 145, -110, -150, -97, - 144, -106, 147, -87, -104, 147, 28, -28, 142, -45, + 147, -77, -77, -25, 95, -48, 145, -110, -150, -98, + 144, -92, 147, -87, -105, 147, 28, -28, 142, -45, 142, 142, 146, 12, 143, -123, 12, 144, 158, -1, -75, 10, -126, -45, 149, 143, 149, 149, -141, -17, - -77, 58, 144, 145, -97, 147, -97, 142, -84, -25, - 145, 147, -84, 144, -97, 12, -97, -97, -105, 12, + -77, 58, 144, 145, -98, 147, -98, 142, -84, -25, + 145, 147, -84, 144, -98, 12, -98, -98, -106, 12, 151, 160, 144, 158, 160, 10, -147, 160, -81, 158, - 144, 142, -77, -97, -85, -25, 145, -97, -97, 143, + 144, 142, -77, -98, -85, -25, 145, -98, -98, 143, 147, 143, 143, 147, 158, 12, -28, 12, -28, 160, 10, -28, -45, -127, -128, -69, -70, -71, -72, -73, - -45, 10, -97, 143, 26, 142, 12, 151, 160, -28, + -45, 10, -98, 143, 26, 142, 12, 151, 160, -28, 146, 143, -69, 144, 144, 45, 29, 78, 24, 144, - -97, 12, -28, -118, -129, -45, -74, -75, 10, 144, + -98, 12, -28, -118, -129, -45, -74, -75, 10, 144, 143, 147, 158, 10, -116, -117, -59, 41, -83, 144, - 142, -45, -59, 146, -97, -45, 143, 12, 147, 142, - -97, 143, + 142, -45, -59, 146, -98, -45, 143, 12, 147, 142, + -98, 143, } var yyDef = [...]int{ @@ -2325,14 +2326,14 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:276 + //line php5/php5.y:278 { yylex.(*Parser).rootNode = node.NewRoot(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) } case 2: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:284 + //line php5/php5.y:286 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2340,13 +2341,13 @@ yydefault: } case 3: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:289 + //line php5/php5.y:291 { yyVAL.list = []node.Node{} } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:294 + //line php5/php5.y:296 { namePart := name.NewNamePart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2355,7 +2356,7 @@ yydefault: } case 5: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:301 + //line php5/php5.y:303 { namePart := name.NewNamePart(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2364,32 +2365,32 @@ yydefault: } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:311 + //line php5/php5.y:313 { // error yyVAL.node = nil } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:316 + //line php5/php5.y:318 { yyVAL.node = yyDollar[1].node } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:318 + //line php5/php5.y:320 { yyVAL.node = yyDollar[1].node } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:320 + //line php5/php5.y:322 { yyVAL.node = yyDollar[1].node } case 10: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:322 + //line php5/php5.y:324 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2397,7 +2398,7 @@ yydefault: } case 11: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:328 + //line php5/php5.y:330 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2409,7 +2410,7 @@ yydefault: } case 12: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:338 + //line php5/php5.y:340 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2421,7 +2422,7 @@ yydefault: } case 13: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:348 + //line php5/php5.y:350 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2429,7 +2430,7 @@ yydefault: } case 14: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:354 + //line php5/php5.y:356 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2437,7 +2438,7 @@ yydefault: } case 15: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:360 + //line php5/php5.y:362 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2449,7 +2450,7 @@ yydefault: } case 16: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:370 + //line php5/php5.y:372 { useType := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2461,25 +2462,25 @@ yydefault: } case 17: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:380 + //line php5/php5.y:382 { yyVAL.node = yyDollar[1].node } case 18: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:385 + //line php5/php5.y:387 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:387 + //line php5/php5.y:389 { yyVAL.list = []node.Node{yyDollar[1].node} } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:392 + //line php5/php5.y:394 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2491,7 +2492,7 @@ yydefault: } case 21: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:402 + //line php5/php5.y:404 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2506,7 +2507,7 @@ yydefault: } case 22: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:415 + //line php5/php5.y:417 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2518,7 +2519,7 @@ yydefault: } case 23: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:425 + //line php5/php5.y:427 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2533,19 +2534,19 @@ yydefault: } case 24: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:441 + //line php5/php5.y:443 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:443 + //line php5/php5.y:445 { yyVAL.list = []node.Node{yyDollar[1].node} } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:448 + //line php5/php5.y:450 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2557,7 +2558,7 @@ yydefault: } case 27: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:458 + //line php5/php5.y:460 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2572,7 +2573,7 @@ yydefault: } case 28: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:471 + //line php5/php5.y:473 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2584,7 +2585,7 @@ yydefault: } case 29: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:481 + //line php5/php5.y:483 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2599,19 +2600,19 @@ yydefault: } case 30: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:497 + //line php5/php5.y:499 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:499 + //line php5/php5.y:501 { yyVAL.list = []node.Node{yyDollar[1].node} } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:504 + //line php5/php5.y:506 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2623,7 +2624,7 @@ yydefault: } case 33: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:514 + //line php5/php5.y:516 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -2638,7 +2639,7 @@ yydefault: } case 34: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:527 + //line php5/php5.y:529 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2650,7 +2651,7 @@ yydefault: } case 35: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:537 + //line php5/php5.y:539 { name := name.NewName(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) @@ -2665,7 +2666,7 @@ yydefault: } case 36: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:553 + //line php5/php5.y:555 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -2683,7 +2684,7 @@ yydefault: } case 37: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:569 + //line php5/php5.y:571 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -2701,7 +2702,7 @@ yydefault: } case 38: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:588 + //line php5/php5.y:590 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2709,38 +2710,38 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:594 + //line php5/php5.y:596 { yyVAL.list = []node.Node{} } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:600 + //line php5/php5.y:602 { // error yyVAL.node = nil } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:605 + //line php5/php5.y:607 { yyVAL.node = yyDollar[1].node } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:607 + //line php5/php5.y:609 { yyVAL.node = yyDollar[1].node } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:609 + //line php5/php5.y:611 { yyVAL.node = yyDollar[1].node } case 44: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:611 + //line php5/php5.y:613 { yyVAL.node = stmt.NewHaltCompiler() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -2748,13 +2749,13 @@ yydefault: } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:621 + //line php5/php5.y:623 { yyVAL.node = yyDollar[1].node } case 46: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:623 + //line php5/php5.y:625 { label := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2766,7 +2767,7 @@ yydefault: } case 47: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:636 + //line php5/php5.y:638 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2774,7 +2775,7 @@ yydefault: } case 48: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:642 + //line php5/php5.y:644 { yyVAL.node = stmt.NewIf(yyDollar[2].node, yyDollar[3].node, yyDollar[4].list, yyDollar[5].node) @@ -2790,7 +2791,7 @@ yydefault: } case 49: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:656 + //line php5/php5.y:658 { stmts := stmt.NewStmtList(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) @@ -2801,7 +2802,7 @@ yydefault: } case 50: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:665 + //line php5/php5.y:667 { switch n := yyDollar[3].node.(type) { case *stmt.While: @@ -2817,7 +2818,7 @@ yydefault: } case 51: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:679 + //line php5/php5.y:681 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2825,7 +2826,7 @@ yydefault: } case 52: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:685 + //line php5/php5.y:687 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -2845,7 +2846,7 @@ yydefault: } case 53: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:703 + //line php5/php5.y:705 { switch n := yyDollar[3].node.(type) { case *stmt.Switch: @@ -2863,7 +2864,7 @@ yydefault: } case 54: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:719 + //line php5/php5.y:721 { yyVAL.node = stmt.NewBreak(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2871,7 +2872,7 @@ yydefault: } case 55: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:725 + //line php5/php5.y:727 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2879,7 +2880,7 @@ yydefault: } case 56: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:731 + //line php5/php5.y:733 { yyVAL.node = stmt.NewContinue(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2887,7 +2888,7 @@ yydefault: } case 57: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:737 + //line php5/php5.y:739 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2895,7 +2896,7 @@ yydefault: } case 58: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:743 + //line php5/php5.y:745 { yyVAL.node = stmt.NewReturn(nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -2903,7 +2904,7 @@ yydefault: } case 59: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:749 + //line php5/php5.y:751 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2911,7 +2912,7 @@ yydefault: } case 60: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:755 + //line php5/php5.y:757 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2919,7 +2920,7 @@ yydefault: } case 61: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:761 + //line php5/php5.y:763 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2927,7 +2928,7 @@ yydefault: } case 62: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:767 + //line php5/php5.y:769 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2935,7 +2936,7 @@ yydefault: } case 63: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:773 + //line php5/php5.y:775 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2943,7 +2944,7 @@ yydefault: } case 64: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:779 + //line php5/php5.y:781 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -2951,7 +2952,7 @@ yydefault: } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:785 + //line php5/php5.y:787 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -2959,7 +2960,7 @@ yydefault: } case 66: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:791 + //line php5/php5.y:793 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -2967,7 +2968,7 @@ yydefault: } case 67: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:797 + //line php5/php5.y:799 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) @@ -2975,7 +2976,7 @@ yydefault: } case 68: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:803 + //line php5/php5.y:805 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3006,7 +3007,7 @@ yydefault: } case 69: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:832 + //line php5/php5.y:834 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3037,7 +3038,7 @@ yydefault: } case 70: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:861 + //line php5/php5.y:863 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) @@ -3045,7 +3046,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:867 + //line php5/php5.y:869 { yyVAL.node = stmt.NewNop() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3053,7 +3054,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:873 + //line php5/php5.y:875 { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3067,7 +3068,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:885 + //line php5/php5.y:887 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -3075,7 +3076,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:891 + //line php5/php5.y:893 { label := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3087,13 +3088,13 @@ yydefault: } case 75: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:904 + //line php5/php5.y:906 { yyVAL.list = []node.Node{} } case 76: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:906 + //line php5/php5.y:908 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3111,13 +3112,13 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:924 + //line php5/php5.y:926 { yyVAL.node = nil } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:926 + //line php5/php5.y:928 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3125,31 +3126,31 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:935 + //line php5/php5.y:937 { yyVAL.list = yyDollar[1].list } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:937 + //line php5/php5.y:939 { yyVAL.list = []node.Node{} } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:942 + //line php5/php5.y:944 { yyVAL.list = []node.Node{yyDollar[1].node} } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:944 + //line php5/php5.y:946 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:949 + //line php5/php5.y:951 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3165,61 +3166,61 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:966 + //line php5/php5.y:968 { yyVAL.list = []node.Node{yyDollar[1].node} } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:968 + //line php5/php5.y:970 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:973 + //line php5/php5.y:975 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:978 + //line php5/php5.y:980 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:983 + //line php5/php5.y:985 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:988 + //line php5/php5.y:990 { yyVAL.token = nil } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:990 + //line php5/php5.y:992 { yyVAL.token = yyDollar[1].token } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:995 + //line php5/php5.y:997 { yyVAL.token = nil } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:997 + //line php5/php5.y:999 { yyVAL.token = yyDollar[1].token } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:1002 + //line php5/php5.y:1004 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3231,7 +3232,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:1015 + //line php5/php5.y:1017 { switch n := yyDollar[1].node.(type) { case *stmt.Class: @@ -3254,7 +3255,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1036 + //line php5/php5.y:1038 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -3266,7 +3267,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1050 + //line php5/php5.y:1052 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3274,7 +3275,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1056 + //line php5/php5.y:1058 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3286,7 +3287,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1066 + //line php5/php5.y:1068 { yyVAL.node = stmt.NewTrait(nil, nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3294,7 +3295,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1072 + //line php5/php5.y:1074 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3306,13 +3307,13 @@ yydefault: } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1085 + //line php5/php5.y:1087 { yyVAL.ClassExtends = nil } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1087 + //line php5/php5.y:1089 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3321,19 +3322,19 @@ yydefault: } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1097 + //line php5/php5.y:1099 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1102 + //line php5/php5.y:1104 { yyVAL.InterfaceExtends = nil } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1104 + //line php5/php5.y:1106 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -3342,13 +3343,13 @@ yydefault: } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1114 + //line php5/php5.y:1116 { yyVAL.ClassImplements = nil } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1116 + //line php5/php5.y:1118 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -3357,43 +3358,43 @@ yydefault: } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1126 + //line php5/php5.y:1128 { yyVAL.list = []node.Node{yyDollar[1].node} } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1128 + //line php5/php5.y:1130 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1133 + //line php5/php5.y:1135 { yyVAL.node = nil } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1135 + //line php5/php5.y:1137 { yyVAL.node = yyDollar[2].node } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1140 + //line php5/php5.y:1142 { yyVAL.node = yyDollar[1].node } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1142 + //line php5/php5.y:1144 { yyVAL.node = expr.NewReference(yyDollar[2].node) } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1144 + //line php5/php5.y:1146 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3402,14 +3403,14 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1154 + //line php5/php5.y:1156 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1159 + //line php5/php5.y:1161 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -3419,14 +3420,14 @@ yydefault: } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1171 + //line php5/php5.y:1173 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1176 + //line php5/php5.y:1178 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) @@ -3436,13 +3437,13 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1188 + //line php5/php5.y:1190 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1190 + //line php5/php5.y:1192 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3450,7 +3451,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1200 + //line php5/php5.y:1202 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3464,7 +3465,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1212 + //line php5/php5.y:1214 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3478,7 +3479,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1228 + //line php5/php5.y:1230 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3488,7 +3489,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1236 + //line php5/php5.y:1238 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3498,7 +3499,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1244 + //line php5/php5.y:1246 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -3508,7 +3509,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1252 + //line php5/php5.y:1254 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -3519,13 +3520,13 @@ yydefault: } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1265 + //line php5/php5.y:1267 { yyVAL.list = []node.Node{} } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1267 + //line php5/php5.y:1269 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) @@ -3534,7 +3535,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1274 + //line php5/php5.y:1276 { _default := stmt.NewDefault(yyDollar[4].list) yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) @@ -3543,14 +3544,14 @@ yydefault: } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1291 + //line php5/php5.y:1293 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1296 + //line php5/php5.y:1298 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -3560,13 +3561,13 @@ yydefault: } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1309 + //line php5/php5.y:1311 { yyVAL.list = nil } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1311 + //line php5/php5.y:1313 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) @@ -3576,13 +3577,13 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1323 + //line php5/php5.y:1325 { yyVAL.list = nil } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1325 + //line php5/php5.y:1327 { stmts := stmt.NewStmtList(yyDollar[5].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[5].list)) @@ -3595,13 +3596,13 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1340 + //line php5/php5.y:1342 { yyVAL.node = nil } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1342 + //line php5/php5.y:1344 { yyVAL.node = stmt.NewElse(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3609,13 +3610,13 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1352 + //line php5/php5.y:1354 { yyVAL.node = nil } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1354 + //line php5/php5.y:1356 { stmts := stmt.NewStmtList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) @@ -3626,31 +3627,31 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1367 + //line php5/php5.y:1369 { yyVAL.list = yyDollar[1].list } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1369 + //line php5/php5.y:1371 { yyVAL.list = nil } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1374 + //line php5/php5.y:1376 { yyVAL.list = []node.Node{yyDollar[1].node} } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1376 + //line php5/php5.y:1378 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1381 + //line php5/php5.y:1383 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3678,7 +3679,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1407 + //line php5/php5.y:1409 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3706,13 +3707,13 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1437 + //line php5/php5.y:1439 { yyVAL.node = nil } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1439 + //line php5/php5.y:1441 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3720,7 +3721,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1445 + //line php5/php5.y:1447 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3728,13 +3729,13 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1451 + //line php5/php5.y:1453 { yyVAL.node = yyDollar[1].node } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1457 + //line php5/php5.y:1459 { yyVAL.node = node.NewArgumentList(nil) @@ -3743,7 +3744,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1464 + //line php5/php5.y:1466 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -3752,7 +3753,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1471 + //line php5/php5.y:1473 { arg := node.NewArgument(yyDollar[2].node, false, false) yyVAL.node = node.NewArgumentList([]node.Node{arg}) @@ -3763,19 +3764,19 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1484 + //line php5/php5.y:1486 { yyVAL.list = []node.Node{yyDollar[1].node} } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1486 + //line php5/php5.y:1488 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1491 + //line php5/php5.y:1493 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3783,7 +3784,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1497 + //line php5/php5.y:1499 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -3791,7 +3792,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1503 + //line php5/php5.y:1505 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -3799,7 +3800,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1509 + //line php5/php5.y:1511 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3807,19 +3808,19 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1518 + //line php5/php5.y:1520 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1520 + //line php5/php5.y:1522 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1526 + //line php5/php5.y:1528 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3831,7 +3832,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1536 + //line php5/php5.y:1538 { yyVAL.node = expr.NewVariable(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -3839,7 +3840,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1542 + //line php5/php5.y:1544 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -3847,7 +3848,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1552 + //line php5/php5.y:1554 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3866,7 +3867,7 @@ yydefault: } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1569 + //line php5/php5.y:1571 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -3885,7 +3886,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1586 + //line php5/php5.y:1588 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3904,7 +3905,7 @@ yydefault: } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1603 + //line php5/php5.y:1605 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -3923,19 +3924,19 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1625 + //line php5/php5.y:1627 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1627 + //line php5/php5.y:1629 { yyVAL.list = []node.Node{} } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1633 + //line php5/php5.y:1635 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) @@ -3943,19 +3944,19 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1639 + //line php5/php5.y:1641 { yyVAL.node = yyDollar[1].node } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1641 + //line php5/php5.y:1643 { yyVAL.node = yyDollar[1].node } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1643 + //line php5/php5.y:1645 { name := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -3973,7 +3974,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1662 + //line php5/php5.y:1664 { var adaptationList *stmt.TraitAdaptationList switch n := yyDollar[3].node.(type) { @@ -3989,19 +3990,19 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1679 + //line php5/php5.y:1681 { yyVAL.list = []node.Node{yyDollar[1].node} } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1681 + //line php5/php5.y:1683 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1686 + //line php5/php5.y:1688 { yyVAL.node = stmt.NewNop() @@ -4009,7 +4010,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1692 + //line php5/php5.y:1694 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4017,43 +4018,43 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1701 + //line php5/php5.y:1703 { yyVAL.list = nil } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1703 + //line php5/php5.y:1705 { yyVAL.list = yyDollar[1].list } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1708 + //line php5/php5.y:1710 { yyVAL.list = []node.Node{yyDollar[1].node} } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1710 + //line php5/php5.y:1712 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1715 + //line php5/php5.y:1717 { yyVAL.node = yyDollar[1].node } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1717 + //line php5/php5.y:1719 { yyVAL.node = yyDollar[1].node } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1722 + //line php5/php5.y:1724 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) @@ -4061,19 +4062,19 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1731 + //line php5/php5.y:1733 { yyVAL.list = []node.Node{yyDollar[1].node} } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1733 + //line php5/php5.y:1735 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1738 + //line php5/php5.y:1740 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4085,13 +4086,13 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1748 + //line php5/php5.y:1750 { yyVAL.node = yyDollar[1].node } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1753 + //line php5/php5.y:1755 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4103,7 +4104,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1766 + //line php5/php5.y:1768 { alias := node.NewIdentifier(yyDollar[4].token.Value) yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -4115,7 +4116,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1776 + //line php5/php5.y:1778 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4123,19 +4124,19 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1785 + //line php5/php5.y:1787 { yyVAL.node = nil } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1787 + //line php5/php5.y:1789 { yyVAL.node = yyDollar[1].node } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1792 + //line php5/php5.y:1794 { yyVAL.node = stmt.NewNop() @@ -4143,7 +4144,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1798 + //line php5/php5.y:1800 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -4151,13 +4152,13 @@ yydefault: } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1807 + //line php5/php5.y:1809 { yyVAL.list = yyDollar[1].list } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1809 + //line php5/php5.y:1811 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4167,31 +4168,31 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1820 + //line php5/php5.y:1822 { yyVAL.list = nil } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1822 + //line php5/php5.y:1824 { yyVAL.list = yyDollar[1].list } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1827 + //line php5/php5.y:1829 { yyVAL.list = []node.Node{yyDollar[1].node} } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1829 + //line php5/php5.y:1831 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 204: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1834 + //line php5/php5.y:1836 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4199,7 +4200,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1840 + //line php5/php5.y:1842 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4207,7 +4208,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1846 + //line php5/php5.y:1848 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4215,7 +4216,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1852 + //line php5/php5.y:1854 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4223,7 +4224,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1858 + //line php5/php5.y:1860 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4231,7 +4232,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1864 + //line php5/php5.y:1866 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4239,7 +4240,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1873 + //line php5/php5.y:1875 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4257,7 +4258,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1889 + //line php5/php5.y:1891 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4275,7 +4276,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1905 + //line php5/php5.y:1907 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4293,7 +4294,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1921 + //line php5/php5.y:1923 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -4311,7 +4312,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1940 + //line php5/php5.y:1942 { name := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -4328,7 +4329,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1955 + //line php5/php5.y:1957 { name := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -4344,55 +4345,55 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1972 + //line php5/php5.y:1974 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1974 + //line php5/php5.y:1976 { yyVAL.list = []node.Node{yyDollar[1].node} } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1980 + //line php5/php5.y:1982 { yyVAL.list = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1982 + //line php5/php5.y:1984 { yyVAL.list = yyDollar[1].list } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1987 + //line php5/php5.y:1989 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1989 + //line php5/php5.y:1991 { yyVAL.list = []node.Node{yyDollar[1].node} } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1994 + //line php5/php5.y:1996 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1996 + //line php5/php5.y:1998 { yyVAL.list = yyDollar[1].list } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2001 + //line php5/php5.y:2003 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -4401,7 +4402,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2008 + //line php5/php5.y:2010 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) @@ -4410,37 +4411,37 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2018 + //line php5/php5.y:2020 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2020 + //line php5/php5.y:2022 { yyVAL.list = yyDollar[1].list } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2022 + //line php5/php5.y:2024 { yyVAL.list = yyDollar[1].list } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2027 + //line php5/php5.y:2029 { yyVAL.list = nil } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2029 + //line php5/php5.y:2031 { yyVAL.list = yyDollar[1].list } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2034 + //line php5/php5.y:2036 { if yyDollar[3].node != nil { @@ -4455,7 +4456,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:2050 + //line php5/php5.y:2052 { list := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -4467,7 +4468,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2060 + //line php5/php5.y:2062 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4475,7 +4476,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2066 + //line php5/php5.y:2068 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4483,7 +4484,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:2072 + //line php5/php5.y:2074 { var _new *expr.New @@ -4502,7 +4503,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2089 + //line php5/php5.y:2091 { yyVAL.node = expr.NewClone(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4510,7 +4511,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2095 + //line php5/php5.y:2097 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4518,7 +4519,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2101 + //line php5/php5.y:2103 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4526,7 +4527,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2107 + //line php5/php5.y:2109 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4534,7 +4535,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2113 + //line php5/php5.y:2115 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4542,7 +4543,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2119 + //line php5/php5.y:2121 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4550,7 +4551,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2125 + //line php5/php5.y:2127 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4558,7 +4559,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2131 + //line php5/php5.y:2133 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4566,7 +4567,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2137 + //line php5/php5.y:2139 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4574,7 +4575,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2143 + //line php5/php5.y:2145 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4582,7 +4583,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2149 + //line php5/php5.y:2151 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4590,7 +4591,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2155 + //line php5/php5.y:2157 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4598,7 +4599,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2161 + //line php5/php5.y:2163 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4606,7 +4607,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2167 + //line php5/php5.y:2169 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4614,7 +4615,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2173 + //line php5/php5.y:2175 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4622,7 +4623,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2179 + //line php5/php5.y:2181 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) @@ -4630,7 +4631,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2185 + //line php5/php5.y:2187 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4638,7 +4639,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2191 + //line php5/php5.y:2193 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4646,7 +4647,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2197 + //line php5/php5.y:2199 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4654,7 +4655,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2203 + //line php5/php5.y:2205 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4662,7 +4663,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2209 + //line php5/php5.y:2211 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4670,7 +4671,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2215 + //line php5/php5.y:2217 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4678,7 +4679,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2221 + //line php5/php5.y:2223 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4686,7 +4687,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2227 + //line php5/php5.y:2229 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4694,7 +4695,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2233 + //line php5/php5.y:2235 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4702,7 +4703,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2239 + //line php5/php5.y:2241 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4710,7 +4711,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2245 + //line php5/php5.y:2247 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4718,7 +4719,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2251 + //line php5/php5.y:2253 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4726,7 +4727,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2257 + //line php5/php5.y:2259 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4734,7 +4735,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2263 + //line php5/php5.y:2265 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4742,7 +4743,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2269 + //line php5/php5.y:2271 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4750,7 +4751,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2275 + //line php5/php5.y:2277 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4758,7 +4759,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2281 + //line php5/php5.y:2283 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4766,7 +4767,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2287 + //line php5/php5.y:2289 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4774,7 +4775,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2293 + //line php5/php5.y:2295 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4782,7 +4783,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2299 + //line php5/php5.y:2301 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4790,7 +4791,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2305 + //line php5/php5.y:2307 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4798,7 +4799,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2311 + //line php5/php5.y:2313 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4806,7 +4807,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2317 + //line php5/php5.y:2319 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4814,7 +4815,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2323 + //line php5/php5.y:2325 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4822,7 +4823,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2329 + //line php5/php5.y:2331 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4830,7 +4831,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2335 + //line php5/php5.y:2337 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4838,7 +4839,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2341 + //line php5/php5.y:2343 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4846,7 +4847,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2347 + //line php5/php5.y:2349 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4854,7 +4855,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2353 + //line php5/php5.y:2355 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4862,7 +4863,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2359 + //line php5/php5.y:2361 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4870,7 +4871,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2365 + //line php5/php5.y:2367 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -4878,19 +4879,19 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2371 + //line php5/php5.y:2373 { yyVAL.node = yyDollar[1].node } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2373 + //line php5/php5.y:2375 { yyVAL.node = yyDollar[1].node } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2375 + //line php5/php5.y:2377 { yyVAL.node = yyDollar[2].node @@ -4918,7 +4919,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2401 + //line php5/php5.y:2403 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -4926,7 +4927,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2407 + //line php5/php5.y:2409 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -4934,13 +4935,13 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2413 + //line php5/php5.y:2415 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2415 + //line php5/php5.y:2417 { yyVAL.node = cast.NewInt(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4948,7 +4949,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2421 + //line php5/php5.y:2423 { yyVAL.node = cast.NewDouble(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4956,7 +4957,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2427 + //line php5/php5.y:2429 { yyVAL.node = cast.NewString(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4964,7 +4965,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2433 + //line php5/php5.y:2435 { yyVAL.node = cast.NewArray(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4972,7 +4973,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2439 + //line php5/php5.y:2441 { yyVAL.node = cast.NewObject(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4980,7 +4981,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2445 + //line php5/php5.y:2447 { yyVAL.node = cast.NewBool(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4988,7 +4989,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2451 + //line php5/php5.y:2453 { yyVAL.node = cast.NewUnset(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -4996,7 +4997,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2457 + //line php5/php5.y:2459 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -5008,7 +5009,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2467 + //line php5/php5.y:2469 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5016,25 +5017,25 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2473 + //line php5/php5.y:2475 { yyVAL.node = yyDollar[1].node } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2475 + //line php5/php5.y:2477 { yyVAL.node = yyDollar[1].node } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2477 + //line php5/php5.y:2479 { yyVAL.node = yyDollar[1].node } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2479 + //line php5/php5.y:2481 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5042,7 +5043,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2485 + //line php5/php5.y:2487 { yyVAL.node = expr.NewPrint(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5050,7 +5051,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2491 + //line php5/php5.y:2493 { yyVAL.node = expr.NewYield(nil, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5058,25 +5059,25 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:2497 + //line php5/php5.y:2499 { - yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].list, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") + yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].ClosureUse, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:2504 + //line php5/php5.y:2506 { - yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") + yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2514 + //line php5/php5.y:2516 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5084,7 +5085,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2520 + //line php5/php5.y:2522 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5092,7 +5093,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2526 + //line php5/php5.y:2528 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5100,7 +5101,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2532 + //line php5/php5.y:2534 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) @@ -5108,7 +5109,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2541 + //line php5/php5.y:2543 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5116,7 +5117,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2547 + //line php5/php5.y:2549 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5124,7 +5125,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2553 + //line php5/php5.y:2555 { str := scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(str, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5136,7 +5137,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2563 + //line php5/php5.y:2565 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5144,7 +5145,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2572 + //line php5/php5.y:2574 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5152,7 +5153,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2578 + //line php5/php5.y:2580 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5160,25 +5161,27 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2587 + //line php5/php5.y:2589 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2592 + //line php5/php5.y:2594 { - yyVAL.list = []node.Node{} + yyVAL.ClosureUse = nil } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2594 + //line php5/php5.y:2596 { - yyVAL.list = yyDollar[3].list + yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) + + yylex.(*Parser).positions.AddPosition(yyVAL.ClosureUse, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2599 + //line php5/php5.y:2605 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5188,15 +5191,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).comments.AddComments(variable, yyDollar[3].token.Comments()) - use := expr.NewClosureUse(variable) - yylex.(*Parser).positions.AddPosition(use, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(use, yyDollar[3].token.Comments()) - - yyVAL.list = append(yyDollar[1].list, use) + yyVAL.list = append(yyDollar[1].list, variable) } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2615 + //line php5/php5.y:2617 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -5208,15 +5207,11 @@ yydefault: reference := expr.NewReference(variable) - use := expr.NewClosureUse(reference) - yylex.(*Parser).positions.AddPosition(use, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(use, yyDollar[3].token.Comments()) - - yyVAL.list = append(yyDollar[1].list, use) + yyVAL.list = append(yyDollar[1].list, reference) } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2633 + //line php5/php5.y:2631 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5226,15 +5221,11 @@ yydefault: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - use := expr.NewClosureUse(variable) - yylex.(*Parser).positions.AddPosition(use, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(use, yyDollar[1].token.Comments()) - - yyVAL.list = []node.Node{use} + yyVAL.list = []node.Node{variable} } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2649 + //line php5/php5.y:2643 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5246,15 +5237,11 @@ yydefault: reference := expr.NewReference(variable) - use := expr.NewClosureUse(reference) - yylex.(*Parser).positions.AddPosition(use, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(use, yyDollar[1].token.Comments()) - - yyVAL.list = []node.Node{use} + yyVAL.list = []node.Node{reference} } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2670 + //line php5/php5.y:2660 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5266,7 +5253,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2680 + //line php5/php5.y:2670 { funcName := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5278,7 +5265,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2690 + //line php5/php5.y:2680 { funcName := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5290,7 +5277,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2700 + //line php5/php5.y:2690 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5298,7 +5285,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2706 + //line php5/php5.y:2696 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5306,7 +5293,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2712 + //line php5/php5.y:2702 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5314,7 +5301,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2718 + //line php5/php5.y:2708 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5322,7 +5309,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2724 + //line php5/php5.y:2714 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) @@ -5330,7 +5317,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2733 + //line php5/php5.y:2723 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5338,7 +5325,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2739 + //line php5/php5.y:2729 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5346,7 +5333,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2745 + //line php5/php5.y:2735 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5354,7 +5341,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2751 + //line php5/php5.y:2741 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5362,7 +5349,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2760 + //line php5/php5.y:2750 { yyVAL.node = name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5370,7 +5357,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2766 + //line php5/php5.y:2756 { yyVAL.node = name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5378,7 +5365,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2772 + //line php5/php5.y:2762 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5386,19 +5373,19 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2781 + //line php5/php5.y:2771 { yyVAL.node = yyDollar[1].node } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2783 + //line php5/php5.y:2773 { yyVAL.node = yyDollar[1].node } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2788 + //line php5/php5.y:2778 { yyVAL.node = yyDollar[1].node @@ -5436,79 +5423,79 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2824 + //line php5/php5.y:2814 { yyVAL.node = yyDollar[1].node } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2830 + //line php5/php5.y:2820 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2832 + //line php5/php5.y:2822 { yyVAL.list = []node.Node{} } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2838 + //line php5/php5.y:2828 { yyVAL.list = yyDollar[2].list } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2843 + //line php5/php5.y:2833 { yyVAL.node = nil } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2845 + //line php5/php5.y:2835 { yyVAL.node = nil } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2847 + //line php5/php5.y:2837 { yyVAL.node = yyDollar[1].node } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2852 + //line php5/php5.y:2842 { yyVAL.list = []node.Node{} } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2854 + //line php5/php5.y:2844 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2856 + //line php5/php5.y:2846 { yyVAL.list = yyDollar[1].list } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2861 + //line php5/php5.y:2851 { yyVAL.node = nil } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2863 + //line php5/php5.y:2853 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2868 + //line php5/php5.y:2858 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5516,7 +5503,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2874 + //line php5/php5.y:2864 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5524,7 +5511,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2880 + //line php5/php5.y:2870 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5532,7 +5519,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2886 + //line php5/php5.y:2876 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5540,7 +5527,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2892 + //line php5/php5.y:2882 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5548,7 +5535,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2898 + //line php5/php5.y:2888 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5556,7 +5543,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2904 + //line php5/php5.y:2894 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5564,7 +5551,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2910 + //line php5/php5.y:2900 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5572,7 +5559,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2916 + //line php5/php5.y:2906 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5580,7 +5567,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2922 + //line php5/php5.y:2912 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5588,7 +5575,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2928 + //line php5/php5.y:2918 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -5600,7 +5587,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2938 + //line php5/php5.y:2928 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) @@ -5608,7 +5595,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2947 + //line php5/php5.y:2937 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -5620,25 +5607,25 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2960 + //line php5/php5.y:2950 { yyVAL.node = yyDollar[1].node } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2965 + //line php5/php5.y:2955 { yyVAL.node = yyDollar[1].node } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2967 + //line php5/php5.y:2957 { yyVAL.node = yyDollar[1].node } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2969 + //line php5/php5.y:2959 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5650,7 +5637,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2979 + //line php5/php5.y:2969 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -5662,7 +5649,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2989 + //line php5/php5.y:2979 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -5674,7 +5661,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2999 + //line php5/php5.y:2989 { yyVAL.node = expr.NewArray(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -5682,7 +5669,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3005 + //line php5/php5.y:2995 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -5690,13 +5677,13 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3011 + //line php5/php5.y:3001 { yyVAL.node = yyDollar[1].node } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3013 + //line php5/php5.y:3003 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -5704,13 +5691,13 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3019 + //line php5/php5.y:3009 { yyVAL.node = yyDollar[1].node } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3024 + //line php5/php5.y:3014 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -5718,7 +5705,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3030 + //line php5/php5.y:3020 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5726,7 +5713,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3036 + //line php5/php5.y:3026 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5734,7 +5721,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3042 + //line php5/php5.y:3032 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5742,7 +5729,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3048 + //line php5/php5.y:3038 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5750,7 +5737,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3054 + //line php5/php5.y:3044 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5758,7 +5745,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3060 + //line php5/php5.y:3050 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5766,7 +5753,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3066 + //line php5/php5.y:3056 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5774,7 +5761,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3072 + //line php5/php5.y:3062 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5782,7 +5769,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3078 + //line php5/php5.y:3068 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5790,7 +5777,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3084 + //line php5/php5.y:3074 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5798,7 +5785,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3090 + //line php5/php5.y:3080 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5806,7 +5793,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3096 + //line php5/php5.y:3086 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5814,7 +5801,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3102 + //line php5/php5.y:3092 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5822,7 +5809,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3108 + //line php5/php5.y:3098 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5830,7 +5817,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3114 + //line php5/php5.y:3104 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5838,7 +5825,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3120 + //line php5/php5.y:3110 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5846,7 +5833,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3126 + //line php5/php5.y:3116 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5854,7 +5841,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3132 + //line php5/php5.y:3122 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5862,7 +5849,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3138 + //line php5/php5.y:3128 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5870,7 +5857,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3144 + //line php5/php5.y:3134 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5878,7 +5865,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3150 + //line php5/php5.y:3140 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5886,7 +5873,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3156 + //line php5/php5.y:3146 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5894,7 +5881,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3162 + //line php5/php5.y:3152 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5902,7 +5889,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3168 + //line php5/php5.y:3158 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5910,7 +5897,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3174 + //line php5/php5.y:3164 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5918,7 +5905,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3180 + //line php5/php5.y:3170 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5926,7 +5913,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3186 + //line php5/php5.y:3176 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -5934,7 +5921,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3192 + //line php5/php5.y:3182 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) @@ -5942,7 +5929,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3198 + //line php5/php5.y:3188 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) @@ -5950,7 +5937,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3204 + //line php5/php5.y:3194 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5958,7 +5945,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3210 + //line php5/php5.y:3200 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -5966,19 +5953,19 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3216 + //line php5/php5.y:3206 { yyVAL.node = yyDollar[2].node } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3221 + //line php5/php5.y:3211 { yyVAL.node = yyDollar[1].node } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3223 + //line php5/php5.y:3213 { name := name.NewName(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) @@ -5990,7 +5977,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3233 + //line php5/php5.y:3223 { name := name.NewRelative(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) @@ -6002,7 +5989,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3243 + //line php5/php5.y:3233 { name := name.NewFullyQualified(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) @@ -6014,7 +6001,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3256 + //line php5/php5.y:3246 { name := node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6026,25 +6013,25 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3266 + //line php5/php5.y:3256 { yyVAL.node = yyDollar[1].node } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3268 + //line php5/php5.y:3258 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3270 + //line php5/php5.y:3260 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3272 + //line php5/php5.y:3262 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6052,7 +6039,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3278 + //line php5/php5.y:3268 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6060,7 +6047,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3284 + //line php5/php5.y:3274 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6068,19 +6055,19 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3293 + //line php5/php5.y:3283 { yyVAL.list = nil } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3295 + //line php5/php5.y:3285 { yyVAL.list = yyDollar[1].list } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3305 + //line php5/php5.y:3295 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -6090,7 +6077,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3313 + //line php5/php5.y:3303 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6100,7 +6087,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3321 + //line php5/php5.y:3311 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6110,7 +6097,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3329 + //line php5/php5.y:3319 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6120,49 +6107,49 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3340 + //line php5/php5.y:3330 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3342 + //line php5/php5.y:3332 { yyVAL.node = yyDollar[1].node } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3347 + //line php5/php5.y:3337 { yyVAL.node = yyDollar[2].node } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3349 + //line php5/php5.y:3339 { yyVAL.node = yyDollar[2].node } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3355 + //line php5/php5.y:3345 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3361 + //line php5/php5.y:3351 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3366 + //line php5/php5.y:3356 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3371 + //line php5/php5.y:3361 { yyVAL.node = yyDollar[1].node @@ -6217,25 +6204,25 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3424 + //line php5/php5.y:3414 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3429 + //line php5/php5.y:3419 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3431 + //line php5/php5.y:3421 { yyVAL.list = []node.Node{} } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3437 + //line php5/php5.y:3427 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -6246,7 +6233,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3449 + //line php5/php5.y:3439 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6255,7 +6242,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3456 + //line php5/php5.y:3446 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6264,38 +6251,38 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3466 + //line php5/php5.y:3456 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3474 + //line php5/php5.y:3464 { yyVAL.list = []node.Node{yyDollar[1].node} } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3476 + //line php5/php5.y:3466 { yyVAL.list = yyDollar[1].list } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3478 + //line php5/php5.y:3468 { yyVAL.list = nil } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3483 + //line php5/php5.y:3473 { yyVAL.node = yyDollar[1].node } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3485 + //line php5/php5.y:3475 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6307,7 +6294,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3498 + //line php5/php5.y:3488 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6315,7 +6302,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3504 + //line php5/php5.y:3494 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6323,13 +6310,13 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3514 + //line php5/php5.y:3504 { yyVAL.node = yyDollar[1].node } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3519 + //line php5/php5.y:3509 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6337,7 +6324,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3525 + //line php5/php5.y:3515 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6345,31 +6332,31 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3533 + //line php5/php5.y:3523 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3534 + //line php5/php5.y:3524 { yyVAL.node = yyDollar[1].node } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3535 + //line php5/php5.y:3525 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3541 + //line php5/php5.y:3531 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3543 + //line php5/php5.y:3533 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6381,13 +6368,13 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3553 + //line php5/php5.y:3543 { yyVAL.node = yyDollar[1].node } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3558 + //line php5/php5.y:3548 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6395,7 +6382,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3564 + //line php5/php5.y:3554 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) @@ -6403,13 +6390,13 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3570 + //line php5/php5.y:3560 { yyVAL.node = yyDollar[1].node } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3576 + //line php5/php5.y:3566 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6421,7 +6408,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3586 + //line php5/php5.y:3576 { yyVAL.node = expr.NewVariable(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6429,25 +6416,25 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3595 + //line php5/php5.y:3585 { yyVAL.node = nil } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3597 + //line php5/php5.y:3587 { yyVAL.node = yyDollar[1].node } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3603 + //line php5/php5.y:3593 { yyVAL.list = yyDollar[1].list } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3605 + //line php5/php5.y:3595 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6456,7 +6443,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3615 + //line php5/php5.y:3605 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6465,7 +6452,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3622 + //line php5/php5.y:3612 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6474,7 +6461,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3629 + //line php5/php5.y:3619 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6483,7 +6470,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3639 + //line php5/php5.y:3629 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6491,13 +6478,13 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3645 + //line php5/php5.y:3635 { yyVAL.node = yyDollar[2].node } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3650 + //line php5/php5.y:3640 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6507,7 +6494,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3658 + //line php5/php5.y:3648 { n := expr.NewVariable(nil) yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6521,13 +6508,13 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3673 + //line php5/php5.y:3663 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3675 + //line php5/php5.y:3665 { if yyDollar[1].node == nil { yyVAL.list = []node.Node{} @@ -6537,7 +6524,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3687 + //line php5/php5.y:3677 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6545,7 +6532,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3693 + //line php5/php5.y:3683 { item := expr.NewList(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6557,25 +6544,25 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3703 + //line php5/php5.y:3693 { yyVAL.node = nil } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3709 + //line php5/php5.y:3699 { yyVAL.list = []node.Node{} } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3711 + //line php5/php5.y:3701 { yyVAL.list = yyDollar[1].list } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3716 + //line php5/php5.y:3706 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) @@ -6585,7 +6572,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3724 + //line php5/php5.y:3714 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) @@ -6595,7 +6582,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3732 + //line php5/php5.y:3722 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) @@ -6605,7 +6592,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3740 + //line php5/php5.y:3730 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) @@ -6615,7 +6602,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3748 + //line php5/php5.y:3738 { reference := expr.NewReference(yyDollar[6].node) arrayItem := expr.NewArrayItem(yyDollar[3].node, reference) @@ -6626,7 +6613,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3757 + //line php5/php5.y:3747 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -6637,7 +6624,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3766 + //line php5/php5.y:3756 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(yyDollar[1].node, reference) @@ -6648,7 +6635,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3775 + //line php5/php5.y:3765 { reference := expr.NewReference(yyDollar[2].node) arrayItem := expr.NewArrayItem(nil, reference) @@ -6659,13 +6646,13 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3787 + //line php5/php5.y:3777 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3789 + //line php5/php5.y:3779 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6674,13 +6661,13 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3796 + //line php5/php5.y:3786 { yyVAL.list = []node.Node{yyDollar[1].node} } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3798 + //line php5/php5.y:3788 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6689,7 +6676,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3808 + //line php5/php5.y:3798 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6701,7 +6688,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3818 + //line php5/php5.y:3808 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6716,7 +6703,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3831 + //line php5/php5.y:3821 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6734,7 +6721,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3847 + //line php5/php5.y:3837 { yyVAL.node = yyDollar[2].node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) @@ -6742,7 +6729,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3853 + //line php5/php5.y:3843 { identifier := node.NewIdentifier(yyDollar[2].token.Value) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6757,13 +6744,13 @@ yydefault: } case 500: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3867 + //line php5/php5.y:3857 { yyVAL.node = yyDollar[2].node } case 501: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3872 + //line php5/php5.y:3862 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6771,7 +6758,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3878 + //line php5/php5.y:3868 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -6785,7 +6772,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3890 + //line php5/php5.y:3880 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) @@ -6797,7 +6784,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3903 + //line php5/php5.y:3893 { yyVAL.node = expr.NewIsset(yyDollar[3].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6805,7 +6792,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3909 + //line php5/php5.y:3899 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6813,7 +6800,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3915 + //line php5/php5.y:3905 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6821,7 +6808,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3921 + //line php5/php5.y:3911 { yyVAL.node = expr.NewInclude(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6829,7 +6816,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3927 + //line php5/php5.y:3917 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6837,7 +6824,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3933 + //line php5/php5.y:3923 { yyVAL.node = expr.NewEval(yyDollar[3].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) @@ -6845,7 +6832,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3939 + //line php5/php5.y:3929 { yyVAL.node = expr.NewRequire(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6853,7 +6840,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3945 + //line php5/php5.y:3935 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) @@ -6861,31 +6848,31 @@ yydefault: } case 512: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3954 + //line php5/php5.y:3944 { yyVAL.list = []node.Node{yyDollar[1].node} } case 513: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3956 + //line php5/php5.y:3946 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) } case 514: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3961 + //line php5/php5.y:3951 { yyVAL.node = yyDollar[1].node } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3963 + //line php5/php5.y:3953 { yyVAL.node = yyDollar[1].node } case 516: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3968 + //line php5/php5.y:3958 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6897,7 +6884,7 @@ yydefault: } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3978 + //line php5/php5.y:3968 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6909,7 +6896,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3991 + //line php5/php5.y:3981 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) @@ -6921,7 +6908,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:4004 + //line php5/php5.y:3994 { target := node.NewIdentifier(yyDollar[3].token.Value) yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) diff --git a/php5/php5.y b/php5/php5.y index 3687f9f..94947e7 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -27,6 +27,7 @@ import ( ClassExtends *stmt.ClassExtends ClassImplements *stmt.ClassImplements InterfaceExtends *stmt.InterfaceExtends + ClosureUse *expr.ClosureUse } %type $unk @@ -252,10 +253,11 @@ import ( %type extends_from %type implements_list %type interface_extends_list +%type lexical_vars %type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations %type inner_statement_list global_var_list static_var_list encaps_list isset_variables non_empty_array_pair_list -%type array_pair_list assignment_list lexical_var_list lexical_vars elseif_list new_elseif_list non_empty_for_expr +%type array_pair_list assignment_list lexical_var_list elseif_list new_elseif_list non_empty_for_expr %type for_expr case_list echo_expr_list unset_variables declare_list catch_statement additional_catches %type non_empty_additional_catches parameter_list non_empty_parameter_list class_statement_list %type class_statement_list variable_modifiers method_modifiers class_variable_declaration @@ -2589,9 +2591,13 @@ function: lexical_vars: /* empty */ - { $$ = []node.Node{} } + { $$ = nil } | T_USE '(' lexical_var_list ')' - { $$ = $3; } + { + $$ = expr.NewClosureUse($3) + + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + } ; lexical_var_list: @@ -2605,11 +2611,7 @@ lexical_var_list: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).comments.AddComments(variable, $3.Comments()) - use := expr.NewClosureUse(variable) - yylex.(*Parser).positions.AddPosition(use, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).comments.AddComments(use, $3.Comments()) - - $$ = append($1, use) + $$ = append($1, variable) } | lexical_var_list ',' '&' T_VARIABLE { @@ -2623,11 +2625,7 @@ lexical_var_list: reference := expr.NewReference(variable) - use := expr.NewClosureUse(reference) - yylex.(*Parser).positions.AddPosition(use, yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) - yylex.(*Parser).comments.AddComments(use, $3.Comments()) - - $$ = append($1, use) + $$ = append($1, reference) } | T_VARIABLE { @@ -2639,11 +2637,7 @@ lexical_var_list: yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - use := expr.NewClosureUse(variable) - yylex.(*Parser).positions.AddPosition(use, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(use, $1.Comments()) - - $$ = []node.Node{use} + $$ = []node.Node{variable} } | '&' T_VARIABLE { @@ -2657,11 +2651,7 @@ lexical_var_list: reference := expr.NewReference(variable) - use := expr.NewClosureUse(reference) - yylex.(*Parser).positions.AddPosition(use, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - yylex.(*Parser).comments.AddComments(use, $1.Comments()) - - $$ = []node.Node{use} + $$ = []node.Node{reference} } ; diff --git a/php5/php5_test.go b/php5/php5_test.go index a10fe16..8a5dc81 100644 --- a/php5/php5_test.go +++ b/php5/php5_test.go @@ -523,7 +523,6 @@ func TestPhp5(t *testing.T) { &stmt.Expression{ Expr: &expr.Closure{ Params: expectedParams, - Uses: []node.Node{}, Stmts: []node.Node{}, }, }, @@ -531,7 +530,6 @@ func TestPhp5(t *testing.T) { Expr: &expr.Closure{ Static: true, Params: expectedParams, - Uses: []node.Node{}, Stmts: []node.Node{}, }, }, @@ -1987,7 +1985,6 @@ func TestPhp5(t *testing.T) { ReturnsRef: false, Static: false, PhpDocComment: "", - Uses: []node.Node{}, Stmts: []node.Node{}, }, }, @@ -2008,12 +2005,10 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, }, - Uses: []node.Node{ - &expr.ClosureUse{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - }, - &expr.ClosureUse{ - Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + ClosureUse: &expr.ClosureUse{ + Uses: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, }, }, Stmts: []node.Node{}, @@ -2036,12 +2031,10 @@ func TestPhp5(t *testing.T) { Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, }, - Uses: []node.Node{ - &expr.ClosureUse{ - Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "c"}}}, - }, - &expr.ClosureUse{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}, + ClosureUse: &expr.ClosureUse{ + Uses: []node.Node{ + &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "c"}}}, + &expr.Variable{VarName: &node.Identifier{Value: "d"}}, }, }, Stmts: []node.Node{}, @@ -2052,7 +2045,6 @@ func TestPhp5(t *testing.T) { ReturnsRef: false, Static: false, PhpDocComment: "", - Uses: []node.Node{}, Stmts: []node.Node{}, }, }, diff --git a/php7/php7.go b/php7/php7.go index 21da154..8a46d70 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -31,6 +31,7 @@ type yySymType struct { ClassExtends *stmt.ClassExtends ClassImplements *stmt.ClassImplements InterfaceExtends *stmt.InterfaceExtends + ClosureUse *expr.ClosureUse } const T_INCLUDE = 57346 @@ -345,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:4279 +//line php7/php7.y:4288 //line yacctab:1 var yyExca = [...]int{ @@ -1433,10 +1434,10 @@ var yyPgo = [...]int{ 853, 5, 852, 83, 40, 845, 138, 43, 840, 837, 835, 825, 823, 119, 822, 819, 818, 817, 12, 815, 814, 44, 42, 32, 2, 15, 629, 41, 74, 812, - 809, 807, 14, 806, 803, 47, 39, 802, 8, 686, - 20, 536, 800, 121, 798, 797, 795, 71, 791, 33, - 789, 787, 30, 37, 786, 784, 28, 783, 776, 545, - 773, 18, 768, 767, 26, 765, 63, 1, 4, 763, + 809, 807, 14, 806, 803, 47, 39, 802, 18, 8, + 686, 20, 536, 800, 121, 798, 797, 795, 71, 791, + 33, 789, 787, 30, 37, 786, 784, 28, 783, 776, + 545, 773, 768, 767, 26, 765, 63, 1, 4, 763, 17, 761, 760, 755, 7, 745, 6, 742, } var yyR1 = [...]int{ @@ -1449,28 +1450,28 @@ var yyR1 = [...]int{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 116, 116, - 93, 93, 10, 10, 10, 9, 9, 9, 9, 9, + 94, 94, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 89, 89, 16, 16, 18, 18, 7, 7, 103, 103, - 102, 102, 109, 109, 17, 17, 20, 20, 19, 19, - 97, 97, 117, 117, 22, 22, 22, 22, 22, 22, + 90, 90, 16, 16, 18, 18, 7, 7, 104, 104, + 103, 103, 110, 110, 17, 17, 20, 20, 19, 19, + 98, 98, 117, 117, 22, 22, 22, 22, 22, 22, 22, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 95, 95, 94, 94, 26, - 26, 108, 108, 27, 12, 1, 1, 2, 2, 13, + 11, 11, 11, 11, 11, 96, 96, 95, 95, 26, + 26, 109, 109, 27, 12, 1, 1, 2, 2, 13, 13, 125, 125, 76, 76, 14, 15, 85, 85, 87, - 87, 86, 86, 90, 90, 90, 90, 83, 83, 82, - 82, 25, 25, 80, 80, 80, 80, 106, 106, 106, + 87, 86, 86, 91, 91, 91, 91, 83, 83, 82, + 82, 25, 25, 80, 80, 80, 80, 107, 107, 107, 8, 8, 84, 84, 67, 67, 65, 65, 69, 69, 66, 66, 118, 118, 119, 119, 29, 29, 30, 30, 75, 75, 73, 73, 73, 74, 74, 77, 77, 115, - 115, 31, 31, 101, 101, 33, 105, 105, 34, 34, + 115, 31, 31, 102, 102, 33, 106, 106, 34, 34, 120, 120, 35, 35, 35, 35, 124, 124, 79, 79, - 79, 107, 107, 36, 36, 37, 38, 38, 38, 38, + 79, 108, 108, 36, 36, 37, 38, 38, 38, 38, 40, 40, 39, 81, 81, 122, 122, 121, 121, 123, - 123, 88, 88, 88, 88, 88, 88, 104, 104, 41, - 41, 96, 96, 68, 21, 98, 98, 42, 99, 99, - 100, 100, 44, 43, 43, 32, 32, 32, 32, 32, + 123, 89, 89, 89, 89, 89, 89, 105, 105, 41, + 41, 97, 97, 68, 21, 99, 99, 42, 100, 100, + 101, 101, 44, 43, 43, 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, @@ -1478,16 +1479,16 @@ var yyR1 = [...]int{ 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, 126, 3, 3, 111, 111, 110, 110, 51, 51, + 32, 126, 3, 3, 88, 88, 111, 111, 51, 51, 52, 52, 52, 52, 45, 45, 46, 46, 49, 49, - 92, 92, 92, 78, 78, 56, 56, 56, 50, 50, + 93, 93, 93, 78, 78, 56, 56, 56, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 57, 57, 57, 23, 23, 24, 24, 55, 58, 58, 58, 59, 59, 59, 60, 60, 60, 60, 60, 60, 28, 28, 28, 47, 47, 47, 61, 61, 62, 62, 62, 62, 62, 62, 53, 53, 53, 54, 54, 54, 114, 71, 71, 113, 113, 70, - 70, 70, 70, 70, 70, 91, 91, 91, 91, 63, + 70, 70, 70, 70, 70, 92, 92, 92, 92, 63, 63, 63, 63, 63, 63, 63, 64, 64, 64, 64, 48, 48, 48, 48, 48, 48, 48, 112, 112, 72, } @@ -1556,10 +1557,10 @@ var yyChk = [...]int{ -57, -52, -45, -55, -56, 91, 49, 50, 4, 5, 84, 85, 86, 8, 9, 66, 67, 81, 63, 64, 65, 80, 62, 74, 140, 12, 157, -10, -59, 60, - 18, -93, 82, 146, 82, -93, 142, 10, -18, -89, - -109, -93, 82, 37, 38, -19, -20, -97, -21, 10, + 18, -94, 82, 146, 82, -94, 142, 10, -18, -90, + -110, -94, 82, 37, 38, -19, -20, -98, -21, 10, -117, 146, -11, 37, 79, 146, 146, -24, -23, 98, - -24, -24, -101, -33, -47, -105, 37, -34, 12, -98, + -24, -24, -102, -33, -47, -106, 37, -34, 12, -99, -42, -23, 144, 129, 130, 87, 89, 88, 159, 151, 161, 167, 153, 152, 162, 131, 163, 164, 132, 133, 134, 135, 136, 137, 165, 138, 166, 139, 115, 90, @@ -1570,19 +1571,19 @@ var yyChk = [...]int{ 146, -114, -113, -71, -70, -23, 151, 59, -23, -28, -57, 146, -56, 98, 148, -28, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -49, 146, - -23, -92, 17, -91, -63, 12, 76, 77, -23, -23, + -23, -93, 17, -92, -63, 12, 76, 77, -23, -23, -23, 148, 78, 78, -46, -44, -45, -62, 52, -10, -47, 146, 146, -23, -23, 146, -23, -23, 17, 75, - -91, -91, 17, 142, -47, -77, 146, -77, 146, 82, - -93, 147, -93, 144, 142, -116, 144, -16, -109, -93, - 82, 144, 158, 82, 29, -93, -20, 144, 158, 160, + -92, -92, 17, 142, -47, -77, 146, -77, 146, 82, + -94, 147, -94, 144, 142, -116, 144, -16, -110, -94, + 82, 144, 158, 82, 29, -94, -20, 144, 158, 160, -22, 143, 2, -11, -12, -13, -14, -15, 51, -23, - 21, -3, -99, -100, -23, -23, 144, 144, 144, 144, + 21, -3, -100, -101, -23, -23, 144, 144, 144, 144, 158, 144, 158, -3, 160, 144, 158, -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, -46, -23, 145, -23, -108, -27, -28, - -23, -97, -117, 144, 144, 10, -126, 10, -85, 55, + -23, -23, -23, -46, -23, 145, -23, -109, -27, -28, + -23, -98, -117, 144, 144, 10, -126, 10, -85, 55, -126, -87, 55, 146, -11, 146, 144, 145, -23, 151, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -24, -23, -54, 10, 142, -47, -114, @@ -1599,7 +1600,7 @@ var yyChk = [...]int{ -53, -6, -47, -78, -77, 78, 148, 142, 57, 78, -78, -112, -72, -23, -23, -23, 75, 75, 140, -23, 147, -115, -31, -23, 83, -114, 10, 144, -116, 143, - 144, 144, 82, -93, -19, 82, -93, 142, 10, 82, + 144, 144, 82, -94, -19, 82, -94, 142, 10, 82, -21, -23, 146, 147, 146, 144, 158, 147, -33, -34, -126, -23, -42, 145, -23, -7, 158, 29, 147, 143, -126, 146, -85, -86, 56, -10, 142, -126, -124, -10, @@ -1608,35 +1609,35 @@ var yyChk = [...]int{ 10, 13, 152, 12, 10, 143, 143, 148, 143, -23, 149, -77, -23, -77, -47, -24, -23, -54, -47, -85, -7, 158, 147, 147, 143, -7, 158, -23, 147, 143, - 142, 82, -103, -17, -20, -89, 142, -126, 147, -84, - -11, 145, -23, -99, -23, -80, 142, 145, 146, -23, - 147, -27, -90, -28, 151, 59, 148, -25, -11, 145, - -95, 146, -118, -119, -29, -30, -75, -73, 150, 60, + 142, 82, -104, -17, -20, -90, 142, -126, 147, -84, + -11, 145, -23, -100, -23, -80, 142, 145, 146, -23, + 147, -27, -91, -28, 151, 59, 148, -25, -11, 145, + -96, 146, -118, -119, -29, -30, -75, -73, 150, 60, 61, -10, -86, -126, -124, -120, 142, 158, 147, 147, 95, -11, 145, 143, 160, -23, -28, 146, 147, 149, 13, -23, 143, 149, 143, -86, 147, -72, 147, -31, - -102, -20, 142, -7, 158, -20, -103, 144, -117, 147, - 144, -106, 144, -106, 144, -118, 144, 147, 58, -28, + -103, -20, 142, -7, 158, -20, -104, 144, -117, 147, + 144, -107, 144, -107, 144, -118, 144, 147, 58, -28, 146, -114, -117, -26, 41, 42, -118, 147, 158, -1, 151, -73, -126, 142, 143, -35, -122, -121, 44, -123, - 47, -88, 103, 102, 101, 98, 99, 100, -120, -10, + 47, -89, 103, 102, 101, 98, 99, 100, -120, -10, -11, 145, 144, -117, -23, -114, 149, -126, -7, 158, - -102, 143, -17, -7, 22, 144, -99, 143, 32, 33, - -106, 31, -106, 147, -82, -11, 145, -90, -28, -114, - 149, 28, 146, 142, 147, -111, 44, -29, -2, 83, - 142, -120, -104, -41, 12, 38, 37, -124, -88, 143, + -103, 143, -17, -7, 22, 144, -100, 143, 32, 33, + -107, 31, -107, 147, -82, -11, 145, -91, -28, -114, + 149, 28, 146, 142, 147, -88, 44, -29, -2, 83, + 142, -120, -105, -41, 12, 38, 37, -124, -89, 143, -117, 147, 143, 142, 143, -20, -7, 143, 144, 147, - -23, -8, 145, 144, 143, 144, 31, -111, -117, 147, - 147, 144, -94, -10, -117, -74, 145, -74, 146, 12, - -120, 143, 144, 158, -126, 160, -96, -68, -6, -3, + -23, -8, 145, 144, 143, 144, 31, -88, -117, 147, + 147, 144, -95, -10, -117, -74, 145, -74, 146, 12, + -120, 143, 144, 158, -126, 160, -97, -68, -6, -3, -79, 144, 142, -120, 143, -83, -11, 145, -8, -117, 144, -74, 26, -82, 12, 159, 143, 142, -75, 142, - -110, -51, 12, 151, 160, 143, -41, -23, 144, 158, - 160, -6, 143, -107, -36, -37, -38, -39, -40, -10, + -111, -51, 12, 151, 160, 143, -41, -23, 144, 158, + 160, -6, 143, -108, -36, -37, -38, -39, -40, -10, -6, 79, 10, 143, -117, -117, 142, 144, 147, -10, -117, -117, 147, 158, 12, -23, -126, -68, -23, -126, 143, -36, 144, 144, 45, 29, 78, 24, -117, 142, - 143, 143, -51, -126, 146, -124, 10, -4, -88, -6, + 143, 143, -51, -126, 146, -124, 10, -4, -89, -6, 144, 143, -117, -118, -6, 143, 147, -74, -81, 144, 142, -117, 143, } @@ -2113,7 +2114,7 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:298 + //line php7/php7.y:300 { yylex.(*Parser).rootNode = node.NewRoot(yyDollar[1].list) @@ -2122,463 +2123,463 @@ yydefault: } case 2: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 3: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 5: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:307 + //line php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 10: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 11: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 12: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 13: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 14: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 15: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 16: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 17: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 18: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 21: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:308 + //line php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 22: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 23: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 24: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 27: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 28: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 29: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 30: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:309 + //line php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 33: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 34: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 35: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 36: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 37: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 38: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 39: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:310 + //line php7/php7.y:312 { yyVAL.token = yyDollar[1].token } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 44: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 46: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 47: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 48: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 49: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 50: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 51: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 52: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:311 + //line php7/php7.y:313 { yyVAL.token = yyDollar[1].token } case 53: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 54: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 55: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 56: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 57: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 58: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 59: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 60: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:312 + //line php7/php7.y:314 { yyVAL.token = yyDollar[1].token } case 61: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 62: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 63: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 64: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 66: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 67: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 68: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:313 + //line php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 69: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:318 + //line php7/php7.y:320 { yyVAL.token = yyDollar[1].token } case 70: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 72: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 73: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 74: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 75: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:319 + //line php7/php7.y:321 { yyVAL.token = yyDollar[1].token } case 76: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:324 + //line php7/php7.y:326 { yyVAL.token = yyDollar[1].token } case 77: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:326 + //line php7/php7.y:328 { yyVAL.token = yyDollar[1].token } case 78: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:331 + //line php7/php7.y:333 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2586,13 +2587,13 @@ yydefault: } case 79: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:337 + //line php7/php7.y:339 { yyVAL.list = []node.Node{} } case 80: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:342 + //line php7/php7.y:344 { namePart := name.NewNamePart(yyDollar[1].token.Value) yyVAL.list = []node.Node{namePart} @@ -2605,7 +2606,7 @@ yydefault: } case 81: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:353 + //line php7/php7.y:355 { namePart := name.NewNamePart(yyDollar[3].token.Value) yyVAL.list = append(yyDollar[1].list, namePart) @@ -2619,7 +2620,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:368 + //line php7/php7.y:370 { yyVAL.node = name.NewName(yyDollar[1].list) @@ -2628,7 +2629,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:375 + //line php7/php7.y:377 { yyVAL.node = name.NewRelative(yyDollar[3].list) @@ -2641,7 +2642,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:386 + //line php7/php7.y:388 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) @@ -2653,44 +2654,44 @@ yydefault: } case 85: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:399 + //line php7/php7.y:401 { // error yyVAL.node = nil } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:404 + //line php7/php7.y:406 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:406 + //line php7/php7.y:408 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:408 + //line php7/php7.y:410 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:410 + //line php7/php7.y:412 { yyVAL.node = yyDollar[1].node } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:412 + //line php7/php7.y:414 { yyVAL.node = yyDollar[1].node } case 91: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:414 + //line php7/php7.y:416 { yyVAL.node = stmt.NewHaltCompiler() @@ -2705,7 +2706,7 @@ yydefault: } case 92: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:427 + //line php7/php7.y:429 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, nil) @@ -2720,7 +2721,7 @@ yydefault: } case 93: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:440 + //line php7/php7.y:442 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) @@ -2736,7 +2737,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:454 + //line php7/php7.y:456 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) @@ -2750,7 +2751,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:466 + //line php7/php7.y:468 { yyVAL.node = yyDollar[2].node @@ -2763,7 +2764,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:477 + //line php7/php7.y:479 { yyVAL.node = yyDollar[3].node.(*stmt.GroupUse).SetUseType(yyDollar[2].node) @@ -2776,7 +2777,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:488 + //line php7/php7.y:490 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) @@ -2789,7 +2790,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:499 + //line php7/php7.y:501 { yyVAL.node = stmt.NewUseList(yyDollar[2].node, yyDollar[3].list) @@ -2802,7 +2803,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:510 + //line php7/php7.y:512 { yyVAL.node = stmt.NewConstList(yyDollar[2].list) @@ -2815,7 +2816,7 @@ yydefault: } case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:524 + //line php7/php7.y:526 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2827,7 +2828,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:534 + //line php7/php7.y:536 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -2839,7 +2840,7 @@ yydefault: } case 102: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:547 + //line php7/php7.y:549 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2858,7 +2859,7 @@ yydefault: } case 103: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:564 + //line php7/php7.y:566 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2878,7 +2879,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:585 + //line php7/php7.y:587 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[4].list) @@ -2897,7 +2898,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:602 + //line php7/php7.y:604 { name := name.NewName(yyDollar[2].list) yyVAL.node = stmt.NewGroupUse(nil, name, yyDollar[5].list) @@ -2917,19 +2918,19 @@ yydefault: } case 106: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:623 + //line php7/php7.y:625 { yyVAL.token = nil } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:625 + //line php7/php7.y:627 { yyVAL.token = yyDollar[1].token } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:630 + //line php7/php7.y:632 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2938,13 +2939,13 @@ yydefault: } case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:637 + //line php7/php7.y:639 { yyVAL.list = []node.Node{yyDollar[1].node} } case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:642 + //line php7/php7.y:644 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2953,13 +2954,13 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:649 + //line php7/php7.y:651 { yyVAL.list = []node.Node{yyDollar[1].node} } case 112: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:654 + //line php7/php7.y:656 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -2968,25 +2969,25 @@ yydefault: } case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:661 + //line php7/php7.y:663 { yyVAL.list = []node.Node{yyDollar[1].node} } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:666 + //line php7/php7.y:668 { yyVAL.node = yyDollar[1].node } case 115: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:668 + //line php7/php7.y:670 { yyVAL.node = yyDollar[2].node.(*stmt.Use).SetUseType(yyDollar[1].node) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:673 + //line php7/php7.y:675 { name := name.NewName(yyDollar[1].list) yyVAL.node = stmt.NewUse(nil, name, nil) @@ -2997,7 +2998,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:682 + //line php7/php7.y:684 { name := name.NewName(yyDollar[1].list) alias := node.NewIdentifier(yyDollar[3].token.Value) @@ -3014,13 +3015,13 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:700 + //line php7/php7.y:702 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:702 + //line php7/php7.y:704 { yyVAL.node = yyDollar[2].node @@ -3029,7 +3030,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:712 + //line php7/php7.y:714 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3038,13 +3039,13 @@ yydefault: } case 121: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:719 + //line php7/php7.y:721 { yyVAL.list = []node.Node{yyDollar[1].node} } case 122: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:724 + //line php7/php7.y:726 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3052,50 +3053,50 @@ yydefault: } case 123: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:730 + //line php7/php7.y:732 { yyVAL.list = []node.Node{} } case 124: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:735 + //line php7/php7.y:737 { // error yyVAL.node = nil } case 125: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:740 + //line php7/php7.y:742 { yyVAL.node = yyDollar[1].node } case 126: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:742 + //line php7/php7.y:744 { yyVAL.node = yyDollar[1].node } case 127: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:744 + //line php7/php7.y:746 { yyVAL.node = yyDollar[1].node } case 128: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:746 + //line php7/php7.y:748 { yyVAL.node = yyDollar[1].node } case 129: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:748 + //line php7/php7.y:750 { yyVAL.node = yyDollar[1].node } case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:750 + //line php7/php7.y:752 { yyVAL.node = stmt.NewHaltCompiler() @@ -3110,7 +3111,7 @@ yydefault: } case 131: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:765 + //line php7/php7.y:767 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3123,19 +3124,19 @@ yydefault: } case 132: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:776 + //line php7/php7.y:778 { yyVAL.node = yyDollar[1].node } case 133: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:778 + //line php7/php7.y:780 { yyVAL.node = yyDollar[1].node } case 134: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:780 + //line php7/php7.y:782 { switch n := yyDollar[5].node.(type) { case *stmt.While: @@ -3156,7 +3157,7 @@ yydefault: } case 135: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:799 + //line php7/php7.y:801 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[5].node) @@ -3172,7 +3173,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:813 + //line php7/php7.y:815 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -3199,7 +3200,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:838 + //line php7/php7.y:840 { switch n := yyDollar[5].node.(type) { case *stmt.Switch: @@ -3222,7 +3223,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:859 + //line php7/php7.y:861 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) @@ -3235,7 +3236,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:870 + //line php7/php7.y:872 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) @@ -3248,7 +3249,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:881 + //line php7/php7.y:883 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) @@ -3261,7 +3262,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:892 + //line php7/php7.y:894 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) @@ -3274,7 +3275,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:903 + //line php7/php7.y:905 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) @@ -3287,7 +3288,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:914 + //line php7/php7.y:916 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) @@ -3300,7 +3301,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:925 + //line php7/php7.y:927 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) @@ -3312,7 +3313,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:935 + //line php7/php7.y:937 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) @@ -3324,7 +3325,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:945 + //line php7/php7.y:947 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) @@ -3342,7 +3343,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:961 + //line php7/php7.y:963 { switch n := yyDollar[7].node.(type) { case *stmt.Foreach: @@ -3366,7 +3367,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:983 + //line php7/php7.y:985 { switch n := yyDollar[9].node.(type) { case *stmt.Foreach: @@ -3393,7 +3394,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1008 + //line php7/php7.y:1010 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) @@ -3407,7 +3408,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1020 + //line php7/php7.y:1022 { yyVAL.node = stmt.NewNop() @@ -3419,7 +3420,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1030 + //line php7/php7.y:1032 { if yyDollar[6].node == nil { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) @@ -3436,7 +3437,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1045 + //line php7/php7.y:1047 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) @@ -3449,7 +3450,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1056 + //line php7/php7.y:1058 { label := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewGoto(label) @@ -3465,7 +3466,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1070 + //line php7/php7.y:1072 { label := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewLabel(label) @@ -3480,13 +3481,13 @@ yydefault: } case 155: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1085 + //line php7/php7.y:1087 { yyVAL.list = []node.Node{} } case 156: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1087 + //line php7/php7.y:1089 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[5].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -3508,13 +3509,13 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1109 + //line php7/php7.y:1111 { yyVAL.list = []node.Node{yyDollar[1].node} } case 158: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1111 + //line php7/php7.y:1113 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3523,13 +3524,13 @@ yydefault: } case 159: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1121 + //line php7/php7.y:1123 { yyVAL.node = nil } case 160: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1123 + //line php7/php7.y:1125 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) @@ -3543,13 +3544,13 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1138 + //line php7/php7.y:1140 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1140 + //line php7/php7.y:1142 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3558,13 +3559,13 @@ yydefault: } case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1150 + //line php7/php7.y:1152 { yyVAL.node = yyDollar[1].node } case 164: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:1155 + //line php7/php7.y:1157 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list, yyDollar[4].str) @@ -3586,31 +3587,31 @@ yydefault: } case 165: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1179 + //line php7/php7.y:1181 { yyVAL.token = nil } case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1181 + //line php7/php7.y:1183 { yyVAL.token = yyDollar[1].token } case 167: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1186 + //line php7/php7.y:1188 { yyVAL.token = nil } case 168: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1188 + //line php7/php7.y:1190 { yyVAL.token = yyDollar[1].token } case 169: yyDollar = yyS[yypt-9 : yypt+1] - //line php7/php7.y:1193 + //line php7/php7.y:1195 { name := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewClass(name, yyDollar[1].list, nil, yyDollar[4].ClassExtends, yyDollar[5].ClassImplements, yyDollar[8].list, yyDollar[6].str) @@ -3627,7 +3628,7 @@ yydefault: } case 170: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:1208 + //line php7/php7.y:1210 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewClass(name, nil, nil, yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -3644,19 +3645,19 @@ yydefault: } case 171: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1226 + //line php7/php7.y:1228 { yyVAL.list = []node.Node{yyDollar[1].node} } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1228 + //line php7/php7.y:1230 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1233 + //line php7/php7.y:1235 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3668,7 +3669,7 @@ yydefault: } case 174: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1243 + //line php7/php7.y:1245 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -3680,7 +3681,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1256 + //line php7/php7.y:1258 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewTrait(name, yyDollar[5].list, yyDollar[3].str) @@ -3697,7 +3698,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1274 + //line php7/php7.y:1276 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[6].list, yyDollar[4].str) @@ -3714,13 +3715,13 @@ yydefault: } case 177: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1292 + //line php7/php7.y:1294 { yyVAL.ClassExtends = nil } case 178: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1294 + //line php7/php7.y:1296 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) @@ -3732,13 +3733,13 @@ yydefault: } case 179: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1307 + //line php7/php7.y:1309 { yyVAL.InterfaceExtends = nil } case 180: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1309 + //line php7/php7.y:1311 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) @@ -3750,13 +3751,13 @@ yydefault: } case 181: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1322 + //line php7/php7.y:1324 { yyVAL.ClassImplements = nil } case 182: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1324 + //line php7/php7.y:1326 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) @@ -3768,13 +3769,13 @@ yydefault: } case 183: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1337 + //line php7/php7.y:1339 { yyVAL.node = yyDollar[1].node } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1341 + //line php7/php7.y:1343 { yyVAL.node = expr.NewReference(yyDollar[2].node) @@ -3786,7 +3787,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1351 + //line php7/php7.y:1353 { yyVAL.node = expr.NewList(yyDollar[3].list) @@ -3800,7 +3801,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1363 + //line php7/php7.y:1365 { yyVAL.node = expr.NewShortList(yyDollar[2].list) @@ -3813,7 +3814,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1377 + //line php7/php7.y:1379 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) @@ -3822,7 +3823,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1384 + //line php7/php7.y:1386 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) @@ -3838,7 +3839,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1401 + //line php7/php7.y:1403 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) @@ -3847,7 +3848,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1408 + //line php7/php7.y:1410 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) @@ -3863,13 +3864,13 @@ yydefault: } case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1425 + //line php7/php7.y:1427 { yyVAL.node = yyDollar[1].node } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1427 + //line php7/php7.y:1429 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -3883,7 +3884,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1442 + //line php7/php7.y:1444 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3898,7 +3899,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1455 + //line php7/php7.y:1457 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) @@ -3914,7 +3915,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1469 + //line php7/php7.y:1471 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) @@ -3930,7 +3931,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1483 + //line php7/php7.y:1485 { caseList := stmt.NewCaseList(yyDollar[3].list) @@ -3948,13 +3949,13 @@ yydefault: } case 197: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1502 + //line php7/php7.y:1504 { yyVAL.list = []node.Node{} } case 198: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1504 + //line php7/php7.y:1506 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) yyVAL.list = append(yyDollar[1].list, _case) @@ -3968,7 +3969,7 @@ yydefault: } case 199: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1516 + //line php7/php7.y:1518 { _default := stmt.NewDefault(yyDollar[4].list) yyVAL.list = append(yyDollar[1].list, _default) @@ -3982,19 +3983,19 @@ yydefault: } case 200: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1531 + //line php7/php7.y:1533 { yyVAL.token = yyDollar[1].token } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1533 + //line php7/php7.y:1535 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1538 + //line php7/php7.y:1540 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) @@ -4003,7 +4004,7 @@ yydefault: } case 203: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1545 + //line php7/php7.y:1547 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) @@ -4019,7 +4020,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:1562 + //line php7/php7.y:1564 { yyVAL.node = stmt.NewIf(yyDollar[3].node, yyDollar[5].node, nil, nil) @@ -4033,7 +4034,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1574 + //line php7/php7.y:1576 { _elseIf := stmt.NewElseIf(yyDollar[4].node, yyDollar[6].node) yyVAL.node = yyDollar[1].node.(*stmt.If).AddElseIf(_elseIf) @@ -4049,13 +4050,13 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1591 + //line php7/php7.y:1593 { yyVAL.node = yyDollar[1].node } case 207: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1593 + //line php7/php7.y:1595 { _else := stmt.NewElse(yyDollar[3].node) yyVAL.node = yyDollar[1].node.(*stmt.If).SetElse(_else) @@ -4069,7 +4070,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1608 + //line php7/php7.y:1610 { stmts := stmt.NewStmtList(yyDollar[6].list) yyVAL.node = stmt.NewAltIf(yyDollar[3].node, stmts, nil, nil) @@ -4086,7 +4087,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-7 : yypt+1] - //line php7/php7.y:1623 + //line php7/php7.y:1625 { stmts := stmt.NewStmtList(yyDollar[7].list) _elseIf := stmt.NewAltElseIf(yyDollar[4].node, stmts) @@ -4104,7 +4105,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1642 + //line php7/php7.y:1644 { yyVAL.node = yyDollar[1].node @@ -4117,7 +4118,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1653 + //line php7/php7.y:1655 { stmts := stmt.NewStmtList(yyDollar[4].list) _else := stmt.NewAltElse(stmts) @@ -4136,25 +4137,25 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1673 + //line php7/php7.y:1675 { yyVAL.list = yyDollar[1].list } case 213: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1675 + //line php7/php7.y:1677 { yyVAL.list = nil } case 214: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1680 + //line php7/php7.y:1682 { yyVAL.list = []node.Node{yyDollar[1].node} } case 215: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1682 + //line php7/php7.y:1684 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4163,7 +4164,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1692 + //line php7/php7.y:1694 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4202,7 +4203,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1729 + //line php7/php7.y:1731 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4241,25 +4242,25 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1769 + //line php7/php7.y:1771 { yyVAL.node = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1771 + //line php7/php7.y:1773 { yyVAL.node = yyDollar[1].node } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1776 + //line php7/php7.y:1778 { yyVAL.node = yyDollar[1].node } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1778 + //line php7/php7.y:1780 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4271,7 +4272,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1791 + //line php7/php7.y:1793 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4283,7 +4284,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1801 + //line php7/php7.y:1803 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4295,19 +4296,19 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1811 + //line php7/php7.y:1813 { yyVAL.node = yyDollar[1].node } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1816 + //line php7/php7.y:1818 { yyVAL.node = nil } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1818 + //line php7/php7.y:1820 { yyVAL.node = yyDollar[2].node @@ -4316,7 +4317,7 @@ yydefault: } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1828 + //line php7/php7.y:1830 { yyVAL.node = node.NewArgumentList(nil) @@ -4325,7 +4326,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1835 + //line php7/php7.y:1837 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) @@ -4334,13 +4335,13 @@ yydefault: } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1845 + //line php7/php7.y:1847 { yyVAL.list = []node.Node{yyDollar[1].node} } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1847 + //line php7/php7.y:1849 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4349,7 +4350,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1857 + //line php7/php7.y:1859 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4358,7 +4359,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1864 + //line php7/php7.y:1866 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4370,7 +4371,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1877 + //line php7/php7.y:1879 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4379,19 +4380,19 @@ yydefault: } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1884 + //line php7/php7.y:1886 { yyVAL.list = []node.Node{yyDollar[1].node} } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1889 + //line php7/php7.y:1891 { yyVAL.node = yyDollar[1].node } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1894 + //line php7/php7.y:1896 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4400,13 +4401,13 @@ yydefault: } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1901 + //line php7/php7.y:1903 { yyVAL.list = []node.Node{yyDollar[1].node} } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1906 + //line php7/php7.y:1908 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4422,7 +4423,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1920 + //line php7/php7.y:1922 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4439,19 +4440,19 @@ yydefault: } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1938 + //line php7/php7.y:1940 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1940 + //line php7/php7.y:1942 { yyVAL.list = []node.Node{} } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1945 + //line php7/php7.y:1947 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4463,7 +4464,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1955 + //line php7/php7.y:1957 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4476,7 +4477,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1966 + //line php7/php7.y:1968 { var adaptationList *stmt.TraitAdaptationList @@ -4498,7 +4499,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:1986 + //line php7/php7.y:1988 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) @@ -4522,13 +4523,13 @@ yydefault: } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2011 + //line php7/php7.y:2013 { yyVAL.list = []node.Node{yyDollar[1].node} } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2013 + //line php7/php7.y:2015 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4537,7 +4538,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2023 + //line php7/php7.y:2025 { yyVAL.node = stmt.NewNop() @@ -4549,7 +4550,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2033 + //line php7/php7.y:2035 { yyVAL.node = stmt.NewTraitAdaptationList(nil) @@ -4561,7 +4562,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2043 + //line php7/php7.y:2045 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4573,19 +4574,19 @@ yydefault: } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2056 + //line php7/php7.y:2058 { yyVAL.list = []node.Node{yyDollar[1].node} } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2058 + //line php7/php7.y:2060 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2063 + //line php7/php7.y:2065 { yyVAL.node = yyDollar[1].node @@ -4594,7 +4595,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2070 + //line php7/php7.y:2072 { yyVAL.node = yyDollar[1].node @@ -4603,7 +4604,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2080 + //line php7/php7.y:2082 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4615,7 +4616,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2093 + //line php7/php7.y:2095 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4630,7 +4631,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2106 + //line php7/php7.y:2108 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4645,7 +4646,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2119 + //line php7/php7.y:2121 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -4660,7 +4661,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2132 + //line php7/php7.y:2134 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -4672,7 +4673,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2145 + //line php7/php7.y:2147 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -4686,13 +4687,13 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2157 + //line php7/php7.y:2159 { yyVAL.node = yyDollar[1].node } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2162 + //line php7/php7.y:2164 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -4707,7 +4708,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2178 + //line php7/php7.y:2180 { yyVAL.node = stmt.NewNop() @@ -4719,7 +4720,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2188 + //line php7/php7.y:2190 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -4732,13 +4733,13 @@ yydefault: } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2202 + //line php7/php7.y:2204 { yyVAL.list = yyDollar[1].list } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2204 + //line php7/php7.y:2206 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -4751,31 +4752,31 @@ yydefault: } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2218 + //line php7/php7.y:2220 { yyVAL.list = nil } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2220 + //line php7/php7.y:2222 { yyVAL.list = yyDollar[1].list } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2225 + //line php7/php7.y:2227 { yyVAL.list = []node.Node{yyDollar[1].node} } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2227 + //line php7/php7.y:2229 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2232 + //line php7/php7.y:2234 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4787,7 +4788,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2242 + //line php7/php7.y:2244 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4799,7 +4800,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2252 + //line php7/php7.y:2254 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4811,7 +4812,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2262 + //line php7/php7.y:2264 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4823,7 +4824,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2272 + //line php7/php7.y:2274 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4835,7 +4836,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2282 + //line php7/php7.y:2284 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4847,7 +4848,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2295 + //line php7/php7.y:2297 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4856,13 +4857,13 @@ yydefault: } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2302 + //line php7/php7.y:2304 { yyVAL.list = []node.Node{yyDollar[1].node} } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2307 + //line php7/php7.y:2309 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4878,7 +4879,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2321 + //line php7/php7.y:2323 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4895,7 +4896,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2339 + //line php7/php7.y:2341 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4904,13 +4905,13 @@ yydefault: } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2346 + //line php7/php7.y:2348 { yyVAL.list = []node.Node{yyDollar[1].node} } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2351 + //line php7/php7.y:2353 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4925,7 +4926,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2367 + //line php7/php7.y:2369 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4940,7 +4941,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2383 + //line php7/php7.y:2385 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4949,31 +4950,31 @@ yydefault: } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2390 + //line php7/php7.y:2392 { yyVAL.list = []node.Node{yyDollar[1].node} } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2395 + //line php7/php7.y:2397 { yyVAL.node = yyDollar[1].node } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2400 + //line php7/php7.y:2402 { yyVAL.list = nil } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2402 + //line php7/php7.y:2404 { yyVAL.list = yyDollar[1].list } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2407 + //line php7/php7.y:2409 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4982,13 +4983,13 @@ yydefault: } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2414 + //line php7/php7.y:2416 { yyVAL.list = []node.Node{yyDollar[1].node} } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:2419 + //line php7/php7.y:2421 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -5006,7 +5007,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2438 + //line php7/php7.y:2440 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -5021,7 +5022,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2451 + //line php7/php7.y:2453 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -5033,7 +5034,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2464 + //line php7/php7.y:2466 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5050,7 +5051,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:2479 + //line php7/php7.y:2481 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5066,7 +5067,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2493 + //line php7/php7.y:2495 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5078,7 +5079,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2503 + //line php7/php7.y:2505 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5091,7 +5092,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2514 + //line php7/php7.y:2516 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5103,7 +5104,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2524 + //line php7/php7.y:2526 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5115,7 +5116,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2534 + //line php7/php7.y:2536 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5127,7 +5128,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2544 + //line php7/php7.y:2546 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5139,7 +5140,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2554 + //line php7/php7.y:2556 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5151,7 +5152,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2564 + //line php7/php7.y:2566 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5163,7 +5164,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2574 + //line php7/php7.y:2576 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5175,7 +5176,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2584 + //line php7/php7.y:2586 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5187,7 +5188,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2594 + //line php7/php7.y:2596 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5199,7 +5200,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2604 + //line php7/php7.y:2606 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5211,7 +5212,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2614 + //line php7/php7.y:2616 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5223,7 +5224,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2624 + //line php7/php7.y:2626 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5235,7 +5236,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2634 + //line php7/php7.y:2636 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5247,7 +5248,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2644 + //line php7/php7.y:2646 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5259,7 +5260,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2654 + //line php7/php7.y:2656 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5271,7 +5272,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2664 + //line php7/php7.y:2666 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5283,7 +5284,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2674 + //line php7/php7.y:2676 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5295,7 +5296,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2684 + //line php7/php7.y:2686 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5307,7 +5308,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2694 + //line php7/php7.y:2696 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5319,7 +5320,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2704 + //line php7/php7.y:2706 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5331,7 +5332,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2714 + //line php7/php7.y:2716 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5343,7 +5344,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2724 + //line php7/php7.y:2726 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5355,7 +5356,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2734 + //line php7/php7.y:2736 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5367,7 +5368,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2744 + //line php7/php7.y:2746 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5379,7 +5380,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2754 + //line php7/php7.y:2756 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5391,7 +5392,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2764 + //line php7/php7.y:2766 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5403,7 +5404,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2774 + //line php7/php7.y:2776 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5415,7 +5416,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2784 + //line php7/php7.y:2786 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5427,7 +5428,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2794 + //line php7/php7.y:2796 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5439,7 +5440,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2804 + //line php7/php7.y:2806 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5451,7 +5452,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2814 + //line php7/php7.y:2816 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5463,7 +5464,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2824 + //line php7/php7.y:2826 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5475,7 +5476,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2834 + //line php7/php7.y:2836 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5487,7 +5488,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2844 + //line php7/php7.y:2846 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5499,7 +5500,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2854 + //line php7/php7.y:2856 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -5511,7 +5512,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2864 + //line php7/php7.y:2866 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -5523,7 +5524,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2874 + //line php7/php7.y:2876 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -5535,7 +5536,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2884 + //line php7/php7.y:2886 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -5547,7 +5548,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2894 + //line php7/php7.y:2896 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5559,7 +5560,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2904 + //line php7/php7.y:2906 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5571,7 +5572,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2914 + //line php7/php7.y:2916 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -5583,7 +5584,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2924 + //line php7/php7.y:2926 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -5595,7 +5596,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2934 + //line php7/php7.y:2936 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -5607,7 +5608,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2944 + //line php7/php7.y:2946 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5619,7 +5620,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2954 + //line php7/php7.y:2956 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -5631,7 +5632,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2964 + //line php7/php7.y:2966 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5643,7 +5644,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2974 + //line php7/php7.y:2976 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -5655,7 +5656,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2984 + //line php7/php7.y:2986 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -5667,7 +5668,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2994 + //line php7/php7.y:2996 { yyVAL.node = yyDollar[2].node @@ -5677,13 +5678,13 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3002 + //line php7/php7.y:3004 { yyVAL.node = yyDollar[1].node } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3004 + //line php7/php7.y:3006 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -5696,7 +5697,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3015 + //line php7/php7.y:3017 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -5709,7 +5710,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3026 + //line php7/php7.y:3028 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -5721,13 +5722,13 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3036 + //line php7/php7.y:3038 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3038 + //line php7/php7.y:3040 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -5739,7 +5740,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3048 + //line php7/php7.y:3050 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -5751,7 +5752,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3058 + //line php7/php7.y:3060 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -5763,7 +5764,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3068 + //line php7/php7.y:3070 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -5775,7 +5776,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3078 + //line php7/php7.y:3080 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -5787,7 +5788,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3088 + //line php7/php7.y:3090 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -5799,7 +5800,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3098 + //line php7/php7.y:3100 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -5811,7 +5812,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3108 + //line php7/php7.y:3110 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(yyDollar[2].node) @@ -5827,7 +5828,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3122 + //line php7/php7.y:3124 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -5839,13 +5840,13 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3132 + //line php7/php7.y:3134 { yyVAL.node = yyDollar[1].node } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3134 + //line php7/php7.y:3136 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -5858,7 +5859,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3145 + //line php7/php7.y:3147 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -5870,7 +5871,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3155 + //line php7/php7.y:3157 { yyVAL.node = expr.NewYield(nil, nil) @@ -5882,7 +5883,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3165 + //line php7/php7.y:3167 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -5894,7 +5895,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3175 + //line php7/php7.y:3177 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -5907,7 +5908,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3186 + //line php7/php7.y:3188 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -5919,9 +5920,9 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3196 + //line php7/php7.y:3198 { - yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].list, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) + yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[11].token)) @@ -5938,9 +5939,9 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:3213 + //line php7/php7.y:3215 { - yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].list, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) + yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].ClosureUse, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[12].token)) @@ -5958,38 +5959,46 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3234 + //line php7/php7.y:3236 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3242 + //line php7/php7.y:3244 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3244 + //line php7/php7.y:3246 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3249 + //line php7/php7.y:3251 { - yyVAL.list = []node.Node{} + yyVAL.ClosureUse = nil } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3251 + //line php7/php7.y:3253 { - yyVAL.list = yyDollar[3].list + yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.ClosureUse, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.ClosureUse, yyDollar[1].token, comment.UseToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.ClosureUse, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.ClosureUse, yyDollar[4].token, comment.CloseParenthesisToken) } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3256 + //line php7/php7.y:3268 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5998,34 +6007,31 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3263 + //line php7/php7.y:3275 { yyVAL.list = []node.Node{yyDollar[1].node} } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3268 + //line php7/php7.y:3280 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - variable := expr.NewVariable(identifier) - yyVAL.node = expr.NewClosureUse(variable) + yyVAL.node = expr.NewVariable(identifier) // save position yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3282 + //line php7/php7.y:3292 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) variable := expr.NewVariable(identifier) - reference := expr.NewReference(variable) - yyVAL.node = expr.NewClosureUse(reference) + yyVAL.node = expr.NewReference(variable) // save position yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) @@ -6034,11 +6040,11 @@ yydefault: // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AmpersandToken) - yylex.(*Parser).comments.AddFromToken(reference, yyDollar[2].token, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[2].token, comment.VariableToken) } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3301 + //line php7/php7.y:3310 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6047,7 +6053,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3308 + //line php7/php7.y:3317 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6059,7 +6065,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3318 + //line php7/php7.y:3327 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6071,7 +6077,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3328 + //line php7/php7.y:3337 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6080,7 +6086,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3338 + //line php7/php7.y:3347 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6092,67 +6098,67 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3348 + //line php7/php7.y:3357 { yyVAL.node = yyDollar[1].node } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3353 + //line php7/php7.y:3362 { yyVAL.node = yyDollar[1].node } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3355 + //line php7/php7.y:3364 { yyVAL.node = yyDollar[1].node } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3360 + //line php7/php7.y:3369 { yyVAL.node = nil } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3362 + //line php7/php7.y:3371 { yyVAL.node = yyDollar[2].node } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3367 + //line php7/php7.y:3376 { yyVAL.list = []node.Node{} } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3369 + //line php7/php7.y:3378 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3371 + //line php7/php7.y:3380 { yyVAL.list = yyDollar[1].list } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3376 + //line php7/php7.y:3385 { yyVAL.node = nil } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3378 + //line php7/php7.y:3387 { yyVAL.node = yyDollar[1].node } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3383 + //line php7/php7.y:3392 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6166,7 +6172,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3395 + //line php7/php7.y:3404 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6179,7 +6185,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3406 + //line php7/php7.y:3415 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6191,7 +6197,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3419 + //line php7/php7.y:3428 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6203,7 +6209,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3429 + //line php7/php7.y:3438 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6215,7 +6221,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3439 + //line php7/php7.y:3448 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6227,7 +6233,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3449 + //line php7/php7.y:3458 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6239,7 +6245,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3459 + //line php7/php7.y:3468 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6251,7 +6257,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3469 + //line php7/php7.y:3478 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6263,7 +6269,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3479 + //line php7/php7.y:3488 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6275,7 +6281,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3489 + //line php7/php7.y:3498 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6287,7 +6293,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3499 + //line php7/php7.y:3508 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6299,7 +6305,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3509 + //line php7/php7.y:3518 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6311,7 +6317,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3519 + //line php7/php7.y:3528 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -6325,7 +6331,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3531 + //line php7/php7.y:3540 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -6337,7 +6343,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3541 + //line php7/php7.y:3550 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -6349,7 +6355,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3551 + //line php7/php7.y:3560 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -6361,19 +6367,19 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3561 + //line php7/php7.y:3570 { yyVAL.node = yyDollar[1].node } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3563 + //line php7/php7.y:3572 { yyVAL.node = yyDollar[1].node } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3568 + //line php7/php7.y:3577 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -6382,7 +6388,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3575 + //line php7/php7.y:3584 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6397,7 +6403,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3588 + //line php7/php7.y:3597 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6412,43 +6418,43 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3604 + //line php7/php7.y:3613 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3606 + //line php7/php7.y:3615 { yyVAL.node = yyDollar[1].node } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3611 + //line php7/php7.y:3620 { yyVAL.node = nil } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3613 + //line php7/php7.y:3622 { yyVAL.node = yyDollar[1].node } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3618 + //line php7/php7.y:3627 { yyVAL.node = yyDollar[1].node } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3623 + //line php7/php7.y:3632 { yyVAL.node = yyDollar[1].node } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3625 + //line php7/php7.y:3634 { yyVAL.node = yyDollar[2].node @@ -6458,19 +6464,19 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3633 + //line php7/php7.y:3642 { yyVAL.node = yyDollar[1].node } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3638 + //line php7/php7.y:3647 { yyVAL.node = yyDollar[1].node } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3640 + //line php7/php7.y:3649 { yyVAL.node = yyDollar[2].node @@ -6480,19 +6486,19 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3648 + //line php7/php7.y:3657 { yyVAL.node = yyDollar[1].node } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3653 + //line php7/php7.y:3662 { yyVAL.node = yyDollar[1].node } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3655 + //line php7/php7.y:3664 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6505,7 +6511,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3666 + //line php7/php7.y:3675 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6518,7 +6524,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3677 + //line php7/php7.y:3686 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6531,7 +6537,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3688 + //line php7/php7.y:3697 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6543,25 +6549,25 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3698 + //line php7/php7.y:3707 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3703 + //line php7/php7.y:3712 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3705 + //line php7/php7.y:3714 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3707 + //line php7/php7.y:3716 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6573,7 +6579,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3720 + //line php7/php7.y:3729 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6587,7 +6593,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3732 + //line php7/php7.y:3741 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -6601,7 +6607,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3744 + //line php7/php7.y:3753 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6613,7 +6619,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3757 + //line php7/php7.y:3766 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6625,7 +6631,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3767 + //line php7/php7.y:3776 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6637,13 +6643,13 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3780 + //line php7/php7.y:3789 { yyVAL.node = yyDollar[1].node } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3782 + //line php7/php7.y:3791 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6656,7 +6662,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3793 + //line php7/php7.y:3802 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6669,7 +6675,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3804 + //line php7/php7.y:3813 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6681,7 +6687,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3814 + //line php7/php7.y:3823 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6693,7 +6699,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3824 + //line php7/php7.y:3833 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6705,7 +6711,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3837 + //line php7/php7.y:3846 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6717,7 +6723,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3847 + //line php7/php7.y:3856 { yyVAL.node = yyDollar[2].node @@ -6727,13 +6733,13 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3855 + //line php7/php7.y:3864 { yyVAL.node = yyDollar[1].node } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3860 + //line php7/php7.y:3869 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6745,7 +6751,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3870 + //line php7/php7.y:3879 { yyVAL.node = yyDollar[2].node @@ -6755,13 +6761,13 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3878 + //line php7/php7.y:3887 { yyVAL.node = yyDollar[1].node } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3883 + //line php7/php7.y:3892 { if yyDollar[1].list[len(yyDollar[1].list)-1] == nil { yyVAL.list = yyDollar[1].list[:len(yyDollar[1].list)-1] @@ -6771,19 +6777,19 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3894 + //line php7/php7.y:3903 { yyVAL.node = nil } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3896 + //line php7/php7.y:3905 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3901 + //line php7/php7.y:3910 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6792,13 +6798,13 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3908 + //line php7/php7.y:3917 { yyVAL.list = []node.Node{yyDollar[1].node} } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3913 + //line php7/php7.y:3922 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -6810,7 +6816,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3923 + //line php7/php7.y:3932 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -6819,7 +6825,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3930 + //line php7/php7.y:3939 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -6833,7 +6839,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3942 + //line php7/php7.y:3951 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -6846,7 +6852,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3953 + //line php7/php7.y:3962 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -6864,7 +6870,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3969 + //line php7/php7.y:3978 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -6881,13 +6887,13 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3987 + //line php7/php7.y:3996 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3989 + //line php7/php7.y:3998 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -6900,13 +6906,13 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4000 + //line php7/php7.y:4009 { yyVAL.list = []node.Node{yyDollar[1].node} } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4002 + //line php7/php7.y:4011 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -6919,7 +6925,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4016 + //line php7/php7.y:4025 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6933,7 +6939,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4028 + //line php7/php7.y:4037 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6951,7 +6957,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4044 + //line php7/php7.y:4053 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6971,7 +6977,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4062 + //line php7/php7.y:4071 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6984,7 +6990,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4073 + //line php7/php7.y:4082 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -7000,7 +7006,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:4087 + //line php7/php7.y:4096 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -7020,13 +7026,13 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4105 + //line php7/php7.y:4114 { yyVAL.node = yyDollar[2].node } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4111 + //line php7/php7.y:4120 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7038,7 +7044,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4121 + //line php7/php7.y:4130 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7055,7 +7061,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4136 + //line php7/php7.y:4145 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -7086,7 +7092,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4165 + //line php7/php7.y:4174 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(identifier) @@ -7100,7 +7106,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:4180 + //line php7/php7.y:4189 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -7117,7 +7123,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4195 + //line php7/php7.y:4204 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -7131,7 +7137,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4207 + //line php7/php7.y:4216 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -7143,7 +7149,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4217 + //line php7/php7.y:4226 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -7155,7 +7161,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4227 + //line php7/php7.y:4236 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -7169,7 +7175,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4239 + //line php7/php7.y:4248 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -7181,7 +7187,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4249 + //line php7/php7.y:4258 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -7193,13 +7199,13 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4262 + //line php7/php7.y:4271 { yyVAL.list = []node.Node{yyDollar[1].node} } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4264 + //line php7/php7.y:4273 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -7208,7 +7214,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4274 + //line php7/php7.y:4283 { yyVAL.node = yyDollar[1].node } diff --git a/php7/php7.y b/php7/php7.y index 3aa2c61..a014892 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -28,6 +28,7 @@ import ( ClassExtends *stmt.ClassExtends ClassImplements *stmt.ClassImplements InterfaceExtends *stmt.InterfaceExtends + ClosureUse *expr.ClosureUse } %type $unk @@ -271,6 +272,7 @@ import ( %type extends_from %type implements_list %type interface_extends_list +%type lexical_vars %type member_modifier %type use_type @@ -281,7 +283,7 @@ import ( %type const_list echo_expr_list for_exprs non_empty_for_exprs global_var_list %type unprefixed_use_declarations inline_use_declarations property_list static_var_list %type case_list trait_adaptation_list unset_variables -%type use_declarations lexical_var_list lexical_vars isset_variables non_empty_array_pair_list +%type use_declarations lexical_var_list isset_variables non_empty_array_pair_list %type array_pair_list non_empty_argument_list top_statement_list %type inner_statement_list parameter_list non_empty_parameter_list class_statement_list %type method_modifiers variable_modifiers @@ -3246,9 +3248,19 @@ returns_ref: lexical_vars: /* empty */ - { $$ = []node.Node{} } + { $$ = nil } | T_USE '(' lexical_var_list ')' - { $$ = $3; } + { + $$ = expr.NewClosureUse($3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + } ; lexical_var_list: @@ -3267,23 +3279,20 @@ lexical_var: T_VARIABLE { identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - variable := expr.NewVariable(identifier) - $$ = expr.NewClosureUse(variable) + $$ = expr.NewVariable(identifier) // save position yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) // save comments - yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) } | '&' T_VARIABLE { identifier := node.NewIdentifier(strings.TrimLeft($2.Value, "$")) variable := expr.NewVariable(identifier) - reference := expr.NewReference(variable) - $$ = expr.NewClosureUse(reference) + $$ = expr.NewReference(variable) // save position yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) @@ -3292,7 +3301,7 @@ lexical_var: // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.AmpersandToken) - yylex.(*Parser).comments.AddFromToken(reference, $2, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(variable, $2, comment.VariableToken) } ; diff --git a/php7/php7_test.go b/php7/php7_test.go index 17797ea..b466d4e 100644 --- a/php7/php7_test.go +++ b/php7/php7_test.go @@ -558,7 +558,6 @@ func TestPhp7(t *testing.T) { &stmt.Expression{ Expr: &expr.Closure{ Params: expectedParams, - Uses: []node.Node{}, Stmts: []node.Node{}, }, }, @@ -566,7 +565,6 @@ func TestPhp7(t *testing.T) { Expr: &expr.Closure{ Static: true, Params: expectedParams, - Uses: []node.Node{}, Stmts: []node.Node{}, }, }, @@ -2118,7 +2116,6 @@ func TestPhp7(t *testing.T) { ReturnsRef: false, Static: false, PhpDocComment: "", - Uses: []node.Node{}, Stmts: []node.Node{}, }, }, @@ -2139,12 +2136,10 @@ func TestPhp7(t *testing.T) { Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, }, - Uses: []node.Node{ - &expr.ClosureUse{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - }, - &expr.ClosureUse{ - Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + ClosureUse: &expr.ClosureUse{ + Uses: []node.Node{ + &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, }, }, Stmts: []node.Node{}, @@ -2155,7 +2150,6 @@ func TestPhp7(t *testing.T) { ReturnsRef: false, Static: false, PhpDocComment: "", - Uses: []node.Node{}, ReturnType: &name.Name{ Parts: []node.Node{&name.NamePart{Value: "void"}}, }, diff --git a/printer/printer.go b/printer/printer.go index 3cf0b5a..f1a40e1 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1006,7 +1006,10 @@ func (p *Printer) printExprClone(n node.Node) { func (p *Printer) printExprClosureUse(n node.Node) { nn := n.(*expr.ClosureUse) - p.Print(nn.Variable) + + io.WriteString(p.w, "use (") + p.joinPrint(", ", nn.Uses) + io.WriteString(p.w, ")") } func (p *Printer) printExprClosure(n node.Node) { @@ -1026,10 +1029,9 @@ func (p *Printer) printExprClosure(n node.Node) { p.joinPrint(", ", nn.Params) io.WriteString(p.w, ")") - if nn.Uses != nil { - io.WriteString(p.w, " use (") - p.joinPrint(", ", nn.Uses) - io.WriteString(p.w, ")") + if nn.ClosureUse != nil { + io.WriteString(p.w, " ") + p.Print(nn.ClosureUse) } if nn.ReturnType != nil { diff --git a/printer/printer_test.go b/printer/printer_test.go index f741cb8..e99f2bc 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -1371,10 +1371,13 @@ func TestPrintExprClosureUse(t *testing.T) { p := printer.NewPrinter(o, " ") p.Print(&expr.ClosureUse{ - Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}, + Uses: []node.Node{ + &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}}, + &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + }, }) - expected := `&$var` + expected := `use (&$foo, $bar)` actual := o.String() if expected != actual { @@ -1398,12 +1401,10 @@ func TestPrintExprClosure(t *testing.T) { Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, }, }, - Uses: []node.Node{ - &expr.ClosureUse{ - Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - }, - &expr.ClosureUse{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + ClosureUse: &expr.ClosureUse{ + Uses: []node.Node{ + &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + &expr.Variable{VarName: &node.Identifier{Value: "b"}}, }, }, ReturnType: &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, From 22cca215df528d8407f28fa36c0cca2e751c8621 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 3 Jun 2018 12:50:08 +0300 Subject: [PATCH 23/25] create `ForInitSemicolonToken` and `ForCondSemicolonToken` comment anchors --- comment/tokenNames.go | 4 ++++ php7/php7.go | 4 ++-- php7/php7.y | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/comment/tokenNames.go b/comment/tokenNames.go index cff630f..f02c45b 100644 --- a/comment/tokenNames.go +++ b/comment/tokenNames.go @@ -22,6 +22,8 @@ const ( DoToken WhileToken EndwhileToken + ForInitSemicolonToken + ForCondSemicolonToken ForToken EndforToken ForeachToken @@ -182,6 +184,8 @@ var TokenNames = map[TokenName]string{ DoToken: "DoToken", WhileToken: "WhileToken", EndwhileToken: "EndwhileToken", + ForInitSemicolonToken: "ForInitSemicolonToken", + ForCondSemicolonToken: "ForCondSemicolonToken", ForToken: "ForToken", EndforToken: "EndforToken", ForeachToken: "ForeachToken", diff --git a/php7/php7.go b/php7/php7.go index 8a46d70..5cd837d 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -3194,8 +3194,8 @@ yydefault: // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForToken) yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) - yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.ForInitSemicolonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.ForCondSemicolonToken) yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseParenthesisToken) } case 137: diff --git a/php7/php7.y b/php7/php7.y index a014892..98424da 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -832,8 +832,8 @@ statement: // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForToken) yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) - yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) - yylex.(*Parser).comments.AddFromToken($$, $6, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.ForInitSemicolonToken) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.ForCondSemicolonToken) yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseParenthesisToken) } | T_SWITCH '(' expr ')' switch_case_list From deccf266d91ab1407bdd715516afcf3d96d16b23 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Sun, 3 Jun 2018 13:43:27 +0300 Subject: [PATCH 24/25] save expr.Exit and expr.Die comments --- php7/php7.go | 289 +++++++++++++++++++++++++++------------------------ php7/php7.y | 31 +++++- 2 files changed, 182 insertions(+), 138 deletions(-) diff --git a/php7/php7.go b/php7/php7.go index 5cd837d..0dba5ce 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -346,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:4288 +//line php7/php7.y:4311 //line yacctab:1 var yyExca = [...]int{ @@ -5815,20 +5815,34 @@ yydefault: //line php7/php7.y:3110 { if strings.EqualFold(yyDollar[1].token.Value, "die") { - yyVAL.node = expr.NewDie(yyDollar[2].node) + yyVAL.node = expr.NewDie(nil) + if yyDollar[2].node != nil { + yyVAL.node.(*expr.Die).Expr = yyDollar[2].node.(*expr.Exit).Expr + } } else { - yyVAL.node = expr.NewExit(yyDollar[2].node) + yyVAL.node = expr.NewExit(nil) + if yyDollar[2].node != nil { + yyVAL.node.(*expr.Exit).Expr = yyDollar[2].node.(*expr.Exit).Expr + } } // save position - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + if yyDollar[2].node == nil { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + } else { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + } // save comments yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ExitToken) + + if yyDollar[2].node != nil { + yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, yyDollar[2].node) + } } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3124 + //line php7/php7.y:3138 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -5840,13 +5854,13 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3134 + //line php7/php7.y:3148 { yyVAL.node = yyDollar[1].node } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3136 + //line php7/php7.y:3150 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -5859,7 +5873,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3147 + //line php7/php7.y:3161 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -5871,7 +5885,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3157 + //line php7/php7.y:3171 { yyVAL.node = expr.NewYield(nil, nil) @@ -5883,7 +5897,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3167 + //line php7/php7.y:3181 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -5895,7 +5909,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3177 + //line php7/php7.y:3191 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -5908,7 +5922,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3188 + //line php7/php7.y:3202 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -5920,7 +5934,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3198 + //line php7/php7.y:3212 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) @@ -5939,7 +5953,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:3215 + //line php7/php7.y:3229 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].ClosureUse, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) @@ -5959,32 +5973,32 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3236 + //line php7/php7.y:3250 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3244 + //line php7/php7.y:3258 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3246 + //line php7/php7.y:3260 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3251 + //line php7/php7.y:3265 { yyVAL.ClosureUse = nil } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3253 + //line php7/php7.y:3267 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -5998,7 +6012,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3268 + //line php7/php7.y:3282 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6007,13 +6021,13 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3275 + //line php7/php7.y:3289 { yyVAL.list = []node.Node{yyDollar[1].node} } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3280 + //line php7/php7.y:3294 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(identifier) @@ -6027,7 +6041,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3292 + //line php7/php7.y:3306 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6044,7 +6058,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3310 + //line php7/php7.y:3324 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6053,7 +6067,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3317 + //line php7/php7.y:3331 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6065,7 +6079,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3327 + //line php7/php7.y:3341 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6077,7 +6091,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3337 + //line php7/php7.y:3351 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6086,7 +6100,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3347 + //line php7/php7.y:3361 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6098,67 +6112,74 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3357 + //line php7/php7.y:3371 { yyVAL.node = yyDollar[1].node } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3362 + //line php7/php7.y:3376 { yyVAL.node = yyDollar[1].node } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3364 + //line php7/php7.y:3378 { yyVAL.node = yyDollar[1].node } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3369 + //line php7/php7.y:3383 { yyVAL.node = nil } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3371 + //line php7/php7.y:3385 { - yyVAL.node = yyDollar[2].node + yyVAL.node = expr.NewExit(yyDollar[2].node) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3376 + //line php7/php7.y:3399 { yyVAL.list = []node.Node{} } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3378 + //line php7/php7.y:3401 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3380 + //line php7/php7.y:3403 { yyVAL.list = yyDollar[1].list } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3385 + //line php7/php7.y:3408 { yyVAL.node = nil } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3387 + //line php7/php7.y:3410 { yyVAL.node = yyDollar[1].node } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3392 + //line php7/php7.y:3415 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6172,7 +6193,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3404 + //line php7/php7.y:3427 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6185,7 +6206,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3415 + //line php7/php7.y:3438 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6197,7 +6218,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3428 + //line php7/php7.y:3451 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6209,7 +6230,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3438 + //line php7/php7.y:3461 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6221,7 +6242,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3448 + //line php7/php7.y:3471 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6233,7 +6254,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3458 + //line php7/php7.y:3481 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6245,7 +6266,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3468 + //line php7/php7.y:3491 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6257,7 +6278,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3478 + //line php7/php7.y:3501 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6269,7 +6290,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3488 + //line php7/php7.y:3511 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6281,7 +6302,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3498 + //line php7/php7.y:3521 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6293,7 +6314,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3508 + //line php7/php7.y:3531 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6305,7 +6326,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3518 + //line php7/php7.y:3541 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6317,7 +6338,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3528 + //line php7/php7.y:3551 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -6331,7 +6352,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3540 + //line php7/php7.y:3563 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -6343,7 +6364,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3550 + //line php7/php7.y:3573 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -6355,7 +6376,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3560 + //line php7/php7.y:3583 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -6367,19 +6388,19 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3570 + //line php7/php7.y:3593 { yyVAL.node = yyDollar[1].node } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3572 + //line php7/php7.y:3595 { yyVAL.node = yyDollar[1].node } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3577 + //line php7/php7.y:3600 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -6388,7 +6409,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3584 + //line php7/php7.y:3607 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6403,7 +6424,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3597 + //line php7/php7.y:3620 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6418,43 +6439,43 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3613 + //line php7/php7.y:3636 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3615 + //line php7/php7.y:3638 { yyVAL.node = yyDollar[1].node } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3620 + //line php7/php7.y:3643 { yyVAL.node = nil } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3622 + //line php7/php7.y:3645 { yyVAL.node = yyDollar[1].node } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3627 + //line php7/php7.y:3650 { yyVAL.node = yyDollar[1].node } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3632 + //line php7/php7.y:3655 { yyVAL.node = yyDollar[1].node } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3634 + //line php7/php7.y:3657 { yyVAL.node = yyDollar[2].node @@ -6464,19 +6485,19 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3642 + //line php7/php7.y:3665 { yyVAL.node = yyDollar[1].node } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3647 + //line php7/php7.y:3670 { yyVAL.node = yyDollar[1].node } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3649 + //line php7/php7.y:3672 { yyVAL.node = yyDollar[2].node @@ -6486,19 +6507,19 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3657 + //line php7/php7.y:3680 { yyVAL.node = yyDollar[1].node } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3662 + //line php7/php7.y:3685 { yyVAL.node = yyDollar[1].node } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3664 + //line php7/php7.y:3687 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6511,7 +6532,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3675 + //line php7/php7.y:3698 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6524,7 +6545,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3686 + //line php7/php7.y:3709 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6537,7 +6558,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3697 + //line php7/php7.y:3720 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6549,25 +6570,25 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3707 + //line php7/php7.y:3730 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3712 + //line php7/php7.y:3735 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3714 + //line php7/php7.y:3737 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3716 + //line php7/php7.y:3739 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6579,7 +6600,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3729 + //line php7/php7.y:3752 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6593,7 +6614,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3741 + //line php7/php7.y:3764 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -6607,7 +6628,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3753 + //line php7/php7.y:3776 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6619,7 +6640,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3766 + //line php7/php7.y:3789 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6631,7 +6652,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3776 + //line php7/php7.y:3799 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6643,13 +6664,13 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3789 + //line php7/php7.y:3812 { yyVAL.node = yyDollar[1].node } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3791 + //line php7/php7.y:3814 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6662,7 +6683,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3802 + //line php7/php7.y:3825 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6675,7 +6696,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3813 + //line php7/php7.y:3836 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6687,7 +6708,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3823 + //line php7/php7.y:3846 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6699,7 +6720,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3833 + //line php7/php7.y:3856 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6711,7 +6732,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3846 + //line php7/php7.y:3869 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6723,7 +6744,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3856 + //line php7/php7.y:3879 { yyVAL.node = yyDollar[2].node @@ -6733,13 +6754,13 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3864 + //line php7/php7.y:3887 { yyVAL.node = yyDollar[1].node } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3869 + //line php7/php7.y:3892 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6751,7 +6772,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3879 + //line php7/php7.y:3902 { yyVAL.node = yyDollar[2].node @@ -6761,13 +6782,13 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3887 + //line php7/php7.y:3910 { yyVAL.node = yyDollar[1].node } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3892 + //line php7/php7.y:3915 { if yyDollar[1].list[len(yyDollar[1].list)-1] == nil { yyVAL.list = yyDollar[1].list[:len(yyDollar[1].list)-1] @@ -6777,19 +6798,19 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3903 + //line php7/php7.y:3926 { yyVAL.node = nil } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3905 + //line php7/php7.y:3928 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3910 + //line php7/php7.y:3933 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6798,13 +6819,13 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3917 + //line php7/php7.y:3940 { yyVAL.list = []node.Node{yyDollar[1].node} } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3922 + //line php7/php7.y:3945 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -6816,7 +6837,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3932 + //line php7/php7.y:3955 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -6825,7 +6846,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3939 + //line php7/php7.y:3962 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -6839,7 +6860,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3951 + //line php7/php7.y:3974 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -6852,7 +6873,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3962 + //line php7/php7.y:3985 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -6870,7 +6891,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3978 + //line php7/php7.y:4001 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -6887,13 +6908,13 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3996 + //line php7/php7.y:4019 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3998 + //line php7/php7.y:4021 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -6906,13 +6927,13 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4009 + //line php7/php7.y:4032 { yyVAL.list = []node.Node{yyDollar[1].node} } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4011 + //line php7/php7.y:4034 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -6925,7 +6946,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4025 + //line php7/php7.y:4048 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6939,7 +6960,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4037 + //line php7/php7.y:4060 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6957,7 +6978,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4053 + //line php7/php7.y:4076 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6977,7 +6998,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4071 + //line php7/php7.y:4094 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6990,7 +7011,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4082 + //line php7/php7.y:4105 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -7006,7 +7027,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:4096 + //line php7/php7.y:4119 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -7026,13 +7047,13 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4114 + //line php7/php7.y:4137 { yyVAL.node = yyDollar[2].node } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4120 + //line php7/php7.y:4143 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7044,7 +7065,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4130 + //line php7/php7.y:4153 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7061,7 +7082,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4145 + //line php7/php7.y:4168 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -7092,7 +7113,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4174 + //line php7/php7.y:4197 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(identifier) @@ -7106,7 +7127,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:4189 + //line php7/php7.y:4212 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -7123,7 +7144,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4204 + //line php7/php7.y:4227 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -7137,7 +7158,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4216 + //line php7/php7.y:4239 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -7149,7 +7170,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4226 + //line php7/php7.y:4249 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -7161,7 +7182,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4236 + //line php7/php7.y:4259 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -7175,7 +7196,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4248 + //line php7/php7.y:4271 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -7187,7 +7208,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4258 + //line php7/php7.y:4281 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -7199,13 +7220,13 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4271 + //line php7/php7.y:4294 { yyVAL.list = []node.Node{yyDollar[1].node} } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4273 + //line php7/php7.y:4296 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -7214,7 +7235,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4283 + //line php7/php7.y:4306 { yyVAL.node = yyDollar[1].node } diff --git a/php7/php7.y b/php7/php7.y index 98424da..4190b68 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -3109,16 +3109,30 @@ expr_without_variable: | T_EXIT exit_expr { if (strings.EqualFold($1.Value, "die")) { - $$ = expr.NewDie($2) + $$ = expr.NewDie(nil) + if $2 != nil { + $$.(*expr.Die).Expr = $2.(*expr.Exit).Expr + } } else { - $$ = expr.NewExit($2) + $$ = expr.NewExit(nil) + if $2 != nil { + $$.(*expr.Exit).Expr = $2.(*expr.Exit).Expr + } } // save position - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + if $2 == nil { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + } else { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + } // save comments yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExitToken) + + if $2 != nil { + yylex.(*Parser).comments.AddFromChildNode($$, $2) + } } | '@' expr { @@ -3368,7 +3382,16 @@ exit_expr: /* empty */ { $$ = nil } | '(' optional_expr ')' - { $$ = $2; } + { + $$ = expr.NewExit($2); + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) + } ; backticks_expr: From 944a343f0f6d5572dbb924587f001cc6d8241cf0 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Thu, 7 Jun 2018 02:25:27 +0300 Subject: [PATCH 25/25] php5: save all comments --- php5/parser.go | 10 + php5/php5.go | 5888 ++++++++++++++++++++++++++++++------------------ php5/php5.y | 3026 ++++++++++++++++++------- php7/parser.go | 5 - php7/php7.go | 580 +++-- php7/php7.y | 33 +- 6 files changed, 6228 insertions(+), 3314 deletions(-) diff --git a/php5/parser.go b/php5/parser.go index c134e6f..7d353c5 100644 --- a/php5/parser.go +++ b/php5/parser.go @@ -106,3 +106,13 @@ func (l *Parser) GetComments() parser.Comments { func (l *Parser) GetPositions() parser.Positions { return l.positions } + +// helpers + +func lastNode(nn []node.Node) node.Node { + return nn[len(nn)-1] +} + +func firstNode(nn []node.Node) node.Node { + return nn[0] +} diff --git a/php5/php5.go b/php5/php5.go index 2a96dba..92ccf10 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -8,6 +8,7 @@ import ( "strconv" "strings" + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/expr" "github.com/z7zmey/php-parser/node/expr/assign" @@ -19,7 +20,7 @@ import ( "github.com/z7zmey/php-parser/scanner" ) -//line php5/php5.y:21 +//line php5/php5.y:22 type yySymType struct { yys int node node.Node @@ -345,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php5/php5.y:4005 +//line php5/php5.y:5483 type simpleIndirectReference struct { all []*expr.Variable @@ -455,12 +456,12 @@ var yyExca = [...]int{ -1, 462, 104, 435, 105, 435, - 147, 514, - 158, 514, - -2, 433, - -1, 463, 147, 515, 158, 515, + -2, 433, + -1, 463, + 147, 516, + 158, 516, -2, 430, -1, 464, 104, 435, @@ -478,10 +479,10 @@ var yyExca = [...]int{ -2, 433, -1, 493, 146, 472, - -2, 516, + -2, 517, -1, 499, 146, 472, - -2, 517, + -2, 518, -1, 521, 78, 332, -2, 369, @@ -506,362 +507,391 @@ var yyExca = [...]int{ 144, 309, 147, 309, -2, 433, - -1, 681, + -1, 682, 78, 334, -2, 371, - -1, 779, - 134, 0, - 135, 0, - 136, 0, - 137, 0, - -2, 397, -1, 780, 134, 0, 135, 0, 136, 0, 137, 0, - -2, 398, + -2, 397, -1, 781, 134, 0, 135, 0, 136, 0, 137, 0, - -2, 399, + -2, 398, -1, 782, 134, 0, 135, 0, 136, 0, 137, 0, - -2, 400, + -2, 399, -1, 783, - 138, 0, - 139, 0, - 165, 0, - 166, 0, - -2, 401, + 134, 0, + 135, 0, + 136, 0, + 137, 0, + -2, 400, -1, 784, 138, 0, 139, 0, 165, 0, 166, 0, - -2, 402, + -2, 401, -1, 785, 138, 0, 139, 0, 165, 0, 166, 0, - -2, 403, + -2, 402, -1, 786, 138, 0, 139, 0, 165, 0, 166, 0, + -2, 403, + -1, 787, + 138, 0, + 139, 0, + 165, 0, + 166, 0, -2, 404, - -1, 789, + -1, 790, 78, 333, -2, 370, - -1, 839, + -1, 840, 37, 201, -2, 198, - -1, 879, + -1, 880, 31, 128, 32, 128, 33, 128, 143, 128, -2, 0, - -1, 914, + -1, 915, 95, 140, -2, 0, - -1, 916, + -1, 917, 31, 127, 32, 127, 33, 127, 143, 127, -2, 0, - -1, 943, + -1, 944, 93, 136, 94, 136, 95, 136, -2, 0, - -1, 971, + -1, 972, 29, 189, -2, 4, - -1, 980, + -1, 981, 147, 142, -2, 147, - -1, 997, + -1, 998, 144, 193, -2, 195, } const yyPrivate = 57344 -const yyLast = 9012 +const yyLast = 8982 var yyAct = [...]int{ - 102, 571, 843, 565, 1006, 965, 714, 807, 420, 826, - 123, 131, 606, 200, 340, 918, 734, 567, 452, 815, - 474, 683, 296, 594, 461, 592, 421, 61, 579, 142, - 319, 315, 39, 98, 264, 390, 158, 517, 130, 2, - 444, 115, 289, 978, 959, 118, 138, 140, 447, 544, - 145, 485, 937, 657, 663, 664, 228, 228, 162, 477, - 657, 331, 934, 941, 7, 940, 931, 821, 330, 737, - 653, 6, 43, 26, 655, 654, 709, 653, 562, 939, - 657, 267, 44, 516, 656, 658, 659, 358, 432, 665, - 325, 656, 658, 659, 953, 932, 1002, 653, 735, 921, - 251, 655, 654, 793, 298, 954, 897, 853, 153, 933, - 586, 656, 658, 659, 270, 728, 665, 137, 586, 543, - 898, 493, 272, 121, 192, 204, 311, 632, 192, 316, - 320, 618, 585, 323, 114, 258, 329, 241, 633, 5, - 510, 305, 619, 586, 450, 121, 121, 192, 499, 121, - 121, 657, 663, 664, 511, 560, 339, 141, 677, 678, - 126, 228, 121, 494, 310, 179, 561, 39, 653, 179, - 182, 183, 655, 654, 159, 475, 357, 201, 556, 162, - 506, 976, 656, 658, 659, 675, 676, 665, 179, 557, - 177, 176, 359, 267, 507, 228, 178, 180, 181, 929, - 178, 180, 181, 907, 117, 175, 360, 906, 355, 177, - 176, 350, 904, 241, 126, 271, 121, 104, 861, 178, - 180, 181, 356, 228, 175, 351, 270, 386, 126, 229, - 121, 425, 230, 352, 272, 312, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 233, 313, - 302, 133, 657, 451, 855, 791, 595, 745, 301, 639, - 232, 232, 228, 717, 300, 134, 620, 631, 120, 653, - 456, 630, 624, 231, 231, 333, 451, 336, 393, 209, - 451, 623, 611, 229, 597, 273, 230, 453, 610, 749, - 120, 120, 353, 228, 303, 120, 596, 229, 265, 595, - 230, 473, 233, 440, 748, 449, 604, 120, 294, 446, - 295, 293, 287, 281, 131, 396, 233, 1018, 509, 160, - 977, 490, 513, 254, 241, 253, 521, 271, 1001, 950, - 915, 472, 885, 882, 504, 870, 825, 814, 930, 727, - 39, 449, 693, 434, 634, 492, 449, 740, 491, 502, - 498, 399, 505, 497, 625, 716, 621, 463, 465, 521, - 430, 120, 428, 307, 913, 232, 541, 1013, 980, 892, - 467, 484, 7, 139, 297, 120, 471, 297, 231, 6, - 486, 824, 479, 480, 818, 809, 808, 192, 548, 495, - 593, 682, 436, 437, 439, 546, 552, 273, 448, 232, - 587, 572, 564, 572, 577, 572, 580, 458, 228, 551, - 265, 400, 231, 537, 344, 288, 278, 345, 437, 436, - 436, 295, 437, 275, 274, 588, 39, 232, 179, 182, - 183, 250, 222, 196, 448, 189, 191, 195, 194, 448, - 231, 144, 122, 1010, 876, 1009, 999, 5, 490, 177, - 176, 135, 539, 989, 984, 540, 615, 983, 923, 178, - 180, 181, 188, 190, 175, 912, 232, 609, 449, 449, - 703, 704, 492, 498, 880, 491, 497, 811, 805, 231, - 804, 309, 798, 308, 712, 1019, 699, 400, 581, 228, - 703, 704, 547, 545, 542, 501, 449, 232, 616, 449, - 614, 449, 398, 446, 348, 617, 156, 981, 316, 905, - 231, 126, 320, 605, 637, 638, 975, 521, 917, 891, - 641, 642, 890, 888, 681, 732, 521, 578, 306, 197, - 435, 179, 39, 521, 521, 521, 521, 521, 192, 645, - 224, 225, 648, 531, 874, 802, 803, 830, 635, 695, - 696, 650, 572, 257, 652, 710, 647, 700, 228, 228, - 228, 448, 448, 521, 7, 572, 718, 295, 726, 39, - 39, 6, 91, 126, 515, 731, 531, 572, 580, 179, - 126, 810, 729, 125, 612, 267, 259, 228, 228, 448, - 730, 438, 448, 713, 448, 705, 739, 707, 680, 455, - 723, 702, 424, 125, 295, 733, 987, 128, 129, 295, - 687, 504, 232, 738, 126, 459, 742, 741, 270, 736, - 126, 454, 126, 569, 570, 231, 272, 295, 228, 971, - 228, 518, 427, 426, 304, 512, 744, 449, 299, 5, - 126, 446, 573, 124, 754, 574, 282, 286, 469, 686, - 260, 261, 132, 816, 521, 521, 521, 521, 521, 521, + 102, 571, 844, 565, 1007, 966, 715, 61, 420, 827, + 123, 131, 919, 200, 340, 594, 567, 607, 452, 816, + 461, 808, 474, 735, 592, 684, 138, 140, 421, 142, + 145, 390, 39, 98, 444, 579, 264, 517, 118, 319, + 158, 315, 331, 330, 447, 7, 6, 544, 485, 130, + 2, 43, 26, 979, 960, 938, 228, 228, 162, 477, + 935, 942, 289, 941, 44, 670, 658, 664, 665, 672, + 673, 674, 675, 678, 679, 932, 822, 940, 658, 1003, + 251, 267, 738, 654, 258, 710, 662, 656, 655, 562, + 153, 658, 664, 665, 661, 654, 663, 657, 659, 660, + 676, 677, 666, 516, 298, 358, 325, 204, 654, 657, + 659, 660, 656, 655, 270, 736, 241, 137, 933, 794, + 954, 898, 657, 659, 660, 192, 311, 666, 729, 316, + 320, 955, 934, 323, 922, 899, 329, 854, 633, 5, + 543, 510, 126, 619, 121, 586, 121, 192, 586, 634, + 121, 658, 664, 665, 620, 511, 339, 141, 678, 679, + 585, 228, 159, 560, 114, 475, 179, 39, 654, 977, + 556, 586, 656, 655, 561, 310, 357, 115, 930, 162, + 432, 557, 657, 659, 660, 676, 677, 666, 179, 182, + 183, 718, 241, 267, 506, 228, 201, 178, 180, 181, + 908, 493, 296, 121, 359, 450, 595, 121, 507, 177, + 176, 229, 352, 355, 230, 907, 905, 104, 360, 178, + 180, 181, 862, 228, 175, 856, 270, 356, 117, 386, + 233, 425, 350, 658, 664, 665, 672, 673, 674, 675, + 678, 679, 312, 494, 792, 271, 351, 126, 746, 121, + 654, 1019, 640, 662, 656, 655, 313, 133, 272, 658, + 393, 661, 228, 663, 657, 659, 660, 676, 677, 666, + 456, 134, 301, 231, 231, 333, 654, 336, 300, 750, + 302, 612, 632, 717, 232, 232, 499, 611, 121, 120, + 631, 120, 126, 228, 121, 303, 423, 741, 265, 604, + 625, 624, 446, 241, 605, 1002, 595, 160, 978, 273, + 126, 597, 121, 596, 131, 396, 229, 931, 509, 230, + 473, 305, 513, 749, 294, 293, 521, 287, 440, 281, + 254, 253, 951, 451, 916, 233, 886, 451, 492, 463, + 39, 436, 437, 498, 491, 883, 541, 871, 120, 497, + 484, 472, 120, 7, 6, 658, 826, 271, 815, 521, + 502, 229, 486, 505, 230, 295, 728, 437, 436, 436, + 272, 437, 654, 584, 694, 635, 656, 655, 231, 229, + 233, 626, 230, 430, 399, 428, 657, 659, 660, 232, + 307, 666, 548, 546, 120, 914, 552, 593, 233, 1014, + 981, 572, 893, 572, 577, 572, 580, 139, 228, 297, + 265, 825, 231, 819, 126, 126, 121, 121, 451, 439, + 683, 273, 877, 232, 587, 588, 39, 564, 448, 297, + 810, 809, 192, 120, 551, 434, 400, 458, 537, 120, + 231, 449, 353, 344, 288, 278, 345, 5, 275, 274, + 250, 232, 539, 295, 222, 540, 616, 120, 196, 195, + 194, 144, 467, 122, 448, 492, 498, 453, 471, 448, + 581, 491, 497, 179, 479, 480, 1011, 449, 1010, 231, + 135, 495, 449, 229, 268, 1000, 230, 269, 990, 228, + 232, 985, 617, 615, 177, 176, 446, 984, 618, 704, + 705, 490, 233, 233, 178, 180, 181, 924, 316, 175, + 231, 913, 320, 309, 504, 308, 881, 521, 126, 812, + 400, 232, 704, 705, 682, 806, 521, 805, 799, 713, + 700, 547, 39, 521, 521, 521, 521, 521, 545, 542, + 501, 398, 348, 531, 91, 7, 6, 156, 636, 646, + 982, 649, 572, 906, 653, 711, 606, 701, 228, 228, + 228, 120, 120, 521, 1020, 572, 719, 976, 727, 39, + 39, 918, 892, 891, 889, 732, 531, 572, 580, 733, + 578, 306, 730, 197, 435, 267, 192, 228, 228, 714, + 125, 448, 448, 706, 179, 708, 740, 224, 225, 875, + 724, 831, 803, 804, 449, 449, 295, 518, 743, 731, + 811, 681, 734, 455, 613, 739, 742, 126, 270, 448, + 126, 737, 448, 424, 448, 231, 126, 179, 490, 228, + 745, 228, 449, 703, 446, 449, 232, 449, 259, 5, + 651, 755, 257, 438, 696, 697, 125, 610, 988, 688, + 124, 459, 648, 128, 129, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 789, 743, 521, 54, 758, 321, 756, 295, 757, - 864, 573, 317, 232, 574, 508, 259, 720, 573, 750, - 595, 574, 463, 322, 790, 792, 231, 285, 62, 126, - 521, 121, 132, 126, 468, 121, 486, 228, 126, 271, - 121, 457, 263, 799, 576, 404, 402, 795, 208, 572, - 448, 831, 207, 985, 531, 827, 572, 850, 819, 823, - 226, 234, 1007, 531, 45, 725, 828, 813, 295, 832, - 531, 531, 531, 531, 531, 851, 295, 856, 423, 453, - 260, 261, 232, 232, 232, 742, 986, 609, 163, 796, - 559, 858, 239, 338, 1017, 231, 231, 231, 229, 991, - 531, 230, 268, 957, 955, 269, 925, 229, 521, 273, - 230, 232, 232, 45, 521, 521, 896, 233, 259, 584, - 893, 233, 265, 438, 231, 231, 233, 847, 848, 849, - 846, 845, 844, 599, 878, 601, 600, 228, 550, 228, - 877, 1003, 521, 883, 881, 572, 889, 884, 998, 854, - 875, 960, 232, 800, 232, 935, 901, 859, 860, 820, - 126, 760, 900, 572, 903, 231, 759, 231, 722, 651, - 39, 649, 259, 1, 646, 259, 120, 284, 602, 887, - 120, 470, 260, 261, 259, 120, 514, 228, 899, 438, - 521, 531, 531, 531, 531, 531, 531, 531, 531, 531, + 521, 521, 790, 759, 521, 463, 573, 126, 757, 574, + 758, 515, 321, 295, 638, 639, 454, 721, 132, 486, + 642, 643, 260, 261, 800, 295, 231, 842, 793, 791, + 427, 521, 972, 843, 426, 304, 841, 232, 228, 848, + 849, 850, 847, 846, 845, 299, 126, 687, 126, 469, + 572, 817, 832, 865, 531, 282, 286, 572, 851, 820, + 512, 508, 259, 531, 295, 259, 829, 438, 814, 271, + 531, 531, 531, 531, 531, 322, 852, 833, 743, 317, + 448, 595, 272, 857, 859, 457, 468, 848, 849, 850, + 847, 846, 845, 449, 744, 231, 231, 231, 569, 570, + 531, 573, 263, 576, 574, 285, 232, 232, 232, 521, + 192, 504, 751, 295, 295, 521, 521, 573, 132, 404, + 574, 402, 265, 208, 231, 231, 260, 261, 295, 260, + 261, 876, 895, 273, 207, 232, 232, 986, 228, 828, + 228, 878, 824, 521, 884, 882, 572, 890, 885, 879, + 1008, 179, 182, 183, 801, 726, 45, 987, 189, 191, + 821, 559, 259, 901, 572, 904, 231, 438, 231, 338, + 1018, 39, 177, 176, 62, 54, 259, 232, 992, 232, + 888, 284, 178, 180, 181, 188, 190, 175, 228, 900, + 519, 521, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, 531, - 531, 531, 531, 531, 531, 531, 531, 531, 519, 259, - 531, 922, 481, 259, 283, 908, 449, 395, 256, 39, - 446, 324, 521, 936, 203, 285, 260, 261, 469, 260, - 261, 232, 202, 199, 136, 879, 909, 531, 260, 261, - 829, 519, 521, 747, 231, 521, 873, 753, 521, 863, - 572, 962, 572, 970, 39, 445, 39, 812, 703, 704, - 706, 703, 704, 608, 39, 589, 39, 39, 590, 591, - 521, 684, 255, 260, 261, 572, 970, 260, 261, 956, - 982, 839, 958, 39, 994, 961, 964, 39, 39, 521, - 963, 572, 902, 483, 993, 895, 572, 995, 838, 997, - 835, 566, 1005, 1004, 914, 724, 916, 979, 394, 448, - 389, 164, 39, 572, 1011, 531, 924, 341, 926, 927, - 1012, 531, 531, 697, 572, 1015, 992, 538, 928, 919, - 39, 232, 919, 232, 290, 558, 460, 161, 157, 318, - 314, 943, 127, 403, 231, 947, 231, 575, 948, 531, - 401, 335, 944, 1008, 39, 343, 938, 528, 607, 996, - 39, 969, 945, 968, 967, 966, 837, 836, 834, 40, - 568, 15, 14, 822, 972, 719, 801, 694, 11, 249, - 75, 232, 76, 116, 266, 64, 89, 598, 90, 520, - 101, 74, 12, 326, 231, 100, 99, 531, 79, 519, - 119, 526, 3, 990, 41, 0, 0, 0, 519, 0, - 0, 0, 0, 0, 0, 519, 519, 519, 519, 519, - 0, 0, 0, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 0, 0, 0, 1014, 531, - 0, 0, 0, 0, 0, 519, 0, 1020, 0, 0, - 169, 171, 170, 192, 0, 0, 0, 0, 0, 531, - 0, 0, 531, 0, 0, 531, 209, 685, 0, 0, - 0, 0, 0, 0, 688, 689, 690, 691, 692, 0, - 0, 0, 0, 0, 0, 0, 0, 531, 0, 0, - 0, 0, 167, 168, 179, 182, 183, 184, 185, 186, - 187, 189, 191, 0, 0, 0, 531, 809, 808, 0, - 0, 0, 0, 193, 173, 177, 176, 0, 0, 0, - 0, 0, 172, 0, 174, 178, 180, 181, 188, 190, - 175, 0, 0, 0, 0, 0, 519, 519, 519, 519, + 531, 531, 531, 531, 531, 531, 531, 531, 531, 923, + 909, 531, 958, 519, 446, 470, 260, 261, 796, 163, + 39, 226, 234, 521, 937, 813, 704, 705, 239, 285, + 260, 261, 855, 707, 704, 705, 880, 910, 531, 259, + 860, 861, 956, 521, 45, 231, 521, 874, 926, 521, + 453, 572, 963, 572, 971, 39, 232, 39, 610, 599, + 797, 601, 600, 897, 259, 39, 894, 39, 39, 283, + 259, 521, 550, 1004, 999, 256, 572, 971, 961, 936, + 957, 983, 902, 959, 39, 126, 962, 761, 39, 39, + 521, 760, 572, 723, 652, 994, 650, 572, 996, 647, + 998, 602, 469, 260, 261, 915, 514, 917, 980, 481, + 395, 324, 203, 39, 572, 1012, 531, 925, 202, 927, + 928, 1013, 531, 531, 199, 572, 1016, 993, 260, 261, + 920, 39, 136, 920, 260, 261, 1, 830, 748, 754, + 448, 864, 944, 445, 609, 231, 948, 231, 589, 949, + 531, 842, 590, 449, 591, 39, 232, 843, 232, 685, + 841, 39, 255, 946, 840, 995, 965, 964, 903, 483, + 896, 519, 839, 836, 566, 973, 1006, 1005, 725, 394, + 519, 389, 164, 341, 698, 538, 929, 519, 519, 519, + 519, 519, 290, 460, 161, 231, 157, 318, 531, 314, + 127, 403, 575, 401, 991, 335, 232, 945, 1009, 343, + 939, 848, 849, 850, 847, 846, 845, 519, 528, 608, + 997, 970, 969, 968, 967, 838, 169, 171, 170, 192, + 837, 835, 40, 568, 15, 14, 823, 720, 802, 1015, + 531, 695, 11, 686, 249, 75, 76, 116, 1021, 266, + 689, 690, 691, 692, 693, 64, 834, 89, 598, 90, + 531, 520, 101, 531, 74, 12, 531, 326, 167, 168, + 179, 182, 183, 184, 185, 186, 187, 189, 191, 100, + 99, 79, 119, 810, 809, 526, 3, 41, 531, 193, + 173, 177, 176, 0, 0, 0, 0, 0, 172, 0, + 174, 178, 180, 181, 188, 190, 175, 531, 0, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 0, 0, 519, 0, 0, 0, 0, + 519, 519, 519, 519, 519, 519, 0, 0, 519, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 668, 666, 667, 0, 0, 0, 0, - 0, 0, 519, 0, 0, 761, 762, 763, 764, 765, - 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, - 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, - 786, 788, 0, 0, 685, 670, 669, 657, 663, 664, - 671, 672, 673, 674, 677, 678, 668, 666, 667, 0, - 0, 869, 0, 0, 653, 0, 679, 661, 655, 654, - 0, 0, 0, 0, 0, 660, 0, 662, 656, 658, - 659, 675, 676, 665, 0, 0, 0, 0, 0, 0, - 519, 0, 0, 0, 0, 0, 519, 519, 670, 669, - 657, 663, 664, 671, 672, 673, 674, 677, 678, 0, - 0, 0, 0, 0, 0, 31, 0, 653, 867, 679, - 661, 655, 654, 0, 519, 0, 0, 0, 660, 0, - 662, 656, 658, 659, 675, 676, 665, 0, 0, 147, - 151, 155, 0, 0, 0, 165, 0, 0, 0, 868, - 0, 0, 51, 198, 0, 871, 872, 0, 206, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, - 0, 0, 519, 235, 236, 237, 238, 0, 154, 240, - 0, 242, 243, 244, 245, 246, 247, 248, 0, 252, - 0, 0, 0, 0, 262, 205, 0, 0, 0, 276, - 277, 0, 279, 280, 0, 0, 0, 0, 227, 227, - 0, 0, 0, 291, 519, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 0, 0, 0, - 0, 910, 0, 0, 519, 0, 0, 519, 0, 0, - 519, 0, 670, 669, 657, 663, 664, 671, 672, 673, - 674, 677, 678, 0, 0, 240, 0, 0, 209, 0, - 342, 653, 519, 679, 661, 655, 654, 0, 0, 0, - 0, 0, 660, 942, 662, 656, 658, 659, 675, 676, - 665, 519, 0, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, - 378, 379, 380, 381, 382, 383, 384, 385, 0, 387, - 0, 155, 0, 354, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 406, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 417, 418, 419, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 391, 392, 670, - 669, 657, 663, 664, 671, 672, 673, 674, 677, 678, - 0, 0, 0, 0, 0, 0, 240, 0, 653, 433, - 433, 661, 655, 654, 0, 422, 441, 0, 0, 660, - 0, 662, 656, 658, 659, 675, 676, 665, 0, 0, - 155, 155, 0, 0, 466, 0, 0, 433, 0, 0, - 0, 0, 0, 433, 291, 0, 0, 0, 0, 433, - 433, 0, 0, 155, 443, 0, 433, 496, 0, 0, - 0, 0, 500, 0, 0, 0, 0, 462, 464, 0, - 0, 0, 83, 84, 72, 0, 105, 106, 126, 88, - 121, 0, 0, 0, 0, 478, 95, 0, 0, 0, - 487, 0, 0, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 45, 0, 0, 0, 549, - 0, 0, 0, 0, 0, 0, 553, 81, 82, 0, - 349, 0, 0, 0, 0, 0, 0, 52, 96, 0, - 94, 110, 111, 112, 107, 108, 209, 0, 0, 0, - 0, 0, 93, 0, 555, 0, 0, 143, 113, 109, - 103, 489, 85, 86, 87, 0, 0, 0, 0, 80, - 53, 155, 911, 0, 78, 42, 149, 0, 0, 0, - 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, - 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 668, 666, 667, 0, 0, 0, 0, 582, 0, - 583, 0, 0, 0, 0, 0, 0, 613, 92, 77, - 0, 0, 0, 0, 63, 482, 97, 0, 0, 488, - 58, 57, 59, 60, 73, 120, 0, 0, 0, 0, - 0, 626, 628, 670, 669, 657, 663, 664, 671, 672, - 673, 674, 677, 678, 667, 636, 0, 0, 0, 0, - 0, 0, 653, 0, 679, 661, 655, 654, 0, 0, - 0, 0, 0, 660, 0, 662, 656, 658, 659, 675, - 676, 665, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 478, 0, 0, 670, 669, 657, 663, 664, 671, - 672, 673, 674, 677, 678, 0, 192, 0, 342, 701, - 0, 0, 0, 653, 0, 679, 661, 655, 654, 0, - 711, 0, 0, 0, 660, 0, 662, 656, 658, 659, - 675, 676, 665, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 179, 182, 183, - 184, 185, 186, 187, 189, 191, 0, 0, 0, 433, - 391, 715, 715, 169, 171, 170, 192, 173, 177, 176, - 746, 0, 0, 0, 0, 0, 433, 751, 178, 180, - 181, 188, 190, 175, 0, 155, 0, 0, 0, 422, - 422, 0, 0, 0, 0, 0, 0, 0, 0, 155, - 0, 0, 668, 666, 667, 167, 168, 179, 182, 183, - 184, 185, 186, 187, 189, 191, 0, 0, 0, 862, - 0, 0, 462, 0, 0, 841, 193, 173, 177, 176, - 478, 842, 478, 0, 840, 172, 487, 174, 178, 180, - 181, 188, 190, 175, 670, 669, 657, 663, 664, 671, - 672, 673, 674, 677, 678, 0, 0, 0, 0, 0, - 0, 0, 797, 653, 0, 679, 661, 655, 654, 806, - 0, 0, 0, 0, 660, 0, 662, 656, 658, 659, - 675, 676, 665, 0, 0, 847, 848, 849, 846, 845, - 844, 657, 663, 664, 671, 672, 673, 674, 677, 678, - 0, 0, 0, 852, 0, 0, 433, 0, 653, 0, - 0, 661, 655, 654, 433, 433, 0, 0, 0, 817, - 0, 865, 656, 658, 659, 675, 676, 665, 0, 0, - 894, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 4, 0, 83, 84, 72, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 669, 667, 668, 0, 0, 519, 0, 0, 0, 0, + 0, 0, 762, 763, 764, 765, 766, 767, 768, 769, + 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 789, 0, + 0, 686, 671, 670, 658, 664, 665, 672, 673, 674, + 675, 678, 679, 0, 0, 669, 667, 668, 870, 0, + 0, 654, 0, 680, 662, 656, 655, 0, 0, 0, + 0, 0, 661, 0, 663, 657, 659, 660, 676, 677, + 666, 0, 0, 519, 0, 0, 0, 0, 0, 519, + 519, 0, 0, 0, 0, 0, 0, 671, 670, 658, + 664, 665, 672, 673, 674, 675, 678, 679, 0, 0, + 0, 0, 31, 0, 0, 798, 654, 519, 680, 662, + 656, 655, 0, 0, 0, 0, 0, 661, 0, 663, + 657, 659, 660, 676, 677, 666, 147, 151, 155, 0, + 0, 0, 165, 0, 0, 0, 869, 0, 0, 51, + 198, 0, 872, 873, 0, 206, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 519, 223, 0, 0, 0, + 235, 236, 237, 238, 192, 154, 240, 0, 242, 243, + 244, 245, 246, 247, 248, 0, 252, 0, 0, 0, + 0, 262, 205, 0, 0, 0, 276, 277, 0, 279, + 280, 0, 0, 0, 0, 227, 227, 519, 0, 0, + 291, 0, 0, 167, 168, 179, 182, 183, 184, 185, + 186, 187, 189, 191, 0, 0, 0, 519, 911, 0, + 519, 0, 0, 519, 193, 173, 177, 176, 0, 0, + 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, + 190, 175, 240, 0, 0, 519, 0, 342, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 943, 0, 0, 0, 519, 0, 0, 0, 0, 0, + 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, + 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 0, 387, 0, 155, 0, + 354, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 406, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 391, 392, 671, 670, 658, 664, + 665, 672, 673, 674, 675, 678, 679, 0, 0, 0, + 0, 0, 0, 240, 0, 654, 433, 433, 662, 656, + 655, 0, 422, 441, 0, 0, 661, 0, 663, 657, + 659, 660, 676, 677, 666, 0, 0, 155, 465, 0, + 0, 466, 0, 0, 433, 0, 0, 0, 0, 0, + 433, 291, 0, 0, 0, 0, 433, 433, 0, 0, + 155, 443, 0, 433, 496, 0, 0, 0, 0, 500, + 0, 0, 0, 0, 462, 464, 0, 0, 0, 83, + 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, + 0, 0, 478, 95, 0, 0, 0, 487, 0, 0, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 45, 0, 0, 0, 549, 0, 0, 0, + 0, 0, 0, 553, 81, 82, 0, 0, 0, 0, + 621, 0, 0, 0, 52, 96, 0, 94, 110, 111, + 112, 107, 108, 209, 0, 0, 0, 0, 0, 93, + 0, 555, 0, 0, 143, 113, 109, 103, 489, 85, + 86, 87, 0, 0, 0, 0, 80, 53, 155, 912, + 0, 78, 42, 149, 0, 0, 0, 0, 0, 55, + 56, 0, 65, 66, 67, 68, 69, 70, 71, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 669, 667, + 668, 0, 0, 0, 0, 582, 0, 583, 0, 0, + 0, 0, 0, 0, 614, 92, 77, 0, 0, 0, + 0, 63, 482, 97, 0, 0, 488, 58, 57, 59, + 60, 73, 120, 0, 0, 0, 0, 0, 627, 629, + 671, 670, 658, 664, 665, 672, 673, 674, 675, 678, + 679, 668, 637, 0, 0, 0, 0, 0, 0, 654, + 0, 680, 662, 656, 655, 0, 0, 0, 0, 0, + 661, 0, 663, 657, 659, 660, 676, 677, 666, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 478, 0, + 0, 671, 670, 658, 664, 665, 672, 673, 674, 675, + 678, 679, 0, 0, 192, 342, 702, 0, 0, 0, + 654, 0, 680, 662, 656, 655, 0, 712, 0, 0, + 0, 661, 0, 663, 657, 659, 660, 676, 677, 666, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 0, 0, 0, 179, 182, 183, 184, 185, + 186, 187, 189, 191, 558, 0, 433, 391, 716, 716, + 0, 669, 667, 668, 0, 173, 177, 176, 747, 0, + 0, 0, 0, 209, 433, 752, 178, 180, 181, 188, + 190, 175, 0, 155, 0, 0, 422, 422, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 155, 0, 0, + 0, 0, 0, 671, 670, 658, 664, 665, 672, 673, + 674, 675, 678, 679, 169, 171, 170, 192, 0, 0, + 462, 0, 654, 868, 680, 662, 656, 655, 478, 0, + 478, 0, 0, 661, 487, 663, 657, 659, 660, 676, + 677, 666, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 0, 0, 167, 168, 179, 182, + 183, 184, 185, 186, 187, 189, 191, 807, 0, 0, + 863, 0, 0, 0, 0, 0, 0, 193, 173, 177, + 176, 0, 0, 0, 0, 209, 172, 0, 174, 178, + 180, 181, 188, 190, 175, 0, 0, 0, 0, 0, + 0, 853, 0, 0, 433, 0, 0, 0, 0, 0, + 0, 0, 433, 433, 0, 0, 0, 818, 0, 866, + 0, 0, 0, 0, 0, 0, 0, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 0, + 0, 0, 0, 4, 0, 83, 84, 72, 18, 105, + 106, 13, 88, 121, 349, 30, 0, 0, 0, 95, + 29, 20, 19, 0, 21, 0, 33, 0, 34, 342, + 209, 22, 0, 0, 0, 23, 24, 38, 45, 16, + 25, 36, 0, 0, 37, 10, 0, 27, 0, 32, + 81, 82, 8, 46, 48, 50, 0, 0, 0, 0, + 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, + 0, 0, 0, 0, 0, 93, 0, 716, 0, 422, + 9, 113, 109, 103, 0, 85, 86, 87, 0, 0, + 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, + 47, 49, 0, 0, 0, 55, 56, 0, 65, 66, + 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 478, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 92, 77, 17, 645, 35, 0, 63, 0, 97, + 0, 0, 0, 58, 57, 59, 60, 73, 120, 4, + 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, + 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, + 21, 0, 33, 0, 34, 0, 0, 22, 0, 0, + 0, 23, 24, 38, 45, 16, 25, 36, 0, 0, + 37, 10, 0, 27, 0, 32, 81, 82, 8, 46, + 48, 50, 0, 0, 0, 0, 52, 96, 0, 94, + 110, 111, 112, 107, 108, 0, 0, 0, 0, 0, + 0, 93, 0, 0, 0, 0, 9, 113, 109, 103, + 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, + 0, 0, 0, 78, 42, 28, 47, 49, 0, 0, + 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, + 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 92, 77, 17, + 503, 35, 0, 63, 0, 97, 0, 0, 0, 58, + 57, 59, 60, 73, 120, 4, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, - 34, 342, 0, 22, 0, 0, 0, 23, 24, 38, + 34, 0, 0, 22, 0, 0, 0, 23, 24, 38, 45, 16, 25, 36, 0, 0, 37, 10, 0, 27, 0, 32, 81, 82, 8, 46, 48, 50, 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, - 108, 0, 0, 0, 0, 0, 0, 93, 0, 715, - 0, 422, 9, 113, 109, 103, 0, 85, 86, 87, + 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, + 0, 0, 9, 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, 47, 49, 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 478, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 92, 77, 17, 644, 35, 0, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 92, 77, 17, 0, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, - 120, 4, 0, 83, 84, 72, 18, 105, 106, 13, + 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, 34, 0, 0, 22, - 0, 0, 0, 23, 24, 38, 45, 16, 25, 36, - 0, 0, 37, 10, 0, 27, 0, 32, 81, 82, - 8, 46, 48, 50, 0, 0, 0, 0, 52, 96, + 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, + 0, 0, 37, 0, 0, 27, 0, 32, 81, 82, + 332, 46, 48, 50, 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, 0, 0, - 0, 0, 0, 93, 0, 0, 0, 0, 9, 113, + 0, 0, 0, 93, 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, 47, 49, 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, - 77, 17, 503, 35, 0, 63, 0, 97, 0, 0, - 0, 58, 57, 59, 60, 73, 120, 4, 0, 83, + 77, 17, 1022, 35, 0, 63, 0, 97, 0, 0, + 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, 34, 0, 0, 22, 0, 0, 0, 23, - 24, 38, 45, 16, 25, 36, 0, 0, 37, 10, - 0, 27, 0, 32, 81, 82, 8, 46, 48, 50, + 24, 38, 45, 0, 25, 36, 0, 0, 37, 0, + 0, 27, 0, 32, 81, 82, 332, 46, 48, 50, 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, - 0, 0, 0, 0, 9, 113, 109, 103, 0, 85, + 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, 47, 49, 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 92, 77, 17, 0, 35, + 0, 0, 0, 0, 0, 92, 77, 17, 1017, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, @@ -877,11 +907,11 @@ var yyAct = [...]int{ 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 92, 77, 17, 1021, 35, 0, 63, 0, 97, + 0, 92, 77, 17, 1001, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, - 21, 0, 33, 0, 34, 0, 0, 22, 0, 0, + 21, 989, 33, 0, 34, 0, 0, 22, 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, 0, 0, 37, 0, 0, 27, 0, 32, 81, 82, 332, 46, 48, 50, 0, 0, 0, 0, 52, 96, 0, 94, @@ -893,10 +923,10 @@ var yyAct = [...]int{ 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 77, 17, - 1016, 35, 0, 63, 0, 97, 0, 0, 0, 58, + 0, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, - 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, + 0, 95, 29, 20, 19, 0, 21, 0, 33, 975, 34, 0, 0, 22, 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, 0, 0, 37, 0, 0, 27, 0, 32, 81, 82, 332, 46, 48, 50, 0, 0, @@ -908,11 +938,11 @@ var yyAct = [...]int{ 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 92, 77, 17, 1000, 35, 0, 63, + 0, 0, 0, 92, 77, 17, 0, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, - 19, 0, 21, 988, 33, 0, 34, 0, 0, 22, + 19, 0, 21, 0, 33, 0, 34, 0, 0, 22, 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, 0, 0, 37, 0, 0, 27, 0, 32, 81, 82, 332, 46, 48, 50, 0, 0, 0, 0, 52, 96, @@ -924,11 +954,11 @@ var yyAct = [...]int{ 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, - 77, 17, 0, 35, 0, 63, 0, 97, 0, 0, + 77, 17, 974, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, - 33, 974, 34, 0, 0, 22, 0, 0, 0, 23, + 33, 0, 34, 0, 0, 22, 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, 0, 0, 37, 0, 0, 27, 0, 32, 81, 82, 332, 46, 48, 50, 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, @@ -939,7 +969,7 @@ var yyAct = [...]int{ 56, 0, 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 92, 77, 17, 0, 35, + 0, 0, 0, 0, 0, 92, 77, 17, 953, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, @@ -955,7 +985,7 @@ var yyAct = [...]int{ 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 92, 77, 17, 973, 35, 0, 63, 0, 97, + 0, 92, 77, 17, 952, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, @@ -971,11 +1001,11 @@ var yyAct = [...]int{ 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 77, 17, - 952, 35, 0, 63, 0, 97, 0, 0, 0, 58, + 950, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, - 34, 0, 0, 22, 0, 0, 0, 23, 24, 38, + 34, 887, 0, 22, 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, 0, 0, 37, 0, 0, 27, 0, 32, 81, 82, 332, 46, 48, 50, 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, @@ -986,89 +1016,11 @@ var yyAct = [...]int{ 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 92, 77, 17, 951, 35, 0, 63, + 0, 0, 0, 92, 77, 17, 0, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, - 19, 0, 21, 0, 33, 0, 34, 0, 0, 22, - 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, - 0, 0, 37, 0, 0, 27, 0, 32, 81, 82, - 332, 46, 48, 50, 0, 0, 0, 0, 52, 96, - 0, 94, 110, 111, 112, 107, 108, 0, 0, 0, - 0, 0, 0, 93, 0, 0, 0, 0, 143, 113, - 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, - 80, 53, 0, 0, 0, 78, 42, 28, 47, 49, - 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, - 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, - 77, 17, 949, 35, 0, 63, 0, 97, 0, 0, - 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, - 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, - 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, - 33, 0, 34, 886, 0, 22, 0, 0, 0, 23, - 24, 38, 45, 0, 25, 36, 0, 0, 37, 0, - 0, 27, 0, 32, 81, 82, 332, 46, 48, 50, - 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, - 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, - 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, - 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, - 0, 78, 42, 28, 47, 49, 0, 0, 0, 55, - 56, 0, 65, 66, 67, 68, 69, 70, 71, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 92, 77, 17, 0, 35, - 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, - 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, - 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, - 29, 20, 19, 698, 21, 0, 33, 0, 34, 0, - 0, 22, 0, 0, 0, 23, 24, 38, 45, 0, - 25, 36, 0, 0, 37, 0, 0, 27, 0, 32, - 81, 82, 332, 46, 48, 50, 0, 0, 0, 0, - 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, - 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, - 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, - 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, - 47, 49, 0, 0, 0, 55, 56, 0, 65, 66, - 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 92, 77, 17, 0, 35, 0, 63, 0, 97, - 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, - 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, - 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, - 21, 0, 33, 0, 34, 0, 0, 22, 0, 0, - 0, 23, 24, 38, 45, 0, 25, 36, 0, 0, - 37, 0, 0, 27, 0, 32, 81, 82, 332, 46, - 48, 50, 0, 0, 0, 0, 52, 96, 0, 94, - 110, 111, 112, 107, 108, 0, 0, 0, 0, 0, - 0, 93, 0, 0, 0, 0, 143, 113, 109, 103, - 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, - 0, 0, 0, 78, 42, 28, 47, 49, 0, 0, - 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, - 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 92, 77, 17, - 563, 35, 0, 63, 0, 97, 0, 0, 0, 58, - 57, 59, 60, 73, 120, 328, 0, 83, 84, 72, - 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, - 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, - 34, 0, 0, 22, 0, 0, 0, 23, 24, 38, - 45, 0, 25, 36, 0, 0, 37, 0, 0, 27, - 0, 32, 81, 82, 332, 46, 48, 50, 0, 0, - 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, - 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, - 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, - 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, - 42, 28, 47, 49, 0, 0, 0, 55, 56, 0, - 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 92, 77, 17, 327, 35, 0, 63, - 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, - 120, 328, 0, 83, 84, 72, 18, 105, 106, 13, - 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, - 19, 0, 21, 0, 33, 0, 34, 0, 0, 22, + 19, 699, 21, 0, 33, 0, 34, 0, 0, 22, 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, 0, 0, 37, 0, 0, 27, 0, 32, 81, 82, 332, 46, 48, 50, 0, 0, 0, 0, 52, 96, @@ -1081,37 +1033,53 @@ var yyAct = [...]int{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 77, 17, 0, 35, 0, 63, 0, 97, 0, 0, - 0, 58, 57, 59, 60, 73, 120, 83, 84, 72, - 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, - 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, - 34, 0, 0, 22, 0, 0, 0, 23, 24, 38, - 45, 0, 25, 36, 0, 0, 37, 0, 0, 27, - 0, 32, 81, 82, 0, 0, 0, 0, 0, 0, - 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, - 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, - 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, - 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, - 42, 28, 0, 0, 0, 0, 0, 55, 56, 0, - 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, + 0, 58, 57, 59, 60, 73, 120, 328, 0, 83, + 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, + 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, + 33, 0, 34, 0, 0, 22, 0, 0, 0, 23, + 24, 38, 45, 0, 25, 36, 0, 0, 37, 0, + 0, 27, 0, 32, 81, 82, 332, 46, 48, 50, + 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, + 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, + 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, + 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, + 0, 78, 42, 28, 47, 49, 0, 0, 0, 55, + 56, 0, 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 92, 77, 17, 0, 35, 946, 63, - 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, - 120, 83, 84, 72, 18, 105, 106, 13, 88, 121, + 0, 0, 0, 0, 0, 92, 77, 17, 563, 35, + 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, + 60, 73, 120, 328, 0, 83, 84, 72, 18, 105, + 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, + 29, 20, 19, 0, 21, 0, 33, 0, 34, 0, + 0, 22, 0, 0, 0, 23, 24, 38, 45, 0, + 25, 36, 0, 0, 37, 0, 0, 27, 0, 32, + 81, 82, 332, 46, 48, 50, 0, 0, 0, 0, + 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, + 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, + 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, + 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, + 47, 49, 0, 0, 0, 55, 56, 0, 65, 66, + 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 92, 77, 17, 327, 35, 0, 63, 0, 97, + 0, 0, 0, 58, 57, 59, 60, 73, 120, 328, + 0, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, 34, 0, 0, 22, 0, 0, 0, 23, 24, 38, 45, 0, 25, 36, 0, 0, - 37, 0, 0, 27, 0, 32, 81, 82, 0, 0, - 0, 0, 0, 0, 0, 0, 52, 96, 0, 94, + 37, 0, 0, 27, 0, 32, 81, 82, 332, 46, + 48, 50, 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, - 0, 0, 0, 78, 42, 28, 0, 0, 0, 0, + 0, 0, 0, 78, 42, 28, 47, 49, 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 77, 17, - 0, 35, 920, 63, 0, 97, 0, 0, 0, 58, + 0, 35, 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, 34, 0, @@ -1126,7 +1094,7 @@ var yyAct = [...]int{ 67, 68, 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 92, 77, 17, 0, 35, 721, 63, 0, 97, + 0, 92, 77, 17, 0, 35, 947, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, @@ -1142,7 +1110,7 @@ var yyAct = [...]int{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 77, 17, 0, 35, - 337, 63, 0, 97, 0, 0, 0, 58, 57, 59, + 921, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, 34, 0, 0, 22, @@ -1157,7 +1125,7 @@ var yyAct = [...]int{ 69, 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, - 77, 17, 0, 35, 334, 63, 0, 97, 0, 0, + 77, 17, 0, 35, 722, 63, 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 83, 84, 72, 18, 105, 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, 21, 0, 33, 0, @@ -1169,22 +1137,174 @@ var yyAct = [...]int{ 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, 0, 0, 0, 0, 0, 55, 56, 0, + 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 92, 77, 17, 0, 35, 337, 63, + 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, + 120, 83, 84, 72, 18, 105, 106, 13, 88, 121, + 0, 30, 0, 0, 0, 95, 29, 20, 19, 0, + 21, 0, 33, 0, 34, 0, 0, 22, 0, 0, + 0, 23, 24, 38, 45, 0, 25, 36, 0, 0, + 37, 0, 0, 27, 0, 32, 81, 82, 0, 0, + 0, 0, 0, 0, 0, 0, 52, 96, 0, 94, + 110, 111, 112, 107, 108, 0, 0, 0, 0, 0, + 0, 93, 0, 0, 0, 0, 143, 113, 109, 103, + 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, + 0, 0, 0, 78, 42, 28, 0, 0, 0, 0, + 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, + 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 92, 77, 17, + 0, 35, 334, 63, 0, 97, 0, 0, 0, 58, + 57, 59, 60, 73, 120, 83, 84, 72, 18, 105, + 106, 13, 88, 121, 0, 30, 0, 0, 0, 95, + 29, 20, 19, 0, 21, 0, 33, 0, 34, 0, + 0, 22, 0, 0, 0, 23, 24, 38, 45, 0, + 25, 36, 0, 0, 37, 0, 0, 27, 0, 32, + 81, 82, 0, 0, 0, 0, 0, 0, 0, 0, + 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, + 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, + 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, + 0, 0, 80, 53, 0, 0, 0, 78, 42, 28, + 0, 0, 0, 0, 0, 55, 56, 0, 65, 66, + 67, 68, 69, 70, 71, 83, 84, 72, 0, 105, + 106, 126, 88, 121, 0, 0, 0, 0, 0, 95, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 92, 77, 17, 0, 35, 0, 63, 45, 97, + 0, 0, 0, 58, 57, 59, 60, 73, 120, 0, + 81, 82, 0, 0, 0, 0, 0, 0, 0, 0, + 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, + 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, + 143, 113, 109, 103, 489, 85, 86, 87, 0, 0, + 0, 0, 80, 53, 0, 0, 0, 78, 148, 149, + 0, 0, 0, 0, 0, 55, 56, 0, 65, 66, + 67, 68, 69, 70, 71, 83, 84, 72, 0, 105, + 106, 126, 88, 121, 0, 0, 0, 0, 0, 95, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 92, 77, 0, 0, 0, 0, 63, 45, 97, + 0, 0, 488, 58, 57, 59, 60, 73, 120, 0, + 81, 82, 0, 0, 0, 0, 0, 0, 0, 0, + 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, + 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, + 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, + 0, 0, 80, 53, 0, 0, 0, 78, 148, 149, + 0, 0, 0, 0, 0, 55, 56, 0, 65, 66, + 67, 68, 69, 70, 71, 83, 84, 72, 0, 105, + 106, 126, 88, 121, 0, 0, 0, 0, 0, 95, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 92, 77, 0, 0, 0, 0, 63, 45, 97, + 0, 0, 867, 58, 57, 59, 60, 73, 120, 0, + 81, 82, 0, 0, 0, 0, 0, 0, 0, 0, + 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, + 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, + 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, + 0, 0, 80, 53, 0, 0, 0, 78, 148, 149, + 0, 0, 0, 0, 0, 55, 56, 0, 65, 66, + 67, 68, 69, 70, 71, 83, 84, 72, 0, 105, + 106, 126, 88, 121, 0, 0, 0, 0, 0, 95, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 92, 77, 0, 0, 0, 0, 63, 45, 97, + 0, 0, 630, 58, 57, 59, 60, 73, 120, 0, + 81, 82, 0, 0, 0, 0, 0, 0, 0, 0, + 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, + 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, + 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, + 0, 0, 80, 53, 0, 0, 0, 78, 148, 149, + 0, 0, 0, 0, 0, 55, 56, 0, 65, 66, + 67, 68, 69, 70, 71, 83, 84, 72, 0, 105, + 106, 126, 88, 121, 0, 0, 0, 0, 0, 95, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 92, 77, 0, 0, 0, 0, 63, 45, 97, + 0, 0, 628, 58, 57, 59, 60, 73, 120, 0, + 81, 82, 0, 0, 0, 0, 0, 0, 0, 0, + 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, + 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, + 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, + 0, 0, 80, 53, 0, 0, 0, 78, 148, 149, + 0, 0, 0, 0, 0, 55, 56, 0, 65, 66, + 67, 68, 69, 70, 71, 83, 84, 72, 0, 105, + 106, 126, 88, 121, 0, 0, 0, 0, 0, 95, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 92, 77, 0, 0, 0, 0, 63, 45, 97, + 0, 0, 292, 58, 57, 59, 60, 73, 120, 0, + 81, 82, 0, 0, 0, 0, 0, 0, 0, 0, + 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, + 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, + 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, + 0, 0, 80, 53, 0, 0, 0, 78, 42, 149, + 0, 0, 0, 0, 0, 55, 56, 0, 65, 66, + 67, 68, 69, 70, 71, 0, 0, 83, 84, 72, + 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, + 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 92, 77, 0, 0, 0, 0, 63, 431, 97, + 45, 0, 0, 58, 57, 59, 60, 73, 120, 0, + 0, 0, 81, 82, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, + 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, + 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, + 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, + 148, 149, 0, 0, 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, 71, 83, 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 92, 77, 17, 0, 35, 0, 63, + 0, 0, 0, 92, 77, 0, 0, 0, 0, 63, + 45, 97, 0, 0, 407, 58, 57, 59, 60, 73, + 120, 0, 81, 82, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, + 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, + 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, + 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, + 148, 149, 0, 0, 0, 0, 0, 55, 56, 0, + 65, 66, 67, 68, 69, 70, 71, 83, 84, 72, + 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, + 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 92, 77, 0, 0, 0, 388, 63, 45, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 0, 81, 82, 0, 0, 0, 0, 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, - 0, 0, 143, 113, 109, 103, 489, 85, 86, 87, + 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, 148, 149, 0, 0, 0, 0, 0, 55, 56, 0, 65, 66, 67, 68, 69, 70, 71, 83, 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 92, 77, 0, 0, 152, 0, 63, + 45, 97, 0, 0, 0, 58, 57, 59, 60, 73, + 120, 0, 81, 82, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, + 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, + 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, + 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, + 148, 149, 0, 0, 0, 0, 0, 55, 56, 0, + 65, 66, 67, 68, 69, 70, 71, 83, 84, 72, + 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, + 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 92, 77, 0, 0, 150, 0, 63, + 45, 97, 0, 0, 0, 58, 57, 59, 60, 73, + 120, 0, 81, 82, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, + 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, + 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, + 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, + 148, 149, 0, 0, 0, 0, 0, 55, 56, 0, + 65, 66, 67, 68, 69, 70, 71, 83, 84, 72, + 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, + 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 92, 77, 0, 0, 146, 0, 63, + 45, 97, 0, 0, 0, 58, 57, 59, 60, 73, + 120, 0, 81, 82, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, + 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, + 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, + 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, + 148, 149, 0, 0, 0, 0, 0, 55, 56, 0, + 65, 66, 67, 68, 69, 70, 71, 83, 84, 72, + 0, 105, 106, 126, 442, 121, 0, 0, 0, 0, + 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 77, 0, 0, 0, 0, 63, - 45, 97, 0, 0, 488, 58, 57, 59, 60, 73, + 45, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 0, 81, 82, 0, 0, 0, 0, 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, @@ -1195,296 +1315,174 @@ var yyAct = [...]int{ 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 77, 0, 0, 0, 0, 63, - 45, 97, 0, 0, 866, 58, 57, 59, 60, 73, - 120, 0, 81, 82, 0, 0, 0, 0, 0, 0, - 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, - 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, - 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, - 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, - 148, 149, 0, 0, 0, 0, 0, 55, 56, 0, - 65, 66, 67, 68, 69, 70, 71, 83, 84, 72, - 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, - 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 92, 77, 0, 0, 0, 0, 63, - 45, 97, 0, 0, 629, 58, 57, 59, 60, 73, - 120, 0, 81, 82, 0, 0, 0, 0, 0, 0, - 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, - 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, - 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, - 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, - 148, 149, 0, 0, 0, 0, 0, 55, 56, 0, - 65, 66, 67, 68, 69, 70, 71, 83, 84, 72, - 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, - 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 92, 77, 0, 0, 0, 0, 63, - 45, 97, 0, 0, 627, 58, 57, 59, 60, 73, - 120, 0, 81, 82, 0, 0, 0, 0, 0, 0, - 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, - 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, - 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, - 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, - 148, 149, 0, 0, 0, 0, 0, 55, 56, 0, - 65, 66, 67, 68, 69, 70, 71, 83, 84, 72, - 0, 105, 106, 126, 88, 121, 0, 0, 0, 0, - 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 92, 77, 0, 0, 0, 0, 63, - 45, 97, 0, 0, 292, 58, 57, 59, 60, 73, + 45, 97, 0, 0, 0, 58, 57, 59, 60, 73, 120, 0, 81, 82, 0, 0, 0, 0, 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, 0, 78, 42, 149, 0, 0, 0, 0, 0, 55, 56, 0, - 65, 66, 67, 68, 69, 70, 71, 0, 0, 83, - 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, - 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 92, 77, 0, 0, 0, 0, 63, - 431, 97, 45, 0, 0, 58, 57, 59, 60, 73, - 120, 0, 0, 0, 81, 82, 0, 0, 0, 0, - 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, - 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, - 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, - 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, - 0, 78, 148, 149, 0, 0, 0, 0, 0, 55, - 56, 0, 65, 66, 67, 68, 69, 70, 71, 83, - 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, - 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 92, 77, 0, 0, 0, - 0, 63, 45, 97, 0, 0, 407, 58, 57, 59, - 60, 73, 120, 0, 81, 82, 0, 0, 0, 0, - 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, - 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, - 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, - 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, - 0, 78, 148, 149, 0, 0, 0, 0, 0, 55, - 56, 0, 65, 66, 67, 68, 69, 70, 71, 83, - 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, - 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 92, 77, 0, 0, 0, - 388, 63, 45, 97, 0, 0, 0, 58, 57, 59, - 60, 73, 120, 0, 81, 82, 0, 0, 0, 0, - 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, - 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, - 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, - 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, - 0, 78, 148, 149, 0, 0, 0, 0, 0, 55, - 56, 0, 65, 66, 67, 68, 69, 70, 71, 83, - 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, - 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 92, 77, 0, 0, 152, - 0, 63, 45, 97, 0, 0, 0, 58, 57, 59, - 60, 73, 120, 0, 81, 82, 0, 0, 0, 0, - 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, - 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, - 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, - 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, - 0, 78, 148, 149, 0, 0, 0, 0, 0, 55, - 56, 0, 65, 66, 67, 68, 69, 70, 71, 83, - 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, - 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 92, 77, 0, 0, 150, - 0, 63, 45, 97, 0, 0, 0, 58, 57, 59, - 60, 73, 120, 0, 81, 82, 0, 0, 0, 0, - 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, - 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, - 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, - 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, - 0, 78, 148, 149, 0, 0, 0, 0, 0, 55, - 56, 0, 65, 66, 67, 68, 69, 70, 71, 83, - 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, - 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 92, 77, 0, 0, 146, - 0, 63, 45, 97, 0, 0, 0, 58, 57, 59, - 60, 73, 120, 0, 81, 82, 0, 0, 0, 0, - 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, - 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, - 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, - 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, - 0, 78, 148, 149, 0, 0, 0, 0, 0, 55, - 56, 0, 65, 66, 67, 68, 69, 70, 71, 83, - 84, 72, 0, 105, 106, 126, 442, 121, 0, 0, - 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 92, 77, 0, 0, 0, - 0, 63, 45, 97, 0, 0, 0, 58, 57, 59, - 60, 73, 120, 0, 81, 82, 0, 0, 0, 0, - 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, - 112, 107, 108, 0, 0, 0, 0, 0, 0, 93, - 0, 0, 0, 0, 143, 113, 109, 103, 0, 85, - 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, - 0, 78, 148, 149, 0, 0, 0, 0, 0, 55, - 56, 0, 65, 66, 67, 68, 69, 70, 71, 83, - 84, 72, 0, 105, 106, 126, 88, 121, 0, 0, - 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 92, 77, 0, 0, 0, - 0, 63, 45, 97, 0, 0, 0, 58, 57, 59, - 60, 73, 120, 0, 81, 82, 0, 0, 0, 0, - 0, 0, 0, 0, 52, 96, 0, 94, 110, 111, - 112, 107, 108, 0, 841, 0, 0, 0, 0, 93, - 842, 0, 0, 840, 143, 113, 109, 103, 0, 85, - 86, 87, 0, 0, 0, 0, 80, 53, 0, 0, - 0, 78, 42, 149, 0, 0, 0, 0, 0, 55, - 56, 0, 65, 66, 67, 68, 69, 70, 71, 0, - 0, 169, 171, 170, 192, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 847, 848, 849, 846, 845, 844, - 0, 0, 0, 0, 0, 92, 77, 794, 0, 0, - 0, 63, 0, 97, 0, 0, 0, 58, 57, 59, - 60, 73, 120, 167, 168, 179, 182, 183, 184, 185, - 186, 187, 189, 191, 0, 0, 668, 666, 667, 833, - 0, 0, 0, 857, 193, 173, 177, 176, 0, 0, - 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, - 190, 175, 755, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 670, 669, - 657, 663, 664, 671, 672, 673, 674, 677, 678, 0, - 0, 169, 171, 170, 192, 0, 0, 653, 0, 679, - 661, 655, 654, 0, 0, 0, 0, 0, 660, 0, - 662, 656, 658, 659, 675, 676, 665, 0, 0, 0, + 65, 66, 67, 68, 69, 70, 71, 0, 0, 169, + 171, 170, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 167, 168, 179, 182, 183, 184, 185, - 186, 187, 189, 191, 169, 171, 170, 192, 0, 0, - 0, 0, 0, 0, 193, 173, 177, 176, 0, 0, - 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, - 190, 175, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 167, 168, 179, 182, - 183, 184, 185, 186, 187, 189, 191, 0, 0, 0, - 752, 169, 171, 170, 192, 0, 0, 193, 173, 177, - 176, 0, 0, 0, 0, 0, 172, 0, 174, 178, - 180, 181, 188, 190, 175, 0, 0, 0, 0, 0, + 0, 0, 0, 92, 77, 795, 0, 0, 0, 63, + 0, 97, 0, 0, 0, 58, 57, 59, 60, 73, + 120, 167, 168, 179, 182, 183, 184, 185, 186, 187, + 189, 191, 0, 0, 669, 667, 668, 0, 0, 0, + 0, 858, 193, 173, 177, 176, 0, 0, 0, 0, + 0, 172, 0, 174, 178, 180, 181, 188, 190, 175, + 756, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 671, 670, 658, 664, + 665, 672, 673, 674, 675, 678, 679, 0, 0, 169, + 171, 170, 192, 0, 0, 654, 0, 680, 662, 656, + 655, 0, 0, 0, 0, 0, 661, 0, 663, 657, + 659, 660, 676, 677, 666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 167, 168, 179, 182, 183, 184, 185, - 186, 187, 189, 191, 0, 0, 0, 708, 169, 171, - 170, 192, 0, 0, 193, 173, 177, 176, 0, 0, - 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, - 190, 175, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 167, 168, 179, 182, 183, 184, 185, 186, 187, 189, - 191, 0, 0, 0, 643, 169, 171, 170, 192, 0, - 0, 193, 173, 177, 176, 0, 0, 0, 0, 0, - 172, 0, 174, 178, 180, 181, 188, 190, 175, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 167, 168, 179, - 182, 183, 184, 185, 186, 187, 189, 191, 0, 0, - 0, 640, 169, 171, 170, 192, 0, 0, 193, 173, - 177, 176, 0, 0, 0, 0, 0, 172, 0, 174, - 178, 180, 181, 188, 190, 175, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 167, 168, 179, 182, 183, 184, - 185, 186, 187, 189, 191, 169, 171, 170, 192, 0, - 0, 0, 622, 0, 0, 193, 173, 177, 176, 0, - 0, 0, 0, 0, 172, 0, 174, 178, 180, 181, - 188, 190, 175, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 167, 168, 179, - 182, 183, 184, 185, 186, 187, 189, 191, 0, 0, - 0, 603, 169, 171, 170, 192, 0, 0, 193, 173, - 177, 176, 0, 0, 0, 0, 0, 172, 0, 174, - 178, 180, 181, 188, 190, 175, 476, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 167, 168, 179, 182, 183, 184, - 185, 186, 187, 189, 191, 169, 171, 170, 192, 0, - 554, 0, 0, 0, 0, 193, 173, 177, 176, 0, - 0, 0, 0, 0, 172, 0, 174, 178, 180, 181, - 188, 190, 175, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 167, 168, 179, - 182, 183, 184, 185, 186, 187, 189, 191, 169, 171, - 170, 192, 0, 0, 0, 0, 0, 0, 193, 173, - 177, 176, 0, 0, 0, 0, 0, 172, 0, 174, - 178, 180, 181, 188, 190, 175, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 405, 0, 0, 0, - 167, 168, 179, 182, 183, 184, 185, 186, 187, 189, - 191, 0, 0, 0, 0, 0, 0, 0, 429, 0, - 0, 193, 173, 177, 176, 169, 171, 170, 192, 0, - 172, 0, 174, 178, 180, 181, 188, 190, 175, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 167, 168, 179, - 182, 183, 184, 185, 186, 187, 189, 191, 169, 171, - 170, 192, 0, 0, 0, 0, 0, 0, 193, 173, - 177, 176, 0, 0, 0, 0, 0, 172, 0, 174, - 178, 180, 181, 188, 190, 175, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 167, 168, 179, 182, 183, 184, 185, 186, 187, 189, - 191, 169, 171, 170, 192, 397, 0, 0, 0, 0, - 0, 193, 173, 177, 176, 0, 0, 0, 0, 0, - 172, 0, 174, 178, 180, 181, 188, 190, 175, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 167, 168, 179, 182, 183, 184, 185, - 186, 187, 189, 191, 169, 171, 170, 192, 347, 0, - 0, 0, 0, 0, 193, 173, 177, 176, 0, 0, - 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, - 190, 175, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 167, 168, 179, 182, - 183, 184, 185, 186, 187, 189, 191, 169, 171, 170, - 192, 346, 0, 0, 0, 0, 0, 193, 173, 177, - 176, 0, 0, 0, 0, 0, 172, 0, 174, 178, - 180, 181, 188, 190, 175, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 668, 666, 667, 167, - 168, 179, 182, 183, 184, 185, 186, 187, 189, 191, - 0, 0, 0, 0, 166, 0, 0, 0, 0, 0, - 193, 173, 177, 176, 0, 0, 0, 0, 0, 172, - 0, 174, 178, 180, 181, 188, 190, 175, 670, 669, - 657, 663, 664, 671, 672, 673, 674, 677, 678, 169, - 171, 170, 192, 0, 0, 0, 0, 653, 0, 679, - 661, 655, 654, 0, 0, 0, 0, 0, 660, 0, - 662, 656, 658, 659, 675, 676, 665, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 666, - 667, 167, 168, 179, 182, 183, 184, 185, 186, 187, - 189, 191, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 167, 168, 179, 182, 183, 184, 185, 186, 187, + 189, 191, 169, 171, 170, 192, 0, 0, 0, 0, 0, 0, 193, 173, 177, 176, 0, 0, 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, 190, 175, - 670, 669, 657, 663, 664, 671, 672, 673, 674, 677, - 678, 171, 170, 192, 0, 0, 0, 0, 0, 653, - 0, 679, 661, 655, 654, 0, 0, 0, 0, 0, - 660, 0, 662, 656, 658, 659, 675, 676, 665, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 167, 168, 179, 182, 183, 184, + 185, 186, 187, 189, 191, 0, 0, 0, 753, 169, + 171, 170, 192, 0, 0, 193, 173, 177, 176, 0, + 0, 0, 0, 0, 172, 0, 174, 178, 180, 181, + 188, 190, 175, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 167, 168, 179, 182, 183, 184, 185, 186, 187, + 189, 191, 0, 0, 0, 709, 169, 171, 170, 192, + 0, 0, 193, 173, 177, 176, 0, 0, 0, 0, + 0, 172, 0, 174, 178, 180, 181, 188, 190, 175, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 167, 168, + 179, 182, 183, 184, 185, 186, 187, 189, 191, 0, + 0, 0, 644, 169, 171, 170, 192, 0, 0, 193, + 173, 177, 176, 0, 0, 0, 0, 0, 172, 0, + 174, 178, 180, 181, 188, 190, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 167, 168, 179, 182, 183, + 184, 185, 186, 187, 189, 191, 0, 0, 0, 641, + 169, 171, 170, 192, 0, 0, 193, 173, 177, 176, + 0, 0, 0, 0, 0, 172, 0, 174, 178, 180, + 181, 188, 190, 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 167, 168, 179, 182, 183, 184, 185, 186, - 187, 189, 191, 170, 192, 0, 0, 0, 0, 0, - 0, 0, 0, 193, 173, 177, 176, 0, 0, 0, + 187, 189, 191, 169, 171, 170, 192, 0, 0, 0, + 623, 0, 0, 193, 173, 177, 176, 0, 0, 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, 190, 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 167, 168, 179, 182, 183, + 184, 185, 186, 187, 189, 191, 169, 171, 170, 192, + 0, 0, 0, 622, 0, 0, 193, 173, 177, 176, + 0, 0, 0, 0, 0, 172, 0, 174, 178, 180, + 181, 188, 190, 175, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 167, 168, + 179, 182, 183, 184, 185, 186, 187, 189, 191, 0, + 0, 0, 603, 169, 171, 170, 192, 0, 0, 193, + 173, 177, 176, 0, 0, 0, 0, 0, 172, 0, + 174, 178, 180, 181, 188, 190, 175, 476, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 167, 168, 179, 182, 183, + 184, 185, 186, 187, 189, 191, 169, 171, 170, 192, + 0, 554, 0, 0, 0, 0, 193, 173, 177, 176, + 0, 0, 0, 0, 0, 172, 0, 174, 178, 180, + 181, 188, 190, 175, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 167, 168, + 179, 182, 183, 184, 185, 186, 187, 189, 191, 169, + 171, 170, 192, 0, 0, 0, 0, 0, 0, 193, + 173, 177, 176, 0, 0, 0, 0, 0, 172, 0, + 174, 178, 180, 181, 188, 190, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 405, 0, 0, + 0, 167, 168, 179, 182, 183, 184, 185, 186, 187, + 189, 191, 0, 0, 0, 0, 0, 0, 0, 429, + 0, 0, 193, 173, 177, 176, 169, 171, 170, 192, + 0, 172, 0, 174, 178, 180, 181, 188, 190, 175, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 167, 168, + 179, 182, 183, 184, 185, 186, 187, 189, 191, 169, + 171, 170, 192, 0, 0, 0, 0, 0, 0, 193, + 173, 177, 176, 0, 0, 0, 0, 0, 172, 0, + 174, 178, 180, 181, 188, 190, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 167, 168, 179, 182, 183, 184, 185, 186, 187, + 189, 191, 169, 171, 170, 192, 397, 0, 0, 0, + 0, 0, 193, 173, 177, 176, 0, 0, 0, 0, + 0, 172, 0, 174, 178, 180, 181, 188, 190, 175, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 167, 168, 179, 182, 183, 184, + 185, 186, 187, 189, 191, 169, 171, 170, 192, 347, + 0, 0, 0, 0, 0, 193, 173, 177, 176, 0, + 0, 0, 0, 0, 172, 0, 174, 178, 180, 181, + 188, 190, 175, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 167, 168, 179, + 182, 183, 184, 185, 186, 187, 189, 191, 169, 171, + 170, 192, 346, 0, 0, 0, 0, 0, 193, 173, + 177, 176, 0, 0, 0, 0, 0, 172, 0, 174, + 178, 180, 181, 188, 190, 175, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 669, 667, 668, + 167, 168, 179, 182, 183, 184, 185, 186, 187, 189, + 191, 0, 0, 0, 0, 166, 0, 0, 0, 0, + 0, 193, 173, 177, 176, 0, 0, 0, 0, 0, + 172, 0, 174, 178, 180, 181, 188, 190, 175, 671, + 670, 658, 664, 665, 672, 673, 674, 675, 678, 679, + 169, 171, 170, 192, 0, 0, 0, 0, 654, 0, + 680, 662, 656, 655, 0, 0, 0, 0, 0, 661, + 0, 663, 657, 659, 660, 676, 677, 666, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 667, 668, 167, 168, 179, 182, 183, 184, 185, 186, + 187, 189, 191, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 193, 173, 177, 176, 0, 0, 0, + 0, 0, 172, 0, 174, 178, 180, 181, 188, 190, + 175, 671, 670, 658, 664, 665, 672, 673, 674, 675, + 678, 679, 171, 170, 192, 0, 0, 0, 0, 0, + 654, 0, 680, 662, 656, 655, 0, 0, 0, 0, + 0, 661, 0, 663, 657, 659, 660, 676, 677, 666, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 167, 168, 179, 182, 183, 184, 185, - 186, 187, 189, 191, 192, 0, 0, 0, 0, 0, + 186, 187, 189, 191, 170, 192, 0, 0, 0, 0, 0, 0, 0, 0, 193, 173, 177, 176, 0, 0, 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, 190, 175, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 167, 168, 179, 182, 183, 184, 185, - 186, 187, 189, 191, 192, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 193, 173, 177, 176, 0, 0, - 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, - 190, 175, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 167, 168, 179, 182, 183, 184, 185, + 0, 0, 0, 0, 167, 168, 179, 182, 183, 184, + 185, 186, 187, 189, 191, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 193, 173, 177, 176, 0, + 0, 0, 0, 0, 172, 0, 174, 178, 180, 181, + 188, 190, 175, 671, 670, 658, 664, 665, 672, 673, + 674, 675, 678, 679, 192, 0, 0, 0, 0, 0, + 0, 0, 654, 0, 680, 662, 656, 655, 0, 0, + 0, 0, 0, 661, 0, 663, 657, 659, 660, 676, + 677, 666, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 192, 167, 168, 179, 182, 183, 184, 185, 186, 187, 189, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 177, 176, 0, 0, 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, - 190, 175, 669, 657, 663, 664, 671, 672, 673, 674, - 677, 678, 192, 0, 0, 0, 0, 0, 0, 0, - 653, 0, 0, 661, 655, 654, 0, 0, 0, 0, - 0, 660, 0, 662, 656, 658, 659, 675, 676, 665, + 190, 175, 168, 179, 182, 183, 184, 185, 186, 187, + 189, 191, 192, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 173, 177, 176, 0, 0, 0, 0, + 0, 172, 0, 174, 178, 180, 181, 188, 190, 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 168, 179, 182, 183, 184, 185, 186, 187, + 0, 0, 0, 179, 182, 183, 184, 185, 186, 187, 189, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 177, 176, 0, 0, 0, 0, 0, 172, 0, 174, 178, 180, 181, 188, 190, 175, - 657, 663, 664, 671, 672, 673, 674, 677, 678, 192, - 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, - 661, 655, 654, 0, 0, 0, 0, 0, 660, 0, - 662, 656, 658, 659, 675, 676, 665, 0, 0, 0, + 658, 664, 665, 672, 673, 674, 675, 678, 679, 192, + 0, 0, 0, 0, 0, 0, 0, 654, 0, 0, + 662, 656, 655, 0, 0, 0, 0, 0, 0, 0, + 663, 657, 659, 660, 676, 677, 666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 179, 182, 183, 184, 185, 186, 187, 189, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 173, 177, 176, 0, 0, 0, 0, 0, 172, 0, - 174, 178, 180, 181, 188, 190, 175, 657, 663, 664, - 671, 672, 673, 674, 677, 678, 192, 0, 0, 0, - 0, 0, 0, 0, 653, 0, 0, 661, 655, 654, - 0, 0, 0, 0, 0, 0, 0, 662, 656, 658, - 659, 675, 676, 665, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 179, 182, 183, - 184, 185, 186, 187, 189, 191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 173, 177, 176, - 0, 0, 0, 0, 0, 0, 0, 174, 178, 180, - 181, 188, 190, 175, 657, 663, 664, 671, 672, 673, - 674, 677, 678, 192, 0, 0, 0, 0, 0, 0, - 0, 653, 0, 0, 0, 655, 654, 0, 0, 0, - 0, 0, 0, 0, 0, 656, 658, 659, 675, 676, - 665, 105, 106, 126, 0, 0, 0, 0, 0, 0, + 173, 177, 176, 0, 0, 0, 0, 0, 0, 0, + 174, 178, 180, 181, 188, 190, 175, 658, 664, 665, + 672, 673, 674, 675, 678, 679, 0, 0, 0, 0, + 0, 0, 0, 0, 654, 0, 0, 662, 656, 655, + 0, 0, 0, 0, 0, 0, 0, 0, 657, 659, + 660, 676, 677, 666, 658, 664, 665, 672, 673, 674, + 675, 678, 679, 192, 0, 0, 0, 0, 0, 0, + 0, 654, 0, 0, 0, 656, 655, 0, 0, 0, + 0, 0, 0, 0, 0, 657, 659, 660, 676, 677, + 666, 105, 106, 126, 0, 0, 0, 0, 0, 0, 0, 529, 0, 0, 179, 182, 183, 184, 185, 186, 187, 189, 191, 0, 105, 106, 126, 0, 0, 0, 0, 0, 0, 0, 529, 177, 176, 0, 0, 0, @@ -1497,7 +1495,7 @@ var yyAct = [...]int{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 787, 536, + 0, 0, 0, 0, 0, 0, 0, 0, 788, 536, 0, 525, 0, 0, 0, 535, 534, 532, 533, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 536, 0, 525, 0, 0, 0, 535, 534, @@ -1505,183 +1503,184 @@ var yyAct = [...]int{ } var yyPact = [...]int{ - -1000, -1000, 2475, -1000, -1000, -1000, -1000, -1000, 296, 501, - 570, 107, -1000, 306, -1000, -1000, 914, -1000, 227, 227, - 5583, 295, 227, 6795, 6685, 6575, 362, 162, 756, 6905, - -1000, 8040, 292, 291, 287, -1000, 387, 6905, 913, 26, - 912, 904, 6905, -1000, -1000, -1000, -1000, 680, -1000, 676, - -1000, 1368, 286, 6905, 436, 218, 218, 6905, 6905, 6905, - 6905, -1000, -1000, 7125, -1000, 6905, 6905, 6905, 6905, 6905, - 6905, 6905, 285, 6905, -1000, 177, 175, 891, 6905, 665, - 703, 278, 277, 6905, 6905, 270, 6905, 6905, -1000, 165, - -1000, -1000, 887, 840, -1000, 164, 269, 6133, -1000, 163, - 160, -1000, 228, 830, 560, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, 116, 137, -1000, 556, 231, -1000, - 386, -1000, 216, 339, -1000, 830, -1000, 91, 610, 604, - -1000, 674, 830, -1000, 901, -1000, -70, 4503, 5429, 7125, - 5275, 752, 26, 521, 6905, 272, -1000, 7987, -1000, 707, - -1000, 7934, -1000, 360, 1606, 8132, -1000, 67, -1000, -1000, - 150, 64, 26, -73, 48, 8132, -1000, 6905, 6905, 6905, - 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, - 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, - 6905, 6905, 703, 6465, 218, 6905, 897, -1000, 7881, 358, - 341, -1000, 671, 670, -1000, 1368, 7828, -1000, -1000, 6355, - 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, 6905, - 6905, 6905, 699, -1000, -1000, -1000, -1000, -1000, 228, 520, - 830, 555, 554, -1000, -1000, 400, 400, 448, 400, 215, - 7761, 213, 400, 400, 400, 400, 400, 400, 400, -1000, - 6243, -1000, 400, 6905, 6905, 389, 684, 852, -1000, 246, - 7015, 218, 8324, 134, 231, 543, -1000, 485, 517, 830, - 664, 116, 137, 537, 6905, 6905, 8132, 8132, 6905, 8132, - 8132, 6905, 574, 684, 843, -1000, 786, 6905, 6133, 152, - 17, 7708, 218, 6905, 6905, 892, -1000, 1698, 228, 111, - 6905, 6905, 116, 386, 138, -1000, 6905, 351, -1000, -1000, - 2319, 228, -1000, 630, 36, -1000, 666, 830, -4, -1000, - 606, 830, 856, 545, -77, 8856, -1000, -1000, -1000, -1000, - -1000, -1000, 267, -1000, -1000, -1000, -1000, -1000, 227, 265, - 350, -39, 8132, -1000, 349, 348, -1000, -1000, -1000, -1000, - -1000, 162, -1000, 6905, -1000, -1000, 806, 263, 8856, -1000, - 6905, 8462, 8549, 8223, 8324, 8274, 8636, 8723, 1836, 34, - 34, 34, 448, 400, 448, 448, 57, 57, 297, 297, - 297, 297, 38, 38, 38, 38, -1000, 7655, 6905, 31, - -1000, -1000, 996, 741, 8, -82, 4347, -1000, -1000, 256, - 563, 668, 612, 385, 612, 6905, 8324, 708, 8324, 8324, - 8324, 8324, 8324, 8324, 8324, 8324, 8324, 8324, 8324, 8324, - -15, -1000, -1000, 254, 830, 228, 134, 134, 242, -1000, - -1000, -1000, 147, 8132, 135, -1000, -1000, -1000, -1000, 803, - 848, 7598, 158, 370, 231, 140, -1000, -1000, 116, 137, - -1000, 6905, -1000, -1000, 133, 830, 485, 134, 116, 133, - -16, -1000, 1368, -1000, 119, 209, 7545, 132, -1000, -1000, - -1000, 123, 207, -1000, -1000, 6023, 5913, -1000, -1000, 122, - 118, -1000, -1000, -20, 197, -1000, -1000, 1368, 218, 6905, - -1000, 231, 231, -1000, -1000, 110, 7488, 231, 231, -1000, - 7431, -1000, 2163, -1000, -1000, -1000, -1000, 610, 844, 527, - -1000, 604, 841, 522, -1000, 839, 8856, -1000, 8079, -1000, - -1000, 485, 516, 830, 245, 8856, -1000, -1000, -1000, -1000, - 632, 532, 8856, 8856, 8856, 8856, 8856, 195, 456, 4659, - 4191, 342, 6905, 6905, 458, -1000, 919, -1000, -1000, 7374, - -84, 563, -1000, 8132, 6905, 8374, 340, 218, 204, 204, - 5121, 838, 8856, 704, 563, 192, -43, -1000, 26, -1000, - -1000, -1000, 485, 508, 830, 383, 612, -1000, -1000, -60, - -1000, -1000, 1368, -1000, 703, -91, 699, 699, 228, -1000, - -1000, 199, 643, 6905, -1000, 134, -1000, -1000, 108, -1000, - -1000, -1000, -1000, -1000, 6905, -1000, -1000, 156, 141, -1000, - 6905, 6905, 116, 7317, -1000, 485, -1000, -1000, -1000, 6905, - -1000, -1000, -1000, -1000, -1000, -1000, 7264, 218, 8132, 218, - -1000, -1000, -1000, 5693, -1000, -1000, 8132, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, 836, -1000, -1000, - 831, -1000, -1000, 8856, 8856, 8856, 8856, 8856, 8856, 8856, - 8856, 8856, 8856, 8856, 8856, 8856, 8856, 8856, 8856, 8856, - 8856, 8856, 8856, 8856, 8856, 8856, 8856, 8856, 8856, 8833, - 830, 485, 8856, 106, -55, 7209, 573, 717, 121, 121, - -71, -71, 1935, 338, -1000, 227, 5583, 452, 336, -1000, - 334, 8132, -1000, 6905, 241, 438, 333, 916, -1000, 8856, - 190, 8374, -1000, -1000, 595, -1000, 218, 238, 595, -1000, - -1000, -1000, -93, -1000, 697, 235, 189, 691, 563, 464, - 830, 485, -1000, -60, 7156, 612, 231, 6905, -1000, -40, - 6905, 643, -1000, 105, 231, -1000, 7154, 643, 6905, 6905, - 69, 1896, -1000, 633, -1000, 5803, -1000, -1000, -1000, -1000, - -1000, 1239, -71, -71, 121, 121, 121, 121, 8586, 8673, - 1980, -51, -51, -71, 1785, 1383, 8171, 8499, 8412, 20, - 20, 20, 20, -78, -78, -78, -78, 8856, 1186, 485, - 188, -1000, -1000, 8856, 8856, -1000, -1000, -1000, -1000, 5583, - -1000, 449, 227, 299, -1000, 6905, 1053, -1000, -1000, -1000, - -1000, -1000, 330, -1000, 691, 186, 204, -1000, 699, 185, - 4035, 8856, -1000, 381, 612, 380, 377, 223, -1000, 788, - -1000, 485, 2007, -1000, -1000, 784, -38, -1000, 707, 709, - -1000, 826, 612, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, 8324, -1000, 63, -1000, -1000, 366, -1000, 58, - 54, -1000, -1000, -1000, 134, 8132, 218, -1000, 1490, 8856, - -1000, 1734, 8079, -1000, 321, 219, -1000, 183, -1000, 4659, - -1000, 376, 4967, -1000, -48, 4967, 314, -1000, -1000, 774, - -1000, -1000, 187, -94, -1000, -49, -98, -1000, 825, 26, - -1000, -108, -79, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - 1490, 8856, -1000, -1000, 4659, 4813, 4659, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, 3879, 182, 3723, 3567, -53, -1000, - 772, 8856, -1000, 771, 8856, -116, 821, 8856, -1000, 612, - -1000, 619, 8079, 4659, -1000, -1000, -1000, 3411, 3255, -1000, - 374, -1000, -1000, -1000, 169, -1000, -1000, -117, -1000, 8856, - 222, -1000, -1000, 364, 619, -1000, 313, 310, 688, 737, - 528, -1000, 3099, -1000, 309, -1000, -1000, 767, 8856, -1000, - 563, -1000, -1000, -1000, -1000, 612, 709, 818, 302, -1000, - 2943, -1000, -1000, 181, -62, -1000, 811, -1000, -1000, -1000, - 701, 301, 612, -1000, -1000, 701, -1000, 221, -1000, -1000, - -1000, -1000, -1000, 612, 2787, 762, -1000, 170, 343, -1000, - 2631, -1000, + -1000, -1000, 2453, -1000, -1000, -1000, -1000, -1000, 317, 508, + 616, 113, -1000, 335, -1000, -1000, 1012, -1000, 261, 261, + 5561, 315, 261, 6773, 6663, 6553, 403, 150, 897, 6883, + -1000, 8071, 314, 313, 312, -1000, 441, 6883, 1004, 45, + 998, 992, 6883, -1000, -1000, -1000, -1000, 762, -1000, 751, + -1000, 1813, 308, 6883, 493, 404, 404, 6883, 6883, 6883, + 6883, -1000, -1000, 7103, -1000, 6883, 6883, 6883, 6883, 6883, + 6883, 6883, 304, 6883, -1000, 183, 182, 948, 6883, 725, + 405, 303, 302, 6883, 6883, 299, 6883, 6883, -1000, 181, + -1000, -1000, 942, 844, -1000, 179, 298, 6111, -1000, 177, + 176, -1000, 283, 965, 647, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, 130, 138, -1000, 637, 263, -1000, + 439, -1000, 243, 371, -1000, 965, -1000, 98, 677, 610, + -1000, 726, 965, -1000, 991, -1000, -54, 4481, 5407, 7103, + 5253, 828, 45, 564, 6883, 301, -1000, 8018, -1000, 799, + -1000, 7965, -1000, 398, 2010, 8163, -1000, 88, -1000, -1000, + 300, 69, 45, -55, 60, 8163, -1000, 6883, 6883, 6883, + 6883, 6883, 6883, 6883, 6883, 6883, 6883, 6883, 6883, 6883, + 6883, 6883, 6883, 6883, 6883, 6883, 6883, 6883, 6883, 6883, + 6883, 6883, 405, 6443, 404, 6883, 990, -1000, 7912, 397, + 374, -1000, 746, 744, -1000, 1813, 7859, -1000, -1000, 6333, + 6883, 6883, 6883, 6883, 6883, 6883, 6883, 6883, 6883, 6883, + 6883, 6883, 237, -1000, -1000, -1000, -1000, -1000, 283, 541, + 965, 636, 632, -1000, -1000, 463, 463, 496, 463, 238, + 7792, 236, 463, 463, 463, 463, 463, 463, 463, -1000, + 6221, -1000, 463, 6883, 6883, 443, 733, 730, -1000, 271, + 6993, 404, 1334, 195, 263, 618, -1000, 524, 531, 965, + 708, 130, 138, 573, 6883, 6883, 8163, 8163, 6883, 8163, + 8163, 6883, 626, 733, 917, -1000, 830, 6883, 6111, 171, + 7, 7739, 404, 6883, 6883, 989, -1000, 1675, 283, 191, + 6883, 6883, 130, 439, 276, -1000, 6883, 396, -1000, -1000, + 2297, 283, -1000, 716, 50, -1000, 712, 965, -3, -1000, + 711, 965, 986, 662, -57, 8826, -1000, -1000, -1000, -1000, + -1000, -1000, 292, -1000, -1000, -1000, -1000, -1000, 261, 290, + 395, -18, 8163, -1000, 394, 387, -1000, -1000, -1000, -1000, + -1000, 150, -1000, 6883, -1000, -1000, 950, 288, 8826, -1000, + 6883, 8432, 8482, 8254, 1334, 8305, 8569, 8693, 1814, 35, + 35, 35, 496, 463, 496, 496, 342, 342, 700, 700, + 700, 700, 57, 57, 57, 57, -1000, 7686, 6883, 23, + -1000, -1000, 1925, 812, 16, -71, 4325, -1000, -1000, 281, + 718, 727, 607, 438, 607, 6883, 1334, 282, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 13, -1000, -1000, 278, 965, 283, 195, 195, 249, -1000, + -1000, -1000, 164, 8163, 162, -1000, -1000, -1000, -1000, 939, + 981, 7629, 156, 413, 263, 139, -1000, -1000, 130, 138, + -1000, 6883, -1000, -1000, 134, 965, 524, 195, 130, 134, + -4, -1000, 1813, -1000, 1583, 7576, 7523, 152, -1000, -1000, + -1000, 151, 234, -1000, -1000, 6001, 5891, -1000, -1000, 141, + 133, -1000, -1000, -9, 228, -1000, -1000, 1813, 404, 6883, + -1000, 263, 263, -1000, -1000, 103, 7466, 263, 263, -1000, + 7409, -1000, 2141, -1000, -1000, -1000, -1000, 677, 979, 623, + -1000, 610, 976, 611, -1000, 974, 8826, -1000, 8110, -1000, + -1000, 524, 529, 965, 274, 8826, -1000, -1000, -1000, -1000, + 710, 571, 8826, 8826, 8826, 8826, 8826, 227, 551, 4637, + 4169, 386, 6883, 6883, 490, -1000, 892, -1000, -1000, 7352, + -75, 718, -1000, 8163, 6883, 8394, 385, 404, 132, 132, + 5099, 973, 8826, 794, 718, 219, -30, -1000, 45, -1000, + -1000, -1000, 524, 527, 965, 437, 607, -1000, -1000, -43, + -1000, -1000, 1813, -1000, 405, -78, 237, 237, 283, -1000, + -1000, 149, 704, 6883, -1000, 195, -1000, -1000, 99, -1000, + -1000, -1000, -1000, -1000, -1000, 6883, -1000, -1000, 175, 131, + -1000, 6883, 6883, 130, 7295, -1000, 524, -1000, -1000, -1000, + 6883, -1000, -1000, -1000, -1000, -1000, -1000, 7242, 404, 8163, + 404, -1000, -1000, -1000, 5671, -1000, -1000, 8163, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 971, -1000, + -1000, 967, -1000, -1000, 8826, 8826, 8826, 8826, 8826, 8826, + 8826, 8826, 8826, 8826, 8826, 8826, 8826, 8826, 8826, 8826, + 8826, 8826, 8826, 8826, 8826, 8826, 8826, 8826, 8826, 8826, + 8803, 965, 524, 8826, 95, -39, 7187, 654, 898, 128, + 128, -53, -53, 1218, 384, -1000, 261, 5561, 509, 383, + -1000, 381, 8163, -1000, 6883, 286, 467, 375, 884, -1000, + 8826, 211, 8394, -1000, -1000, 673, -1000, 404, 267, 673, + -1000, -1000, -1000, -84, -1000, 780, 265, 209, 775, 718, + 518, 965, 524, -1000, -43, 1003, 607, 263, 6883, -1000, + -10, 6883, 704, -1000, 76, 263, -1000, 7132, 704, 6883, + 6883, 73, 1927, -1000, 676, -1000, 5781, -1000, -1000, -1000, + -1000, -1000, 1874, -53, -53, 128, 128, 128, 128, 8519, + 8643, 8606, 224, 224, -53, 1762, 8344, 8202, 102, -65, + 20, 20, 20, 20, -40, -40, -40, -40, 8826, 1163, + 524, 200, -1000, -1000, 8826, 8826, -1000, -1000, -1000, -1000, + 5561, -1000, 504, 261, 277, -1000, 6883, 1029, -1000, -1000, + -1000, -1000, -1000, 372, -1000, 775, 198, 132, -1000, 237, + 189, 4013, 8826, -1000, 432, 607, 431, 430, 256, -1000, + 944, -1000, 524, 669, -1000, -1000, 941, -23, -1000, 799, + 621, -1000, 962, 607, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, 1334, -1000, 67, -1000, -1000, 410, -1000, + 66, 51, -1000, -1000, -1000, 195, 8163, 404, -1000, 1467, + 8826, -1000, 1711, 8110, -1000, 367, 250, -1000, 187, -1000, + 4637, -1000, 429, 4945, -1000, -13, 4945, 363, -1000, -1000, + 926, -1000, -1000, 166, -85, -1000, -26, -100, -1000, 959, + 45, -1000, -105, -81, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, 1467, 8826, -1000, -1000, 4637, 4791, 4637, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, 3857, 185, 3701, 3545, -27, + -1000, 920, 8826, -1000, 890, 8826, -106, 958, 8826, -1000, + 607, -1000, 702, 8110, 4637, -1000, -1000, -1000, 3389, 3233, + -1000, 425, -1000, -1000, -1000, 157, -1000, -1000, -107, -1000, + 8826, 254, -1000, -1000, 407, 702, -1000, 353, 347, 772, + 808, 570, -1000, 3077, -1000, 344, -1000, -1000, 846, 8826, + -1000, 718, -1000, -1000, -1000, -1000, 607, 621, 954, 341, + -1000, 2921, -1000, -1000, 158, -79, -1000, 953, -1000, -1000, + -1000, 789, 334, 607, -1000, -1000, 789, -1000, 253, -1000, + -1000, -1000, -1000, -1000, 607, 2765, 838, -1000, 104, 422, + -1000, 2609, -1000, } var yyPgo = [...]int{ - 0, 29, 1094, 1092, 38, 31, 30, 572, 1091, 1090, - 134, 217, 204, 88, 1385, 82, 72, 59, 684, 1422, - 1088, 33, 1086, 1085, 1083, 136, 1082, 36, 37, 1081, - 1080, 1079, 1078, 135, 1077, 1076, 24, 1075, 26, 48, - 45, 1074, 708, 34, 1073, 1, 1072, 1070, 27, 1069, - 73, 68, 61, 1068, 1067, 1066, 35, 1065, 1063, 4, - 1062, 1061, 1060, 17, 1059, 1058, 1057, 1056, 51, 5, - 1055, 1054, 1053, 1051, 1049, 2, 1048, 631, 1047, 18, - 22, 1046, 1045, 1043, 15, 1042, 1041, 6, 19, 1040, - 1037, 1033, 9, 39, 0, 1032, 1030, 1029, 117, 1028, - 1027, 553, 1026, 1024, 42, 8, 1018, 1017, 1013, 1007, - 14, 49, 1001, 1000, 998, 995, 993, 992, 3, 991, - 16, 990, 988, 985, 28, 983, 982, 980, 976, 974, - 971, 962, 21, 961, 959, 958, 25, 955, 23, 12, - 953, 40, 945, 939, 937, 933, 41, 13, 930, 853, - 7, 20, + 0, 29, 1177, 22, 21, 1176, 49, 41, 39, 544, + 1175, 1172, 164, 217, 228, 180, 1362, 64, 51, 59, + 855, 1399, 1171, 33, 1170, 1169, 1157, 136, 1155, 40, + 37, 1154, 1152, 1151, 1149, 84, 1148, 1147, 20, 1145, + 28, 44, 38, 1139, 854, 36, 1137, 1, 1136, 1135, + 7, 1134, 52, 43, 42, 1132, 1131, 1128, 31, 1127, + 1126, 4, 1125, 1124, 1123, 16, 1122, 1121, 1120, 1115, + 48, 5, 1114, 1113, 1112, 1111, 1110, 2, 1109, 607, + 1108, 18, 202, 1100, 1099, 1098, 12, 1097, 1095, 6, + 19, 1093, 1092, 1091, 9, 50, 0, 1090, 1089, 1087, + 117, 1086, 1084, 642, 1083, 1082, 62, 8, 1076, 1075, + 1074, 1073, 14, 47, 1072, 1071, 1069, 1068, 1067, 1066, + 3, 1064, 23, 1063, 1062, 1060, 35, 1059, 1058, 1057, + 1056, 1055, 1054, 1052, 25, 1049, 1044, 1042, 24, 1038, + 15, 17, 1034, 34, 1033, 1031, 1029, 1028, 177, 13, + 1027, 1026, } var yyR1 = [...]int{ - 0, 149, 93, 93, 94, 94, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 95, 95, - 4, 4, 4, 4, 96, 96, 5, 5, 5, 5, - 97, 97, 6, 6, 6, 6, 53, 53, 98, 98, - 24, 24, 24, 24, 24, 25, 25, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 115, 115, 58, 58, 116, - 116, 117, 117, 59, 113, 113, 56, 51, 52, 147, - 147, 148, 148, 60, 61, 61, 64, 64, 64, 64, - 89, 89, 2, 91, 91, 90, 90, 124, 124, 88, - 88, 87, 87, 87, 85, 85, 84, 84, 57, 57, - 114, 114, 82, 82, 82, 82, 111, 111, 111, 150, - 150, 86, 86, 107, 107, 108, 108, 54, 54, 55, - 55, 118, 118, 119, 119, 63, 63, 62, 62, 62, - 62, 80, 80, 80, 125, 125, 68, 68, 68, 68, - 99, 99, 27, 27, 27, 100, 100, 100, 100, 120, - 120, 65, 65, 65, 65, 67, 126, 126, 81, 81, - 127, 127, 128, 128, 69, 69, 70, 129, 129, 73, - 73, 72, 71, 71, 74, 74, 83, 83, 121, 121, - 122, 122, 130, 130, 75, 75, 75, 75, 75, 75, - 123, 123, 123, 123, 66, 66, 112, 112, 110, 110, - 109, 109, 136, 136, 134, 134, 135, 135, 135, 137, - 137, 42, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 50, 50, 50, 50, - 47, 47, 47, 47, 46, 46, 1, 92, 92, 106, - 106, 106, 106, 23, 23, 23, 23, 23, 23, 23, - 23, 11, 11, 11, 11, 45, 45, 45, 43, 43, - 41, 41, 144, 144, 143, 49, 49, 49, 131, 131, - 131, 79, 79, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 8, 28, 77, 77, 77, - 77, 77, 77, 77, 77, 77, 77, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 35, 35, 35, 35, 29, 29, 29, 29, 29, 29, - 29, 132, 132, 151, 151, 133, 133, 133, 133, 14, - 14, 48, 48, 16, 17, 18, 19, 19, 145, 145, - 138, 140, 140, 76, 139, 139, 139, 40, 40, 44, - 44, 12, 22, 22, 20, 20, 20, 21, 21, 21, - 10, 10, 10, 9, 9, 13, 13, 141, 141, 142, - 142, 142, 39, 39, 146, 146, 105, 105, 38, 38, - 38, 104, 104, 103, 103, 103, 103, 103, 103, 103, - 103, 101, 101, 101, 101, 33, 33, 33, 33, 33, - 33, 34, 34, 34, 37, 37, 37, 37, 37, 37, - 37, 37, 102, 102, 36, 36, 30, 30, 31, 32, + 0, 151, 95, 95, 96, 96, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 97, 97, + 6, 6, 6, 6, 98, 98, 7, 7, 7, 7, + 99, 99, 8, 8, 8, 8, 55, 55, 100, 100, + 26, 26, 26, 26, 26, 27, 27, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 117, 117, 60, 60, 118, + 118, 119, 119, 61, 115, 115, 58, 53, 54, 149, + 149, 150, 150, 62, 63, 63, 66, 66, 66, 66, + 91, 91, 2, 93, 93, 92, 92, 126, 126, 90, + 90, 89, 89, 89, 87, 87, 86, 86, 59, 59, + 116, 116, 84, 84, 84, 84, 113, 113, 113, 4, + 4, 88, 88, 109, 109, 110, 110, 56, 56, 57, + 57, 120, 120, 121, 121, 65, 65, 64, 64, 64, + 64, 82, 82, 82, 127, 127, 70, 70, 70, 70, + 101, 101, 29, 29, 29, 102, 102, 102, 102, 122, + 122, 67, 67, 67, 67, 69, 128, 128, 83, 83, + 129, 129, 130, 130, 71, 71, 72, 131, 131, 75, + 75, 74, 73, 73, 76, 76, 85, 85, 123, 123, + 124, 124, 132, 132, 77, 77, 77, 77, 77, 77, + 125, 125, 125, 125, 68, 68, 114, 114, 112, 112, + 111, 111, 138, 138, 136, 136, 137, 137, 137, 139, + 139, 44, 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, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 52, 52, 52, 52, + 49, 49, 49, 49, 48, 48, 1, 94, 94, 108, + 108, 108, 108, 25, 25, 25, 25, 25, 25, 25, + 25, 13, 13, 13, 13, 47, 47, 47, 45, 45, + 43, 43, 146, 146, 145, 51, 51, 51, 133, 133, + 133, 81, 81, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 10, 30, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 37, 37, 37, 37, 31, 31, 31, 31, 31, 31, + 31, 134, 134, 3, 3, 135, 135, 135, 135, 16, + 16, 50, 50, 18, 19, 20, 21, 21, 147, 147, + 140, 142, 142, 78, 141, 141, 141, 42, 42, 46, + 46, 14, 24, 24, 22, 22, 22, 23, 23, 23, + 12, 12, 12, 11, 11, 15, 15, 143, 143, 144, + 144, 144, 41, 41, 148, 148, 107, 107, 40, 40, + 40, 106, 106, 105, 105, 105, 105, 105, 105, 105, + 105, 103, 103, 103, 103, 35, 35, 35, 35, 35, + 35, 35, 36, 36, 36, 39, 39, 39, 39, 39, + 39, 39, 39, 104, 104, 38, 38, 32, 32, 33, + 34, } var yyR2 = [...]int{ @@ -1734,115 +1733,116 @@ var yyR2 = [...]int{ 4, 4, 1, 1, 4, 0, 1, 1, 1, 4, 4, 1, 1, 3, 1, 2, 3, 1, 1, 4, 0, 0, 2, 5, 3, 3, 1, 6, 4, 4, - 2, 2, 2, 1, 2, 1, 4, 3, 3, 6, - 3, 1, 1, 1, 4, 4, 4, 2, 2, 4, - 2, 2, 1, 3, 1, 1, 3, 3, 3, 3, + 2, 2, 2, 1, 2, 1, 4, 3, 3, 3, + 6, 3, 1, 1, 1, 4, 4, 4, 2, 2, + 4, 2, 2, 1, 3, 1, 1, 3, 3, 3, + 3, } var yyChk = [...]int{ - -1000, -149, -93, -3, 2, -25, -51, -52, 51, 79, - 44, -53, -26, 10, -60, -61, 38, 142, 7, 21, - 20, 23, 30, 34, 35, 39, -50, 46, 98, 19, - 14, -14, 48, 25, 27, 144, 40, 43, 36, -1, - -64, -2, 97, -16, -15, 37, 52, 99, 53, 100, - 54, -19, 59, 92, -18, 104, 105, 153, 152, 154, - 155, -48, -42, 146, -37, 107, 108, 109, 110, 111, - 112, 113, 6, 156, -29, -47, -46, 141, 96, -20, - 91, 49, 50, 4, 5, 84, 85, 86, 11, -35, - -32, -7, 140, 74, 62, 18, 60, 148, -21, -22, - -23, -30, -94, 82, -11, 8, 9, 66, 67, 81, - 63, 64, 65, 80, -10, -146, -44, -12, -40, -9, - 157, 12, 146, -94, 142, 82, 10, -95, 37, 38, - -4, -94, 82, 144, 158, 145, 10, -98, -48, 146, - -48, -25, -1, 79, 146, -48, 144, -14, 97, 98, - 144, -14, 144, -15, -19, -14, 144, -99, -27, 12, - 157, -100, -1, 12, -112, -14, 144, 129, 130, 87, + -1000, -151, -95, -5, 2, -27, -53, -54, 51, 79, + 44, -55, -28, 10, -62, -63, 38, 142, 7, 21, + 20, 23, 30, 34, 35, 39, -52, 46, 98, 19, + 14, -16, 48, 25, 27, 144, 40, 43, 36, -1, + -66, -2, 97, -18, -17, 37, 52, 99, 53, 100, + 54, -21, 59, 92, -20, 104, 105, 153, 152, 154, + 155, -50, -44, 146, -39, 107, 108, 109, 110, 111, + 112, 113, 6, 156, -31, -49, -48, 141, 96, -22, + 91, 49, 50, 4, 5, 84, 85, 86, 11, -37, + -34, -9, 140, 74, 62, 18, 60, 148, -23, -24, + -25, -32, -96, 82, -13, 8, 9, 66, 67, 81, + 63, 64, 65, 80, -12, -148, -46, -14, -42, -11, + 157, 12, 146, -96, 142, 82, 10, -97, 37, 38, + -6, -96, 82, 144, 158, 145, 10, -100, -50, 146, + -50, -27, -1, 79, 146, -50, 144, -16, 97, 98, + 144, -16, 144, -17, -21, -16, 144, -101, -29, 12, + 157, -102, -1, 12, -114, -16, 144, 129, 130, 87, 89, 88, 159, 151, 161, 167, 153, 152, 162, 131, 163, 164, 132, 133, 134, 135, 136, 137, 165, 138, - 166, 139, 90, 150, 146, 146, 146, 142, -14, 10, - -147, 151, 10, 10, -15, -19, -14, 52, 52, 160, + 166, 139, 90, 150, 146, 146, 146, 142, -16, 10, + -149, 151, 10, 10, -17, -21, -16, 52, 52, 160, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 146, -14, 104, 105, -18, -19, -94, 79, - 82, -11, -12, 98, -18, -14, -14, -14, -14, -42, - -14, -50, -14, -14, -14, -14, -14, -14, -14, -49, - 146, -48, -14, 148, 148, -131, 17, -101, -33, 12, - 76, 77, -14, 57, -43, -11, -41, -94, 79, 82, - -21, -10, -146, -12, 146, 146, -14, -14, 146, -14, - -14, 148, -101, 17, 17, 75, -101, 148, 146, -104, - -103, -14, 151, 148, 148, 82, -80, 146, -94, 78, - 148, 142, -10, 157, 78, -80, 142, 147, 144, 142, - -93, -94, 144, 158, -96, -5, -94, 82, -97, -6, - -94, 82, 29, -94, 10, 160, -24, 143, 2, -25, - -51, -52, 51, -25, 145, -86, -25, 145, 21, -147, - -110, -109, -14, -82, 142, 145, 144, 144, 144, 144, - 144, 158, -16, 142, -19, 144, 158, -147, 160, 144, - 158, -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, -43, -14, 145, -113, - -56, -19, -19, -15, -114, 10, -98, 144, 144, 10, - 146, -89, 55, -91, 55, 58, -14, 151, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -105, -38, -19, 59, 82, -94, 78, 78, 147, 147, - 147, 147, -13, -14, -13, 141, -33, -33, 17, 148, - 57, -14, 11, -19, -141, -142, -40, -39, -10, -146, - 10, 142, -79, -80, 78, 82, -94, 57, -10, 78, - -102, -36, -19, -15, -19, -15, -14, -13, 140, 75, - 75, -13, -104, 149, -151, 158, 58, -17, -19, -13, - -13, 10, 147, -125, -50, -68, -15, -19, 151, 83, - -80, -39, -40, 10, 52, -13, -14, -39, -40, 10, - -14, 144, -93, 143, -80, -4, 144, 158, 29, -94, - 144, 158, 29, -94, 10, 29, 160, -28, -77, -7, - -31, -94, 79, 82, 60, 148, -8, 62, -78, 18, - 74, -11, 154, 155, 153, 152, 146, 146, -107, -98, - -98, -48, 144, 158, -111, 144, -111, 144, -27, -14, - 12, 146, -28, -14, 145, -14, 147, 158, 29, 29, - 147, 158, 160, 143, 146, -118, -119, -63, -62, 60, - 61, -45, -94, 79, 82, -90, 56, -45, 142, -124, - -45, -15, -19, -19, 91, 147, 158, 146, -94, -137, - -135, -134, -136, 148, -138, 57, 149, 149, -34, 10, - 13, 12, 10, 143, 148, 143, -139, -76, -140, -80, - 148, 142, -10, -14, -40, -94, -141, -40, 147, 158, - 147, 147, 147, 149, 149, 147, -14, 151, -14, 151, - 149, 149, 147, 158, 147, -17, -14, -80, -80, 149, - 143, -80, -80, 143, 143, -5, 10, 29, -6, 10, - 29, 10, -28, 148, 153, 152, 162, 131, 163, 164, - 159, 151, 161, 132, 133, 167, 88, 89, 87, 130, - 129, 134, 135, 136, 137, 165, 166, 138, 139, 150, - 82, -94, 146, -132, -133, -77, 17, 78, -77, -77, - -77, -77, -77, 147, -54, 93, 94, -108, 22, 144, - -110, -14, 143, 32, 33, -111, 31, -111, 143, 160, - -118, -14, 144, -56, -87, -19, 151, 59, -87, -57, - -25, 145, 10, -28, -115, 41, -118, 147, 158, -147, - 82, -94, 142, -124, -120, 158, -43, 160, -38, -105, - 148, -136, -138, -13, -141, 149, -14, -145, 148, 148, - -13, -14, 143, -144, -36, 58, -17, -17, -68, 10, - 10, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, 145, -77, -94, - -132, 149, -151, 158, 58, 10, 52, 147, 144, -48, - -25, -55, 93, 94, 144, 144, -14, -150, 145, 144, - 143, 144, 31, -28, 147, -88, 58, -19, 146, -88, - -98, 160, -58, 42, 146, 147, -92, 44, -63, -148, - 83, -94, -120, 143, -65, -121, -66, -67, -122, -130, - 47, 38, 44, -75, 103, 102, 101, 98, 99, 100, - -45, -79, -14, 147, -13, 149, -139, 149, -138, -13, - -13, 149, 143, -143, 57, -14, 151, 149, -77, 145, - 147, -77, -77, -25, 95, -48, 145, -110, -150, -98, - 144, -92, 147, -87, -105, 147, 28, -28, 142, -45, - 142, 142, 146, 12, 143, -123, 12, 144, 158, -1, - -75, 10, -126, -45, 149, 143, 149, 149, -141, -17, - -77, 58, 144, 145, -98, 147, -98, 142, -84, -25, - 145, 147, -84, 144, -98, 12, -98, -98, -106, 12, - 151, 160, 144, 158, 160, 10, -147, 160, -81, 158, - 144, 142, -77, -98, -85, -25, 145, -98, -98, 143, - 147, 143, 143, 147, 158, 12, -28, 12, -28, 160, - 10, -28, -45, -127, -128, -69, -70, -71, -72, -73, - -45, 10, -98, 143, 26, 142, 12, 151, 160, -28, - 146, 143, -69, 144, 144, 45, 29, 78, 24, 144, - -98, 12, -28, -118, -129, -45, -74, -75, 10, 144, - 143, 147, 158, 10, -116, -117, -59, 41, -83, 144, - 142, -45, -59, 146, -98, -45, 143, 12, 147, 142, - -98, 143, + 127, 128, 146, -16, 104, 105, -20, -21, -96, 79, + 82, -13, -14, 98, -20, -16, -16, -16, -16, -44, + -16, -52, -16, -16, -16, -16, -16, -16, -16, -51, + 146, -50, -16, 148, 148, -133, 17, -103, -35, 12, + 76, 77, -16, 57, -45, -13, -43, -96, 79, 82, + -23, -12, -148, -14, 146, 146, -16, -16, 146, -16, + -16, 148, -103, 17, 17, 75, -103, 148, 146, -106, + -105, -16, 151, 148, 148, 82, -82, 146, -96, 78, + 148, 142, -12, 157, 78, -82, 142, 147, 144, 142, + -95, -96, 144, 158, -98, -7, -96, 82, -99, -8, + -96, 82, 29, -96, 10, 160, -26, 143, 2, -27, + -53, -54, 51, -27, 145, -88, -27, 145, 21, -149, + -112, -111, -16, -84, 142, 145, 144, 144, 144, 144, + 144, 158, -18, 142, -21, 144, 158, -149, 160, 144, + 158, -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, -45, -16, 145, -115, + -58, -21, -21, -17, -116, 10, -100, 144, 144, 10, + 146, -91, 55, -93, 55, 58, -16, 151, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -107, -40, -21, 59, 82, -96, 78, 78, 147, 147, + 147, 147, -15, -16, -15, 141, -35, -35, 17, 148, + 57, -16, 11, -21, -143, -144, -42, -41, -12, -148, + 10, 142, -81, -82, 78, 82, -96, 57, -12, 78, + -104, -38, -21, -17, -21, -16, -16, -15, 140, 75, + 75, -15, -106, 149, -3, 158, 58, -19, -21, -15, + -15, 10, 147, -127, -52, -70, -17, -21, 151, 83, + -82, -41, -42, 10, 52, -15, -16, -41, -42, 10, + -16, 144, -95, 143, -82, -6, 144, 158, 29, -96, + 144, 158, 29, -96, 10, 29, 160, -30, -79, -9, + -33, -96, 79, 82, 60, 148, -10, 62, -80, 18, + 74, -13, 154, 155, 153, 152, 146, 146, -109, -100, + -100, -50, 144, 158, -113, 144, -113, 144, -29, -16, + 12, 146, -30, -16, 145, -16, 147, 158, 29, 29, + 147, 158, 160, 143, 146, -120, -121, -65, -64, 60, + 61, -47, -96, 79, 82, -92, 56, -47, 142, -126, + -47, -17, -21, -21, 91, 147, 158, 146, -96, -139, + -137, -136, -138, 148, -140, 57, 149, 149, -36, 10, + 13, 12, 10, 143, 143, 148, 143, -141, -78, -142, + -82, 148, 142, -12, -16, -42, -96, -143, -42, 147, + 158, 147, 147, 147, 149, 149, 147, -16, 151, -16, + 151, 149, 149, 147, 158, 147, -19, -16, -82, -82, + 149, 143, -82, -82, 143, 143, -7, 10, 29, -8, + 10, 29, 10, -30, 148, 153, 152, 162, 131, 163, + 164, 159, 151, 161, 132, 133, 167, 88, 89, 87, + 130, 129, 134, 135, 136, 137, 165, 166, 138, 139, + 150, 82, -96, 146, -134, -135, -79, 17, 78, -79, + -79, -79, -79, -79, 147, -56, 93, 94, -110, 22, + 144, -112, -16, 143, 32, 33, -113, 31, -113, 143, + 160, -120, -16, 144, -58, -89, -21, 151, 59, -89, + -59, -27, 145, 10, -30, -117, 41, -120, 147, 158, + -149, 82, -96, 142, -126, -122, 158, -45, 160, -40, + -107, 148, -138, -140, -15, -143, 149, -16, -147, 148, + 148, -15, -16, 143, -146, -38, 58, -19, -19, -70, + 10, 10, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, + -79, -79, -79, -79, -79, -79, -79, -79, 145, -79, + -96, -134, 149, -3, 158, 58, 10, 52, 147, 144, + -50, -27, -57, 93, 94, 144, 144, -16, -4, 145, + 144, 143, 144, 31, -30, 147, -90, 58, -21, 146, + -90, -100, 160, -60, 42, 146, 147, -94, 44, -65, + -150, 83, -96, -122, 143, -67, -123, -68, -69, -124, + -132, 47, 38, 44, -77, 103, 102, 101, 98, 99, + 100, -47, -81, -16, 147, -15, 149, -141, 149, -140, + -15, -15, 149, 143, -145, 57, -16, 151, 149, -79, + 145, 147, -79, -79, -27, 95, -50, 145, -112, -4, + -100, 144, -94, 147, -89, -107, 147, 28, -30, 142, + -47, 142, 142, 146, 12, 143, -125, 12, 144, 158, + -1, -77, 10, -128, -47, 149, 143, 149, 149, -143, + -19, -79, 58, 144, 145, -100, 147, -100, 142, -86, + -27, 145, 147, -86, 144, -100, 12, -100, -100, -108, + 12, 151, 160, 144, 158, 160, 10, -149, 160, -83, + 158, 144, 142, -79, -100, -87, -27, 145, -100, -100, + 143, 147, 143, 143, 147, 158, 12, -30, 12, -30, + 160, 10, -30, -47, -129, -130, -71, -72, -73, -74, + -75, -47, 10, -100, 143, 26, 142, 12, 151, 160, + -30, 146, 143, -71, 144, 144, 45, 29, 78, 24, + 144, -100, 12, -30, -120, -131, -47, -76, -77, 10, + 144, 143, 147, 158, 10, -118, -119, -61, 41, -85, + 144, 142, -47, -61, 146, -100, -47, 143, 12, 147, + 142, -100, 143, } var yyDef = [...]int{ @@ -1873,8 +1873,8 @@ var yyDef = [...]int{ 0, 0, 289, 290, 291, 292, 293, 294, 295, 296, 0, 347, 297, 465, 465, 0, 349, 350, 493, 495, 0, 0, 302, 0, 351, 338, 339, 332, 0, 0, - 341, -2, 0, 0, 0, 0, 507, 508, 0, 510, - 511, 465, 0, 0, 0, 364, 0, 465, 481, 0, + 341, -2, 0, 0, 0, 0, 508, 509, 0, 511, + 512, 465, 0, 0, 0, 364, 0, 465, 481, 0, 423, 486, 0, 465, 465, 0, 323, 0, -2, 0, 465, 0, -2, 475, 0, 330, 0, 0, 11, 3, 0, -2, 14, 0, 0, 25, 26, 0, 0, 31, @@ -1892,10 +1892,10 @@ var yyDef = [...]int{ 432, 346, 0, 466, 0, 301, 494, 491, 492, 0, 0, 0, 414, 0, 446, 467, 468, 471, 447, 0, 472, 0, 231, 352, 0, 0, 334, 0, 458, 0, - 0, 512, -2, -2, -2, 430, 0, 0, 418, 363, + 0, 513, -2, -2, -2, 0, 0, 0, 418, 363, 419, 0, 0, 315, 482, 424, 0, 490, 434, 0, 0, 5, 151, 0, 0, 154, -2, -2, 0, 0, - 325, 0, 449, -2, 519, 0, 0, 0, 450, -2, + 325, 0, 449, -2, 520, 0, 0, 0, 450, -2, 0, 10, 0, 13, 324, 18, 15, 0, 0, 28, 16, 0, 0, 34, 21, 0, 0, 37, 366, 367, 368, -2, 0, 0, 0, 421, 374, 375, 376, 355, @@ -1905,50 +1905,50 @@ var yyDef = [...]int{ 0, 0, 0, 75, -2, 0, 141, 143, 89, 148, 149, 150, 335, 0, 0, 0, 0, 101, 170, 104, 107, -2, -2, 234, 0, 0, 480, 480, 333, 285, - 230, 227, 228, 465, 223, 0, 311, 310, 0, 501, - 502, 503, 497, 498, 0, 500, 439, 444, 445, 443, - 465, 0, 448, 0, 449, 333, 343, 450, 504, 0, - 505, 506, 509, 313, 312, 314, 484, 0, 485, 0, - 452, 453, 152, 0, 153, 158, 159, 326, 327, 460, - 461, 328, 329, 464, 12, 24, 27, 0, 30, 33, - 0, 23, 36, 0, 0, 0, 0, 0, 0, 0, + 230, 227, 228, 465, 223, 0, 311, 310, 0, 502, + 503, 504, 497, 498, 499, 0, 501, 439, 444, 445, + 443, 465, 0, 448, 0, 449, 333, 343, 450, 505, + 0, 506, 507, 510, 313, 312, 314, 484, 0, 485, + 0, 452, 453, 152, 0, 153, 158, 159, 326, 327, + 460, 461, 328, 329, 464, 12, 24, 27, 0, 30, + 33, 0, 23, 36, 0, 0, 0, 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, 421, 0, 423, 428, 0, 0, 384, 385, - 407, 408, 0, 0, 48, 0, 0, 139, 0, 51, - 0, 220, 122, 0, 0, 0, 0, 0, 164, 0, - 0, 286, 67, 85, 109, 111, 0, 0, 109, 70, - 118, 39, 0, 120, 77, 0, 0, 317, 147, 91, - 0, 337, 170, 106, 200, 0, 351, 0, 476, 0, - 465, 226, 222, 0, 446, 496, 0, 436, 465, 465, - 0, 0, 473, 340, 513, 0, 488, 489, 155, 29, - 35, 0, 378, 379, 380, 381, 382, 383, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, -2, - -2, -2, -2, -2, -2, -2, -2, 0, 0, -2, - 0, 373, 422, 424, 0, 365, 518, 409, 44, 0, - 138, 0, 0, 0, 132, 218, 0, 39, 129, 130, - 123, 124, 0, 166, 317, 0, 0, 112, 480, 0, - 0, 0, 72, 0, 0, 0, 0, 0, 144, 0, - 92, 336, 200, 95, 169, 0, 0, 173, 0, -2, - 199, 0, 0, 202, 204, 205, 206, 207, 208, 209, - 108, 235, 232, 479, 0, 225, 440, 0, 438, 0, - 0, 469, 470, 342, 0, 483, 0, 377, 405, 0, - 372, 426, 427, 134, 0, 0, 39, 0, 39, -2, - 125, 0, 0, 110, 0, 0, 0, 121, 39, 0, - 39, 39, 0, 145, 94, 0, 212, 172, 0, 89, - 203, 0, 0, 176, 224, 499, 442, 441, 344, 487, - 406, 0, 49, 39, -2, 0, -2, 39, 68, 116, - 39, 113, 69, 119, 0, 0, 0, 0, 0, 321, - 0, 0, 171, 0, 0, 0, 0, 0, 175, 0, - 178, 180, 425, -2, 52, 114, 39, 0, 0, 78, - 0, 93, 304, 318, 0, 322, 146, 210, 213, 0, - 0, 215, 177, 0, 181, 182, 0, 0, 190, 0, - 0, -2, 0, 305, 0, 39, 319, 0, 0, 214, - -2, 179, 183, 184, 185, 0, 194, 0, 0, 117, - 0, 320, 211, 0, 186, 187, 0, -2, 191, 115, - 80, 0, 0, 192, 76, 79, 81, 0, 174, 196, - 39, 188, 82, 0, 0, 0, 197, 0, 0, 39, - 0, 83, + 0, 0, -2, 421, 0, 423, 428, 0, 0, 384, + 385, 407, 408, 0, 0, 48, 0, 0, 139, 0, + 51, 0, 220, 122, 0, 0, 0, 0, 0, 164, + 0, 0, 286, 67, 85, 109, 111, 0, 0, 109, + 70, 118, 39, 0, 120, 77, 0, 0, 317, 147, + 91, 0, 337, 170, 106, 200, 0, 351, 0, 476, + 0, 465, 226, 222, 0, 446, 496, 0, 436, 465, + 465, 0, 0, 473, 340, 514, 0, 488, 489, 155, + 29, 35, 0, 378, 379, 380, 381, 382, 383, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, + -2, -2, -2, -2, -2, -2, -2, -2, 0, 0, + -2, 0, 373, 422, 424, 0, 365, 519, 409, 44, + 0, 138, 0, 0, 0, 132, 218, 0, 39, 129, + 130, 123, 124, 0, 166, 317, 0, 0, 112, 480, + 0, 0, 0, 72, 0, 0, 0, 0, 0, 144, + 0, 92, 336, 200, 95, 169, 0, 0, 173, 0, + -2, 199, 0, 0, 202, 204, 205, 206, 207, 208, + 209, 108, 235, 232, 479, 0, 225, 440, 0, 438, + 0, 0, 469, 470, 342, 0, 483, 0, 377, 405, + 0, 372, 426, 427, 134, 0, 0, 39, 0, 39, + -2, 125, 0, 0, 110, 0, 0, 0, 121, 39, + 0, 39, 39, 0, 145, 94, 0, 212, 172, 0, + 89, 203, 0, 0, 176, 224, 500, 442, 441, 344, + 487, 406, 0, 49, 39, -2, 0, -2, 39, 68, + 116, 39, 113, 69, 119, 0, 0, 0, 0, 0, + 321, 0, 0, 171, 0, 0, 0, 0, 0, 175, + 0, 178, 180, 425, -2, 52, 114, 39, 0, 0, + 78, 0, 93, 304, 318, 0, 322, 146, 210, 213, + 0, 0, 215, 177, 0, 181, 182, 0, 0, 190, + 0, 0, -2, 0, 305, 0, 39, 319, 0, 0, + 214, -2, 179, 183, 184, 185, 0, 194, 0, 0, + 117, 0, 320, 211, 0, 186, 187, 0, -2, 191, + 115, 80, 0, 0, 192, 76, 79, 81, 0, 174, + 196, 39, 188, 82, 0, 0, 0, 197, 0, 0, + 39, 0, 83, } var yyTok1 = [...]int{ @@ -2326,14 +2326,14 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:278 + //line php5/php5.y:281 { yylex.(*Parser).rootNode = node.NewRoot(yyDollar[1].list) yylex.(*Parser).positions.AddPosition(yylex.(*Parser).rootNode, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) } case 2: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:286 + //line php5/php5.y:289 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2341,368 +2341,446 @@ yydefault: } case 3: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:291 + //line php5/php5.y:294 { yyVAL.list = []node.Node{} } case 4: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:296 + //line php5/php5.y:299 { namePart := name.NewNamePart(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.list = []node.Node{namePart} - yylex.(*Parser).comments.AddComments(namePart, yyDollar[1].token.Comments()) + + // save position + yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(namePart, yyDollar[1].token, comment.StringToken) } case 5: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:303 + //line php5/php5.y:310 { namePart := name.NewNamePart(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.list = append(yyDollar[1].list, namePart) - yylex.(*Parser).comments.AddComments(namePart, yyDollar[3].token.Comments()) + + // save position + yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken(namePart, yyDollar[3].token, comment.StringToken) } case 6: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:313 + //line php5/php5.y:325 { // error yyVAL.node = nil } case 7: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:318 + //line php5/php5.y:330 { yyVAL.node = yyDollar[1].node } case 8: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:320 + //line php5/php5.y:332 { yyVAL.node = yyDollar[1].node } case 9: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:322 + //line php5/php5.y:334 { yyVAL.node = yyDollar[1].node } case 10: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:324 + //line php5/php5.y:336 { yyVAL.node = stmt.NewHaltCompiler() + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.HaltCompilerToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 11: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:330 + //line php5/php5.y:349 { name := name.NewName(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yyVAL.node = stmt.NewNamespace(name, nil) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 12: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:340 + //line php5/php5.y:362 { name := name.NewName(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yyVAL.node = stmt.NewNamespace(name, yyDollar[4].list) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CloseCurlyBracesToken) } case 13: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:350 + //line php5/php5.y:376 { yyVAL.node = stmt.NewNamespace(nil, yyDollar[3].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) } case 14: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:356 + //line php5/php5.y:388 { yyVAL.node = stmt.NewUseList(nil, yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 15: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:362 + //line php5/php5.y:399 { useType := node.NewIdentifier(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yyVAL.node = stmt.NewUseList(useType, yyDollar[3].list) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) + yylex.(*Parser).comments.AddFromToken(useType, yyDollar[2].token, comment.UseToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 16: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:372 + //line php5/php5.y:413 { useType := node.NewIdentifier(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) - yyVAL.node = stmt.NewUseList(useType, yyDollar[3].list) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) + yylex.(*Parser).comments.AddFromToken(useType, yyDollar[2].token, comment.UseToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 17: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:382 + //line php5/php5.y:427 { yyVAL.node = yyDollar[1].node + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) } case 18: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:387 + //line php5/php5.y:440 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:389 + //line php5/php5.y:447 { yyVAL.list = []node.Node{yyDollar[1].node} } case 20: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:394 + //line php5/php5.y:452 { name := name.NewName(yyDollar[1].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yyVAL.node = stmt.NewUse(nil, name, nil) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) } case 21: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:404 + //line php5/php5.y:461 { name := name.NewName(yyDollar[1].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) alias := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.node = stmt.NewUse(nil, name, alias) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(alias, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(alias, yyDollar[3].token, comment.StringToken) } case 22: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:417 + //line php5/php5.y:476 { name := name.NewName(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yyVAL.node = stmt.NewUse(nil, name, nil) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) } case 23: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:427 + //line php5/php5.y:488 { name := name.NewName(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) alias := node.NewIdentifier(yyDollar[4].token.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yyVAL.node = stmt.NewUse(nil, name, alias) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) - yylex.(*Parser).comments.AddComments(alias, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.StringToken) } case 24: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:443 + //line php5/php5.y:507 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 25: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:445 + //line php5/php5.y:514 { yyVAL.list = []node.Node{yyDollar[1].node} } case 26: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:450 + //line php5/php5.y:519 { name := name.NewName(yyDollar[1].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yyVAL.node = stmt.NewUse(nil, name, nil) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) } case 27: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:460 + //line php5/php5.y:528 { name := name.NewName(yyDollar[1].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) alias := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.node = stmt.NewUse(nil, name, alias) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(alias, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(alias, yyDollar[3].token, comment.StringToken) } case 28: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:473 + //line php5/php5.y:543 { name := name.NewName(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yyVAL.node = stmt.NewUse(nil, name, nil) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) } case 29: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:483 + //line php5/php5.y:555 { name := name.NewName(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) alias := node.NewIdentifier(yyDollar[4].token.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yyVAL.node = stmt.NewUse(nil, name, alias) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) - yylex.(*Parser).comments.AddComments(alias, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.StringToken) } case 30: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:499 + //line php5/php5.y:574 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 31: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:501 + //line php5/php5.y:581 { yyVAL.list = []node.Node{yyDollar[1].node} } case 32: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:506 + //line php5/php5.y:586 { name := name.NewName(yyDollar[1].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yyVAL.node = stmt.NewUse(nil, name, nil) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) } case 33: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:516 + //line php5/php5.y:595 { name := name.NewName(yyDollar[1].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) alias := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.node = stmt.NewUse(nil, name, alias) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(alias, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(alias, yyDollar[3].token, comment.StringToken) } case 34: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:529 + //line php5/php5.y:610 { name := name.NewName(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yyVAL.node = stmt.NewUse(nil, name, nil) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) } case 35: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:539 + //line php5/php5.y:622 { name := name.NewName(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) alias := node.NewIdentifier(yyDollar[4].token.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yyVAL.node = stmt.NewUse(nil, name, alias) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[2].list, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) - yylex.(*Parser).comments.AddComments(alias, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[2].list)) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.StringToken) } case 36: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:555 + //line php5/php5.y:641 { name := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[3].token.Comments()) - constant := stmt.NewConstant(name, yyDollar[5].node, "") - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) - yylex.(*Parser).comments.AddComments(constant, yyDollar[3].token.Comments()) - constList := yyDollar[1].node.(*stmt.ConstList) constList.Consts = append(constList.Consts, constant) - yyVAL.node = yyDollar[1].node + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, constList.Consts)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(constList.Consts), yyDollar[2].token, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(name, yyDollar[3].token, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(constant, yyDollar[4].token, comment.EqualToken) } case 37: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:571 + //line php5/php5.y:659 { name := node.NewIdentifier(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[2].token.Comments()) - constant := stmt.NewConstant(name, yyDollar[4].node, "") - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(constant, yyDollar[2].token.Comments()) - constList := []node.Node{constant} - yyVAL.node = stmt.NewConstList(constList) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, constList)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ConstToken) + yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(constant, yyDollar[3].token, comment.EqualToken) } case 38: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:590 + //line php5/php5.y:679 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2710,75 +2788,91 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:596 + //line php5/php5.y:685 { yyVAL.list = []node.Node{} } case 40: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:602 + //line php5/php5.y:691 { // error yyVAL.node = nil } case 41: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:607 + //line php5/php5.y:696 { yyVAL.node = yyDollar[1].node } case 42: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:609 + //line php5/php5.y:698 { yyVAL.node = yyDollar[1].node } case 43: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:611 + //line php5/php5.y:700 { yyVAL.node = yyDollar[1].node } case 44: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:613 + //line php5/php5.y:702 { yyVAL.node = stmt.NewHaltCompiler() + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.HaltCompilerToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 45: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:623 + //line php5/php5.y:719 { yyVAL.node = yyDollar[1].node } case 46: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:625 + //line php5/php5.y:721 { label := node.NewIdentifier(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = stmt.NewLabel(label) + + // save position + yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(label, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(label, yyDollar[1].token, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ColonToken) } case 47: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:638 + //line php5/php5.y:737 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) } case 48: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:644 + //line php5/php5.y:748 { yyVAL.node = stmt.NewIf(yyDollar[2].node, yyDollar[3].node, yyDollar[4].list, yyDollar[5].node) + // save position if yyDollar[5].node != nil { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) } else if len(yyDollar[4].list) > 0 { @@ -2787,22 +2881,29 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) } - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IfToken) } case 49: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:658 + //line php5/php5.y:764 { stmts := stmt.NewStmtList(yyDollar[4].list) - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) - yyVAL.node = stmt.NewAltIf(yyDollar[2].node, stmts, yyDollar[5].list, yyDollar[6].node) + + // save position + yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[4].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IfToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.EndifToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.SemiColonToken) } case 50: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:667 + //line php5/php5.y:779 { switch n := yyDollar[3].node.(type) { case *stmt.While: @@ -2813,20 +2914,29 @@ yydefault: yyVAL.node = yyDollar[3].node + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.WhileToken) } case 51: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:681 + //line php5/php5.y:796 { yyVAL.node = stmt.NewDo(yyDollar[2].node, yyDollar[4].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.WhileToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.SemiColonToken) } case 52: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:687 + //line php5/php5.y:808 { switch n := yyDollar[9].node.(type) { case *stmt.For: @@ -2841,12 +2951,19 @@ yydefault: yyVAL.node = yyDollar[9].node + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.ForInitSemicolonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.ForCondSemicolonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseParenthesisToken) } case 53: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:705 + //line php5/php5.y:833 { switch n := yyDollar[3].node.(type) { case *stmt.Switch: @@ -2859,124 +2976,196 @@ yydefault: yyVAL.node = yyDollar[3].node + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SwitchToken) } case 54: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:721 + //line php5/php5.y:852 { yyVAL.node = stmt.NewBreak(nil) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BreakToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) } case 55: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:727 + //line php5/php5.y:863 { yyVAL.node = stmt.NewBreak(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BreakToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 56: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:733 + //line php5/php5.y:874 { yyVAL.node = stmt.NewContinue(nil) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ContinueToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) } case 57: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:739 + //line php5/php5.y:885 { yyVAL.node = stmt.NewContinue(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ContinueToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 58: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:745 + //line php5/php5.y:896 { yyVAL.node = stmt.NewReturn(nil) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ReturnToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) } case 59: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:751 + //line php5/php5.y:907 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ReturnToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 60: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:757 + //line php5/php5.y:918 { yyVAL.node = stmt.NewReturn(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ReturnToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 61: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:763 + //line php5/php5.y:929 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) } case 62: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:769 + //line php5/php5.y:939 { yyVAL.node = stmt.NewGlobal(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.GlobalToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 63: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:775 + //line php5/php5.y:950 { yyVAL.node = stmt.NewStatic(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 64: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:781 + //line php5/php5.y:961 { yyVAL.node = stmt.NewEcho(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EchoToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 65: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:787 + //line php5/php5.y:972 { yyVAL.node = stmt.NewInlineHtml(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.InlineHTMLToken) } case 66: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:793 + //line php5/php5.y:982 { yyVAL.node = stmt.NewExpression(yyDollar[1].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) } case 67: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:799 + //line php5/php5.y:992 { yyVAL.node = stmt.NewUnset(yyDollar[3].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UnsetToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.SemiColonToken) } case 68: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:805 + //line php5/php5.y:1005 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3002,12 +3191,18 @@ yydefault: yyVAL.node = yyDollar[8].node + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForeachToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseParenthesisToken) } case 69: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:834 + //line php5/php5.y:1040 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3031,213 +3226,269 @@ yydefault: } } + // save position yyVAL.node = yyDollar[8].node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ForeachToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseParenthesisToken) } case 70: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:863 + //line php5/php5.y:1075 { yyVAL.node = stmt.NewDeclare(yyDollar[3].list, yyDollar[5].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DeclareToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) } case 71: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:869 + //line php5/php5.y:1087 { yyVAL.node = stmt.NewNop() + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) } case 72: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:875 + //line php5/php5.y:1097 { yyVAL.node = stmt.NewTry(yyDollar[3].list, yyDollar[5].list, yyDollar[6].node) + // save position if yyDollar[6].node == nil { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[5].list)) } else { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) } - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TryToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) } case 73: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:887 + //line php5/php5.y:1113 { yyVAL.node = stmt.NewThrow(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ThrowToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 74: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:893 + //line php5/php5.y:1124 { label := node.NewIdentifier(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yyVAL.node = stmt.NewGoto(label) + + // save position + yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(label, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.GotoToken) + yylex.(*Parser).comments.AddFromToken(label, yyDollar[2].token, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 75: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:906 + //line php5/php5.y:1141 { yyVAL.list = []node.Node{} } case 76: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:908 + //line php5/php5.y:1143 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[4].token.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(variable, yyDollar[4].token.Comments()) - catch := stmt.NewCatch([]node.Node{yyDollar[3].node}, variable, yyDollar[7].list) - yylex.(*Parser).positions.AddPosition(catch, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) - yylex.(*Parser).comments.AddComments(catch, yyDollar[1].token.Comments()) - yyVAL.list = append([]node.Node{catch}, yyDollar[9].list...) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(catch, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(catch, yyDollar[1].token, comment.CatchToken) + yylex.(*Parser).comments.AddFromToken(catch, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[4].token, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(catch, yyDollar[5].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(catch, yyDollar[6].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(catch, yyDollar[8].token, comment.CloseCurlyBracesToken) } case 77: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:926 + //line php5/php5.y:1165 { yyVAL.node = nil } case 78: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:928 + //line php5/php5.y:1167 { yyVAL.node = stmt.NewFinally(yyDollar[3].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FinallyToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) } case 79: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:937 + //line php5/php5.y:1182 { yyVAL.list = yyDollar[1].list } case 80: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:939 + //line php5/php5.y:1184 { yyVAL.list = []node.Node{} } case 81: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:944 + //line php5/php5.y:1189 { yyVAL.list = []node.Node{yyDollar[1].node} } case 82: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:946 + //line php5/php5.y:1191 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 83: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:951 + //line php5/php5.y:1196 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[4].token.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(variable, yyDollar[4].token.Comments()) - yyVAL.node = stmt.NewCatch([]node.Node{yyDollar[3].node}, variable, yyDollar[7].list) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[8].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.CatchToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[4].token, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.CloseCurlyBracesToken) } case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:968 + //line php5/php5.y:1218 { yyVAL.list = []node.Node{yyDollar[1].node} } case 85: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:970 + //line php5/php5.y:1220 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:975 + //line php5/php5.y:1230 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:980 + //line php5/php5.y:1235 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:985 + //line php5/php5.y:1240 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:990 + //line php5/php5.y:1245 { yyVAL.token = nil } case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:992 + //line php5/php5.y:1247 { yyVAL.token = yyDollar[1].token } case 91: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:997 + //line php5/php5.y:1252 { yyVAL.token = nil } case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:999 + //line php5/php5.y:1254 { yyVAL.token = yyDollar[1].token } case 93: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:1004 + //line php5/php5.y:1259 { name := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[3].token.Comments()) - yyVAL.node = stmt.NewFunction(name, yyDollar[2].token != nil, yyDollar[5].list, nil, yyDollar[8].list, "") + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FunctionToken) + if yyDollar[2].token != nil { + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) + } + yylex.(*Parser).comments.AddFromToken(name, yyDollar[3].token, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[9].token, comment.CloseCurlyBracesToken) } case 94: yyDollar = yyS[yypt-7 : yypt+1] - //line php5/php5.y:1017 + //line php5/php5.y:1282 { + name := node.NewIdentifier(yyDollar[2].token.Value) switch n := yyDollar[1].node.(type) { case *stmt.Class: - name := node.NewIdentifier(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) n.ClassName = name n.Stmts = yyDollar[6].list n.Extends = yyDollar[3].ClassExtends @@ -3245,515 +3496,683 @@ yydefault: case *stmt.Trait: // TODO: is it possible that trait extend or implement - name := node.NewIdentifier(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) n.TraitName = name n.Stmts = yyDollar[6].list } - yyVAL.node = yyDollar[1].node + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseCurlyBracesToken) } case 95: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1038 + //line php5/php5.y:1307 { name := node.NewIdentifier(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[2].token.Comments()) - yyVAL.node = stmt.NewInterface(name, yyDollar[3].InterfaceExtends, yyDollar[5].list, "") + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseCurlyBracesToken) } case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1052 + //line php5/php5.y:1325 { yyVAL.node = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassToken) } case 97: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1058 + //line php5/php5.y:1335 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(classModifier, yyDollar[1].token.Comments()) - yyVAL.node = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") + + // save position + yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(classModifier, yyDollar[1].token, comment.AbstractToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ClassToken) } case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1068 + //line php5/php5.y:1348 { yyVAL.node = stmt.NewTrait(nil, nil, "") + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TraitToken) } case 99: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1074 + //line php5/php5.y:1358 { classModifier := node.NewIdentifier(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(classModifier, yyDollar[1].token.Comments()) - yyVAL.node = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") + + // save position + yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(classModifier, yyDollar[1].token, comment.FinalToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ClassToken) } case 100: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1087 + //line php5/php5.y:1374 { yyVAL.ClassExtends = nil } case 101: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1089 + //line php5/php5.y:1376 { yyVAL.ClassExtends = stmt.NewClassExtends(yyDollar[2].node) // save position yylex.(*Parser).positions.AddPosition(yyVAL.ClassExtends, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.ClassExtends, yyDollar[1].token, comment.ExtendsToken) } case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1099 + //line php5/php5.y:1389 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1104 + //line php5/php5.y:1394 { yyVAL.InterfaceExtends = nil } case 104: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1106 + //line php5/php5.y:1396 { yyVAL.InterfaceExtends = stmt.NewInterfaceExtends(yyDollar[2].list) // save position yylex.(*Parser).positions.AddPosition(yyVAL.InterfaceExtends, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.InterfaceExtends, yyDollar[1].token, comment.ExtendsToken) } case 105: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1116 + //line php5/php5.y:1409 { yyVAL.ClassImplements = nil } case 106: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1118 + //line php5/php5.y:1411 { yyVAL.ClassImplements = stmt.NewClassImplements(yyDollar[2].list) // save position yylex.(*Parser).positions.AddPosition(yyVAL.ClassImplements, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.ClassImplements, yyDollar[1].token, comment.ImplementsToken) } case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1128 + //line php5/php5.y:1424 { yyVAL.list = []node.Node{yyDollar[1].node} } case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1130 + //line php5/php5.y:1426 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 109: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1135 + //line php5/php5.y:1436 { yyVAL.node = nil } case 110: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1137 + //line php5/php5.y:1438 { yyVAL.node = yyDollar[2].node + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoubleArrowToken) } case 111: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1142 + //line php5/php5.y:1448 { yyVAL.node = yyDollar[1].node } case 112: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1144 + //line php5/php5.y:1450 { yyVAL.node = expr.NewReference(yyDollar[2].node) + + // save position + yylex.(*Parser).positions.AddPosition(yyDollar[2].node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AmpersandToken) } case 113: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1146 + //line php5/php5.y:1460 { - list := expr.NewList(yyDollar[3].list) - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yyVAL.node = list - yylex.(*Parser).comments.AddComments(list, yyDollar[1].token.Comments()) + yyVAL.node = expr.NewList(yyDollar[3].list) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ListToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) } case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1156 + //line php5/php5.y:1475 { yyVAL.node = stmt.NewFor(nil, nil, nil, yyDollar[1].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 115: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1161 + //line php5/php5.y:1482 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltFor(nil, nil, nil, stmtList) + // save position yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EndforToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1173 + //line php5/php5.y:1499 { yyVAL.node = stmt.NewForeach(nil, nil, nil, yyDollar[1].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 117: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1178 + //line php5/php5.y:1506 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltForeach(nil, nil, nil, stmtList) + // save position yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EndforeachToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1190 + //line php5/php5.y:1524 { yyVAL.node = yyDollar[1].node } case 119: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1192 + //line php5/php5.y:1526 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EnddeclareToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1202 + //line php5/php5.y:1542 { name := node.NewIdentifier(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) - constant := stmt.NewConstant(name, yyDollar[3].node, "") - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(constant, yyDollar[1].token.Comments()) - yyVAL.list = []node.Node{constant} + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(constant, yyDollar[2].token, comment.EqualToken) } case 121: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1214 + //line php5/php5.y:1556 { name := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[3].token.Comments()) - constant := stmt.NewConstant(name, yyDollar[5].node, "") - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) - yylex.(*Parser).comments.AddComments(constant, yyDollar[3].token.Comments()) - yyVAL.list = append(yyDollar[1].list, constant) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(name, yyDollar[3].token, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(constant, yyDollar[4].token, comment.EqualToken) } case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1230 + //line php5/php5.y:1575 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewSwitch(nil, caseList) + // save position yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[3].token, comment.CloseCurlyBracesToken) } case 123: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1238 + //line php5/php5.y:1588 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewSwitch(nil, caseList) + // save position yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[2].token, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[4].token, comment.CloseCurlyBracesToken) } case 124: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1246 + //line php5/php5.y:1602 { caseList := stmt.NewCaseList(yyDollar[2].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) + // save position yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[3].token, comment.EndswitchToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 125: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1254 + //line php5/php5.y:1616 { caseList := stmt.NewCaseList(yyDollar[3].list) yyVAL.node = stmt.NewAltSwitch(nil, caseList) + // save position yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[1].token, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[2].token, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken(caseList, yyDollar[4].token, comment.EndswitchToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.SemiColonToken) } case 126: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1267 + //line php5/php5.y:1636 { yyVAL.list = []node.Node{} } case 127: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1269 + //line php5/php5.y:1638 { _case := stmt.NewCase(yyDollar[3].node, yyDollar[5].list) - yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) yyVAL.list = append(yyDollar[1].list, _case) - yylex.(*Parser).comments.AddComments(_case, yyDollar[2].token.Comments()) + + // save position + yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) + + // save comments + yylex.(*Parser).comments.AddFromToken(_case, yyDollar[2].token, comment.CaseToken) + yylex.(*Parser).comments.AddFromToken(_case, yyDollar[4].token, comment.CaseSeparatorToken) } case 128: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1276 + //line php5/php5.y:1650 { _default := stmt.NewDefault(yyDollar[4].list) - yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) yyVAL.list = append(yyDollar[1].list, _default) - yylex.(*Parser).comments.AddComments(_default, yyDollar[2].token.Comments()) + + // save position + yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list)) + + // save comments + yylex.(*Parser).comments.AddFromToken(_default, yyDollar[2].token, comment.DefaultToken) + yylex.(*Parser).comments.AddFromToken(_default, yyDollar[3].token, comment.CaseSeparatorToken) + } + case 129: + yyDollar = yyS[yypt-1 : yypt+1] + //line php5/php5.y:1666 + { + yyVAL.token = yyDollar[1].token + } + case 130: + yyDollar = yyS[yypt-1 : yypt+1] + //line php5/php5.y:1668 + { + yyVAL.token = yyDollar[1].token } case 131: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1293 + //line php5/php5.y:1674 { yyVAL.node = stmt.NewWhile(nil, yyDollar[1].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1298 + //line php5/php5.y:1681 { stmtList := stmt.NewStmtList(yyDollar[2].list) yyVAL.node = stmt.NewAltWhile(nil, stmtList) + // save position yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[2].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EndwhileToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.SemiColonToken) } case 133: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1311 + //line php5/php5.y:1700 { yyVAL.list = nil } case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1313 + //line php5/php5.y:1702 { _elseIf := stmt.NewElseIf(yyDollar[3].node, yyDollar[4].node) - yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(_elseIf, yyDollar[2].token.Comments()) - yyVAL.list = append(yyDollar[1].list, _elseIf) + + // save position + yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[2].token, comment.ElseifToken) } case 135: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1325 + //line php5/php5.y:1717 { yyVAL.list = nil } case 136: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1327 + //line php5/php5.y:1719 { stmts := stmt.NewStmtList(yyDollar[5].list) - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[5].list)) - _elseIf := stmt.NewAltElseIf(yyDollar[3].node, stmts) - yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) - yylex.(*Parser).comments.AddComments(_elseIf, yyDollar[2].token.Comments()) - yyVAL.list = append(yyDollar[1].list, _elseIf) + + // save position + yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[5].list)) + yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list)) + + // save comments + yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[2].token, comment.ElseifToken) + yylex.(*Parser).comments.AddFromToken(_elseIf, yyDollar[4].token, comment.ColonToken) } case 137: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1342 + //line php5/php5.y:1737 { yyVAL.node = nil } case 138: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1344 + //line php5/php5.y:1739 { yyVAL.node = stmt.NewElse(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ElseToken) } case 139: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1354 + //line php5/php5.y:1753 { yyVAL.node = nil } case 140: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1356 + //line php5/php5.y:1755 { stmts := stmt.NewStmtList(yyDollar[3].list) - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) - yyVAL.node = stmt.NewAltElse(stmts) + + // save position + yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[3].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ElseToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ColonToken) } case 141: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1369 + //line php5/php5.y:1772 { yyVAL.list = yyDollar[1].list } case 142: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1371 + //line php5/php5.y:1774 { yyVAL.list = nil } case 143: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1376 + //line php5/php5.y:1779 { yyVAL.list = []node.Node{yyDollar[1].node} } case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1378 + //line php5/php5.y:1781 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 145: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1383 + //line php5/php5.y:1791 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].token != nil, yyDollar[3].token != nil) + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) if yyDollar[1].node != nil { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } else if yyDollar[2].token != nil { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[2].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } else if yyDollar[3].token != nil { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[3].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } else { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } + + // save comments + if yyDollar[2].token != nil { + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) + } + if yyDollar[3].token != nil { + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EllipsisToken) + } + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[4].token, comment.VariableToken) } case 146: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:1409 + //line php5/php5.y:1819 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[4].token.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(variable, yyDollar[4].token.Comments()) - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].token != nil, yyDollar[3].token != nil) + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) if yyDollar[1].node != nil { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[6].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } else if yyDollar[2].token != nil { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[6].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[2].token.Comments()) } else if yyDollar[3].token != nil { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[6].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[3].token.Comments()) } else { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[6].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[4].token.Comments()) } + + // save comments + if yyDollar[2].token != nil { + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) + } + if yyDollar[3].token != nil { + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.EllipsisToken) + } + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[4].token, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.EqualToken) } case 147: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1439 + //line php5/php5.y:1852 { yyVAL.node = nil } case 148: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1441 + //line php5/php5.y:1854 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayToken) } case 149: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1447 + //line php5/php5.y:1864 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.CallableToken) } case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1453 + //line php5/php5.y:1874 { yyVAL.node = yyDollar[1].node } case 151: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1459 + //line php5/php5.y:1880 { yyVAL.node = node.NewArgumentList(nil) // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CloseParenthesisToken) } case 152: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1466 + //line php5/php5.y:1891 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) } case 153: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1473 + //line php5/php5.y:1902 { arg := node.NewArgument(yyDollar[2].node, false, false) yyVAL.node = node.NewArgumentList([]node.Node{arg}) @@ -3761,220 +4180,264 @@ yydefault: // save position yylex.(*Parser).positions.AddPosition(arg, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) } case 154: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1486 + //line php5/php5.y:1919 { yyVAL.list = []node.Node{yyDollar[1].node} } case 155: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1488 + //line php5/php5.y:1921 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 156: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1493 + //line php5/php5.y:1931 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 157: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1499 + //line php5/php5.y:1938 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 158: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1505 + //line php5/php5.y:1945 { yyVAL.node = node.NewArgument(yyDollar[2].node, false, true) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AmpersandToken) } case 159: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1511 + //line php5/php5.y:1955 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EllipsisToken) } case 160: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1520 + //line php5/php5.y:1968 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 161: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1522 + //line php5/php5.y:1975 { yyVAL.list = []node.Node{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1528 + //line php5/php5.y:1981 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = expr.NewVariable(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) } case 163: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1538 + //line php5/php5.y:1993 { yyVAL.node = expr.NewVariable(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarToken) } case 164: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1544 + //line php5/php5.y:2003 { yyVAL.node = expr.NewVariable(yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) } case 165: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1554 + //line php5/php5.y:2019 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - staticVar := stmt.NewStaticVar(variable, nil) - yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yyVAL.list = append(yyDollar[1].list, staticVar) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(variable, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(staticVar, yyDollar[3].token.Comments()) + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[3].token, comment.VariableToken) } case 166: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1571 + //line php5/php5.y:2035 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - staticVar := stmt.NewStaticVar(variable, yyDollar[5].node) - yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) - yyVAL.list = append(yyDollar[1].list, staticVar) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(variable, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(staticVar, yyDollar[3].token.Comments()) + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[3].token, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(staticVar, yyDollar[4].token, comment.EqualToken) } case 167: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1588 + //line php5/php5.y:2052 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - staticVar := stmt.NewStaticVar(variable, nil) - yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yyVAL.list = []node.Node{staticVar} - yylex.(*Parser).comments.AddComments(identifier, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(staticVar, yyDollar[1].token.Comments()) + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) } case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1605 + //line php5/php5.y:2067 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - staticVar := stmt.NewStaticVar(variable, yyDollar[3].node) - yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) - yyVAL.list = []node.Node{staticVar} - yylex.(*Parser).comments.AddComments(identifier, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(staticVar, yyDollar[1].token.Comments()) + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(staticVar, yyDollar[2].token, comment.EqualToken) } case 169: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1627 + //line php5/php5.y:2087 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 170: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1629 + //line php5/php5.y:2089 { yyVAL.list = []node.Node{} } case 171: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1635 + //line php5/php5.y:2095 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.SemiColonToken) } case 172: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1641 + //line php5/php5.y:2105 { yyVAL.node = yyDollar[1].node + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) } case 173: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1643 + //line php5/php5.y:2115 { yyVAL.node = yyDollar[1].node } case 174: yyDollar = yyS[yypt-8 : yypt+1] - //line php5/php5.y:1645 + //line php5/php5.y:2119 { name := node.NewIdentifier(yyDollar[4].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[4].token.Comments()) - yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[6].list, nil, yyDollar[8].node, "") + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) if yyDollar[1].list == nil { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[8].node)) } else { yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListNodePosition(yyDollar[1].list, yyDollar[8].node)) } - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.FunctionToken) + if yyDollar[3].token != nil { + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AmpersandToken) + } + yylex.(*Parser).comments.AddFromToken(name, yyDollar[4].token, comment.IdentifierToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.CloseParenthesisToken) } case 175: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1664 + //line php5/php5.y:2144 { var adaptationList *stmt.TraitAdaptationList switch n := yyDollar[3].node.(type) { @@ -3983,465 +4446,561 @@ yydefault: default: adaptationList = nil } - yyVAL.node = stmt.NewTraitUse(yyDollar[2].list, adaptationList) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UseToken) } case 176: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1681 + //line php5/php5.y:2164 { yyVAL.list = []node.Node{yyDollar[1].node} } case 177: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1683 + //line php5/php5.y:2166 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 178: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1688 + //line php5/php5.y:2176 { yyVAL.node = stmt.NewNop() yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) + } case 179: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1694 + //line php5/php5.y:2186 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) } case 180: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1703 + //line php5/php5.y:2199 { yyVAL.list = nil } case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1705 + //line php5/php5.y:2201 { yyVAL.list = yyDollar[1].list } case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1710 + //line php5/php5.y:2206 { yyVAL.list = []node.Node{yyDollar[1].node} } case 183: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1712 + //line php5/php5.y:2208 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 184: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1717 + //line php5/php5.y:2213 { yyVAL.node = yyDollar[1].node + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) } case 185: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1719 + //line php5/php5.y:2220 { yyVAL.node = yyDollar[1].node + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SemiColonToken) } case 186: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1724 + //line php5/php5.y:2230 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition(yyDollar[1].node, yyDollar[3].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.InsteadofToken) } case 187: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1733 + //line php5/php5.y:2243 { yyVAL.list = []node.Node{yyDollar[1].node} } case 188: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1735 + //line php5/php5.y:2245 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1740 + //line php5/php5.y:2255 { name := node.NewIdentifier(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) - yyVAL.node = stmt.NewTraitMethodRef(nil, name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.IdentifierToken) } case 190: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1750 + //line php5/php5.y:2267 { yyVAL.node = yyDollar[1].node } case 191: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1755 + //line php5/php5.y:2272 { target := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(target, yyDollar[3].token.Comments()) - yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) + + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yylex.(*Parser).comments.AddFromToken(target, yyDollar[3].token, comment.IdentifierToken) } case 192: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1768 + //line php5/php5.y:2288 { alias := node.NewIdentifier(yyDollar[4].token.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) + + // save position + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(alias, yyDollar[4].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(alias, yyDollar[4].token, comment.IdentifierToken) } case 193: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1778 + //line php5/php5.y:2301 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsToken) } case 194: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1787 + //line php5/php5.y:2314 { yyVAL.node = nil } case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1789 + //line php5/php5.y:2316 { yyVAL.node = yyDollar[1].node } case 196: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1794 + //line php5/php5.y:2321 { yyVAL.node = stmt.NewNop() + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.SemiColonToken) } case 197: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1800 + //line php5/php5.y:2331 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) } case 198: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1809 + //line php5/php5.y:2345 { yyVAL.list = yyDollar[1].list } case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1811 + //line php5/php5.y:2347 { modifier := node.NewIdentifier(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(modifier, yyDollar[1].token.Comments()) - yyVAL.list = []node.Node{modifier} + + // save position + yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(modifier, yyDollar[1].token, comment.VarToken) } case 200: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1822 + //line php5/php5.y:2361 { yyVAL.list = nil } case 201: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1824 + //line php5/php5.y:2363 { yyVAL.list = yyDollar[1].list } case 202: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1829 + //line php5/php5.y:2368 { yyVAL.list = []node.Node{yyDollar[1].node} } case 203: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1831 + //line php5/php5.y:2370 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 204: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1836 + //line php5/php5.y:2375 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PublicToken) } case 205: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1842 + //line php5/php5.y:2385 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ProtectedToken) } case 206: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1848 + //line php5/php5.y:2395 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PrivateToken) } case 207: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1854 + //line php5/php5.y:2405 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) } case 208: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1860 + //line php5/php5.y:2415 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AbstractToken) } case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1866 + //line php5/php5.y:2425 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FinalToken) } case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1875 + //line php5/php5.y:2438 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[3].token.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(variable, yyDollar[3].token.Comments()) - property := stmt.NewProperty(variable, nil, "") - yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(property, yyDollar[3].token.Comments()) - yyVAL.list = append(yyDollar[1].list, property) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[3].token, comment.VariableToken) } case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1891 + //line php5/php5.y:2454 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[3].token.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(variable, yyDollar[3].token.Comments()) - property := stmt.NewProperty(variable, yyDollar[5].node, "") - yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) - yylex.(*Parser).comments.AddComments(property, yyDollar[3].token.Comments()) - yyVAL.list = append(yyDollar[1].list, property) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[3].token, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(property, yyDollar[4].token, comment.EqualToken) } case 212: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1907 + //line php5/php5.y:2471 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[1].token.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - property := stmt.NewProperty(variable, nil, "") - yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(property, yyDollar[1].token.Comments()) - yyVAL.list = []node.Node{property} + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) } case 213: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1923 + //line php5/php5.y:2486 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[1].token.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - property := stmt.NewProperty(variable, yyDollar[3].node, "") - yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(property, yyDollar[1].token.Comments()) - yyVAL.list = []node.Node{property} + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(property, yyDollar[2].token, comment.EqualToken) } case 214: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:1942 + //line php5/php5.y:2505 { name := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[3].token.Comments()) - constant := stmt.NewConstant(name, yyDollar[5].node, "") - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) - yylex.(*Parser).comments.AddComments(constant, yyDollar[3].token.Comments()) + constList := yyDollar[1].node.(*stmt.ClassConstList) + constList.Consts = append(constList.Consts, constant) + yyVAL.node = yyDollar[1].node - yyDollar[1].node.(*stmt.ClassConstList).Consts = append(yyDollar[1].node.(*stmt.ClassConstList).Consts, constant) + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node)) yylex.(*Parser).positions.AddPosition(yyDollar[1].node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) - yyVAL.node = yyDollar[1].node + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(constList.Consts), yyDollar[2].token, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(name, yyDollar[3].token, comment.IdentifierToken) + yylex.(*Parser).comments.AddFromToken(constant, yyDollar[4].token, comment.EqualToken) } case 215: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:1957 + //line php5/php5.y:2523 { name := node.NewIdentifier(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[2].token.Comments()) - constant := stmt.NewConstant(name, yyDollar[4].node, "") - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(constant, yyDollar[2].token.Comments()) - yyVAL.node = stmt.NewClassConstList(nil, []node.Node{constant}) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[2].token, yyDollar[4].node)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ConstToken) + yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.IdentifierToken) + yylex.(*Parser).comments.AddFromToken(constant, yyDollar[3].token, comment.EqualToken) } case 216: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1974 + //line php5/php5.y:2542 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 217: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1976 + //line php5/php5.y:2549 { yyVAL.list = []node.Node{yyDollar[1].node} } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:1982 + //line php5/php5.y:2555 { yyVAL.list = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1984 + //line php5/php5.y:2557 { yyVAL.list = yyDollar[1].list } case 220: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:1989 + //line php5/php5.y:2562 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1991 + //line php5/php5.y:2569 { yyVAL.list = []node.Node{yyDollar[1].node} } case 222: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:1996 + //line php5/php5.y:2574 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:1998 + //line php5/php5.y:2576 { yyVAL.list = yyDollar[1].list } case 224: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2003 + //line php5/php5.y:2581 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) + yyVAL.list = append(yyDollar[1].list, fetch) + + // save position yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) - yyVAL.list = append(yyDollar[1].list, fetch) + // save comments + yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[4].token, comment.CloseSquareBracket) } case 225: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2010 + //line php5/php5.y:2593 { fetch := expr.NewArrayDimFetch(nil, yyDollar[2].node) + yyVAL.list = []node.Node{fetch} + + // save position yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[2].node)) - yyVAL.list = []node.Node{fetch} + // save comments + yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[1].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[3].token, comment.CloseSquareBracket) } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2020 + //line php5/php5.y:2608 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 227: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2022 + //line php5/php5.y:2610 { yyVAL.list = yyDollar[1].list } case 228: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2024 + //line php5/php5.y:2612 { yyVAL.list = yyDollar[1].list } case 229: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2029 + //line php5/php5.y:2617 { yyVAL.list = nil } case 230: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2031 + //line php5/php5.y:2619 { yyVAL.list = yyDollar[1].list } case 231: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2036 + //line php5/php5.y:2624 { if yyDollar[3].node != nil { @@ -4452,446 +5011,656 @@ yydefault: yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) } - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NewToken) } case 232: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:2052 + //line php5/php5.y:2641 { list := expr.NewList(yyDollar[3].list) - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) + + // save position + yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)) - yylex.(*Parser).comments.AddComments(list, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(list, yyDollar[1].token, comment.ListToken) + yylex.(*Parser).comments.AddFromToken(list, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(list, yyDollar[4].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.EqualToken) } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2062 + //line php5/php5.y:2656 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) } case 234: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2068 + //line php5/php5.y:2666 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AmpersandToken) } case 235: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:2074 + //line php5/php5.y:2677 { var _new *expr.New if yyDollar[6].node != nil { _new = expr.NewNew(yyDollar[5].node, yyDollar[6].node.(*node.ArgumentList)) - yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[6].node)) } else { _new = expr.NewNew(yyDollar[5].node, nil) + } + yyVAL.node = assign.NewReference(yyDollar[1].node, _new) + + // save position + if yyDollar[6].node != nil { + yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[6].node)) + } else { yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[4].token, yyDollar[5].node)) } - yylex.(*Parser).comments.AddComments(_new, yylex.(*Parser).comments[yyDollar[1].node]) - - yyVAL.node = assign.NewReference(yyDollar[1].node, _new) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, _new)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.EqualToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AmpersandToken) + yylex.(*Parser).comments.AddFromToken(_new, yyDollar[4].token, comment.NewToken) } case 236: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2091 + //line php5/php5.y:2701 { yyVAL.node = expr.NewClone(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.CloneToken) } case 237: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2097 + //line php5/php5.y:2711 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PlusEqualToken) } case 238: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2103 + //line php5/php5.y:2721 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MinusEqualToken) } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2109 + //line php5/php5.y:2731 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MulEqualToken) } case 240: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2115 + //line php5/php5.y:2741 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PowEqualToken) } case 241: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2121 + //line php5/php5.y:2751 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DivEqualToken) } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2127 + //line php5/php5.y:2761 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ConcatEqualToken) } case 243: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2133 + //line php5/php5.y:2771 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ModEqualToken) } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2139 + //line php5/php5.y:2781 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AndEqualToken) } case 245: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2145 + //line php5/php5.y:2791 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OrEqualToken) } case 246: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2151 + //line php5/php5.y:2801 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.XorEqualToken) } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2157 + //line php5/php5.y:2811 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlEqualToken) } case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2163 + //line php5/php5.y:2821 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SrEqualToken) } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2169 + //line php5/php5.y:2831 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IncToken) } case 250: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2175 + //line php5/php5.y:2841 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncToken) } case 251: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2181 + //line php5/php5.y:2851 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DecToken) } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2187 + //line php5/php5.y:2861 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DecToken) } case 253: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2193 + //line php5/php5.y:2871 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanOrToken) } case 254: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2199 + //line php5/php5.y:2881 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanAndToken) } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2205 + //line php5/php5.y:2891 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalOrToken) } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2211 + //line php5/php5.y:2901 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalAndToken) } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2217 + //line php5/php5.y:2911 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalXorToken) } case 258: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2223 + //line php5/php5.y:2921 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.VerticalBarToken) } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2229 + //line php5/php5.y:2931 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) } case 260: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2235 + //line php5/php5.y:2941 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CaretToken) } case 261: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2241 + //line php5/php5.y:2951 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DotToken) } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2247 + //line php5/php5.y:2961 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PlusToken) } case 263: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2253 + //line php5/php5.y:2971 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MinusToken) } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2259 + //line php5/php5.y:2981 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsteriskToken) } case 265: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2265 + //line php5/php5.y:2991 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PowToken) } case 266: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2271 + //line php5/php5.y:3001 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlashToken) } case 267: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2277 + //line php5/php5.y:3011 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PercentToken) } case 268: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2283 + //line php5/php5.y:3021 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlToken) } case 269: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2289 + //line php5/php5.y:3031 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SrToken) } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2295 + //line php5/php5.y:3041 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PlusToken) } case 271: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2301 + //line php5/php5.y:3051 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MinusToken) } case 272: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2307 + //line php5/php5.y:3061 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ExclamationMarkToken) } case 273: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2313 + //line php5/php5.y:3071 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TildeToken) } case 274: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2319 + //line php5/php5.y:3081 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsIdenticalToken) } case 275: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2325 + //line php5/php5.y:3091 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotIdenticalToken) } case 276: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2331 + //line php5/php5.y:3101 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsEqualToken) } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2337 + //line php5/php5.y:3111 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotEqualToken) } case 278: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2343 + //line php5/php5.y:3121 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LessToken) } case 279: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2349 + //line php5/php5.y:3131 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsSmallerOrEqualToken) } case 280: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2355 + //line php5/php5.y:3141 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.GreaterToken) } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2361 + //line php5/php5.y:3151 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsGreaterOrEqualToken) } case 282: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2367 + //line php5/php5.y:3161 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.InstanceofToken) } case 283: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2373 + //line php5/php5.y:3171 { yyVAL.node = yyDollar[1].node } case 284: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2375 + //line php5/php5.y:3173 { yyVAL.node = yyDollar[1].node } case 285: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2377 + //line php5/php5.y:3175 { yyVAL.node = yyDollar[2].node @@ -4899,281 +5668,423 @@ yydefault: switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = yyVAL.node - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) - yylex.(*Parser).comments.AddComments(nn, yyDollar[1].token.Comments()) yyVAL.node = nn case *expr.PropertyFetch: nn.Variable = yyVAL.node - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) - yylex.(*Parser).comments.AddComments(nn, yyDollar[1].token.Comments()) yyVAL.node = nn case *expr.MethodCall: nn.Variable = yyVAL.node - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) - yylex.(*Parser).comments.AddComments(nn, yyDollar[1].token.Comments()) yyVAL.node = nn } + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, n)) } + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) } case 286: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:2403 + //line php5/php5.y:3202 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.ColonToken) } case 287: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2409 + //line php5/php5.y:3213 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.ColonToken) } case 288: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2415 + //line php5/php5.y:3224 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2417 + //line php5/php5.y:3226 { yyVAL.node = cast.NewInt(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IntCastToken) } case 290: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2423 + //line php5/php5.y:3236 { yyVAL.node = cast.NewDouble(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoubleCastToken) } case 291: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2429 + //line php5/php5.y:3246 { yyVAL.node = cast.NewString(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringCastToken) } case 292: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2435 + //line php5/php5.y:3256 { yyVAL.node = cast.NewArray(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayCastToken) } case 293: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2441 + //line php5/php5.y:3266 { yyVAL.node = cast.NewObject(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ObjectCastToken) } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2447 + //line php5/php5.y:3276 { yyVAL.node = cast.NewBool(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BoolCastToken) } case 295: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2453 + //line php5/php5.y:3286 { yyVAL.node = cast.NewUnset(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.UnsetCastToken) } case 296: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2459 + //line php5/php5.y:3296 { if strings.EqualFold(yyDollar[1].token.Value, "die") { - yyVAL.node = expr.NewDie(yyDollar[2].node) + yyVAL.node = expr.NewDie(nil) + if yyDollar[2].node != nil { + yyVAL.node.(*expr.Die).Expr = yyDollar[2].node.(*expr.Exit).Expr + } } else { - yyVAL.node = expr.NewExit(yyDollar[2].node) + yyVAL.node = expr.NewExit(nil) + if yyDollar[2].node != nil { + yyVAL.node.(*expr.Exit).Expr = yyDollar[2].node.(*expr.Exit).Expr + } + } + + // save position + if yyDollar[2].node == nil { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + } else { + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + } + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ExitToken) + + if yyDollar[2].node != nil { + yylex.(*Parser).comments.AddFromChildNode(yyVAL.node, yyDollar[2].node) } - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) } case 297: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2469 + //line php5/php5.y:3324 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.AtToken) } case 298: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2475 + //line php5/php5.y:3334 { yyVAL.node = yyDollar[1].node } case 299: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2477 + //line php5/php5.y:3336 { yyVAL.node = yyDollar[1].node } case 300: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2479 + //line php5/php5.y:3338 { yyVAL.node = yyDollar[1].node } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2481 + //line php5/php5.y:3340 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.BackquoteToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.BackquoteToken) } case 302: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2487 + //line php5/php5.y:3351 { yyVAL.node = expr.NewPrint(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PrintToken) } case 303: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2493 + //line php5/php5.y:3361 { yyVAL.node = expr.NewYield(nil, nil) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) } case 304: yyDollar = yyS[yypt-9 : yypt+1] - //line php5/php5.y:2499 + //line php5/php5.y:3371 { yyVAL.node = expr.NewClosure(yyDollar[4].list, yyDollar[6].ClosureUse, nil, yyDollar[8].list, false, yyDollar[2].token != nil, "") + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[9].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FunctionToken) + if yyDollar[2].token != nil { + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) + } + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[7].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[9].token, comment.CloseCurlyBracesToken) } case 305: yyDollar = yyS[yypt-10 : yypt+1] - //line php5/php5.y:2506 + //line php5/php5.y:3388 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, nil, yyDollar[9].list, true, yyDollar[3].token != nil, "") + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[10].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.FunctionToken) + if yyDollar[3].token != nil { + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.AmpersandToken) + } + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[8].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[10].token, comment.CloseCurlyBracesToken) } case 306: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2516 + //line php5/php5.y:3409 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) } case 307: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2522 + //line php5/php5.y:3419 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) } case 308: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2528 + //line php5/php5.y:3429 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.DoubleArrowToken) } case 309: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2534 + //line php5/php5.y:3440 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.YieldToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.DoubleArrowToken) } case 310: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2543 + //line php5/php5.y:3454 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) } case 311: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2549 + //line php5/php5.y:3465 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) } case 312: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2555 + //line php5/php5.y:3476 { str := scalar.NewString(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(str, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(str, yyDollar[1].token.Comments()) - yyVAL.node = expr.NewArrayDimFetch(str, yyDollar[3].node) + + // save position + yylex.(*Parser).positions.AddPosition(str, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[str]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) } case 313: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2565 + //line php5/php5.y:3489 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) } case 314: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2574 + //line php5/php5.y:3503 { yyVAL.node = expr.NewArray(yyDollar[3].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) } case 315: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2580 + //line php5/php5.y:3515 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseSquareBracket) } case 316: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2589 + //line php5/php5.y:3529 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2594 + //line php5/php5.y:3534 { yyVAL.ClosureUse = nil } case 318: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2596 + //line php5/php5.y:3536 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -5181,226 +6092,279 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2605 + //line php5/php5.y:3545 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[3].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[3].token.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(variable, yyDollar[3].token.Comments()) - yyVAL.list = append(yyDollar[1].list, variable) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[3].token, comment.VariableToken) } case 320: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2617 + //line php5/php5.y:3559 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[4].token.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(variable, yyDollar[3].token.Comments()) - reference := expr.NewReference(variable) - yyVAL.list = append(yyDollar[1].list, reference) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(reference, yyDollar[3].token, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[4].token, comment.VariableToken) } case 321: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2631 + //line php5/php5.y:3575 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[1].token.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - yyVAL.list = []node.Node{variable} + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) } case 322: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2643 + //line php5/php5.y:3588 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[2].token.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - reference := expr.NewReference(variable) - yyVAL.list = []node.Node{reference} + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(reference, yyDollar[1].token, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[2].token, comment.VariableToken) } case 323: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2660 + //line php5/php5.y:3607 { name := name.NewName(yyDollar[1].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) - yyVAL.node = expr.NewFunctionCall(name, yyDollar[2].node.(*node.ArgumentList)) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(name, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[name]) } case 324: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2670 + //line php5/php5.y:3616 { funcName := name.NewRelative(yyDollar[3].list) - yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) - yylex.(*Parser).comments.AddComments(funcName, yyDollar[1].token.Comments()) - yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[4].node.(*node.ArgumentList)) + + // save position + yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[funcName]) + + // save comments + yylex.(*Parser).comments.AddFromToken(funcName, yyDollar[1].token, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken(funcName, yyDollar[2].token, comment.NsSeparatorToken) } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2680 + //line php5/php5.y:3629 { funcName := name.NewFullyQualified(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) - yylex.(*Parser).comments.AddComments(funcName, yyDollar[1].token.Comments()) - yyVAL.node = expr.NewFunctionCall(funcName, yyDollar[3].node.(*node.ArgumentList)) + + // save position + yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[funcName]) + + // save comments + yylex.(*Parser).comments.AddFromToken(funcName, yyDollar[1].token, comment.NsSeparatorToken) } case 326: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2690 + //line php5/php5.y:3641 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) } case 327: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2696 + //line php5/php5.y:3651 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) } case 328: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2702 + //line php5/php5.y:3661 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) } case 329: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2708 + //line php5/php5.y:3671 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) } case 330: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2714 + //line php5/php5.y:3681 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 331: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2723 + //line php5/php5.y:3691 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StaticToken) } case 332: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2729 + //line php5/php5.y:3701 { yyVAL.node = name.NewName(yyDollar[1].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) } case 333: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2735 + //line php5/php5.y:3708 { yyVAL.node = name.NewRelative(yyDollar[3].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NsSeparatorToken) } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2741 + //line php5/php5.y:3719 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) } case 335: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2750 + //line php5/php5.y:3732 { yyVAL.node = name.NewName(yyDollar[1].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) } case 336: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2756 + //line php5/php5.y:3739 { yyVAL.node = name.NewRelative(yyDollar[3].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NsSeparatorToken) } case 337: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2762 + //line php5/php5.y:3750 { yyVAL.node = name.NewFullyQualified(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) } case 338: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2771 + //line php5/php5.y:3763 { yyVAL.node = yyDollar[1].node } case 339: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2773 + //line php5/php5.y:3765 { yyVAL.node = yyDollar[1].node } case 340: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2778 + //line php5/php5.y:3770 { yyVAL.node = yyDollar[1].node + // save comments + yylex.(*Parser).comments.AddFromToken(yyDollar[3].list[0], yyDollar[2].token, comment.ObjectOperatorToken) + for _, n := range yyDollar[3].list { switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = yyVAL.node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[yyDollar[1].node]) yyVAL.node = nn case *expr.PropertyFetch: nn.Variable = yyVAL.node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[yyDollar[1].node]) yyVAL.node = nn } } @@ -5410,746 +6374,1003 @@ yydefault: case *expr.ArrayDimFetch: nn.Variable = yyVAL.node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[yyDollar[1].node]) yyVAL.node = nn case *expr.PropertyFetch: nn.Variable = yyVAL.node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[yyDollar[1].node]) yyVAL.node = nn } } } case 341: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2814 + //line php5/php5.y:3805 { yyVAL.node = yyDollar[1].node } case 342: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2820 + //line php5/php5.y:3811 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 343: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2822 + //line php5/php5.y:3813 { yyVAL.list = []node.Node{} } case 344: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2828 + //line php5/php5.y:3819 { yyVAL.list = yyDollar[2].list + + // save comments + yylex.(*Parser).comments.AddFromToken(yyDollar[2].list[0], yyDollar[1].token, comment.ObjectOperatorToken) } case 345: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2833 + //line php5/php5.y:3829 { yyVAL.node = nil } case 346: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2835 + //line php5/php5.y:3831 { - yyVAL.node = nil + yyVAL.node = expr.NewExit(nil) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CloseParenthesisToken) } case 347: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2837 + //line php5/php5.y:3842 { - yyVAL.node = yyDollar[1].node + yyVAL.node = expr.NewExit(yyDollar[1].node) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 348: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2842 + //line php5/php5.y:3852 { yyVAL.list = []node.Node{} } case 349: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2844 + //line php5/php5.y:3854 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 350: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2846 + //line php5/php5.y:3856 { yyVAL.list = yyDollar[1].list } case 351: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:2851 + //line php5/php5.y:3861 { yyVAL.node = nil } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2853 + //line php5/php5.y:3863 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2858 + //line php5/php5.y:3868 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.LnumberToken) } case 354: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2864 + //line php5/php5.y:3878 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DnumberToken) } case 355: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2870 + //line php5/php5.y:3888 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ConstantEncapsedStringToken) } case 356: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2876 + //line php5/php5.y:3898 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.LineToken) } case 357: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2882 + //line php5/php5.y:3908 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FileToken) } case 358: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2888 + //line php5/php5.y:3918 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DirToken) } case 359: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2894 + //line php5/php5.y:3928 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TraitCToken) } case 360: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2900 + //line php5/php5.y:3938 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MethodCToken) } case 361: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2906 + //line php5/php5.y:3948 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.FuncCToken) } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2912 + //line php5/php5.y:3958 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsCToken) } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2918 + //line php5/php5.y:3968 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(encapsed, yyDollar[2].token.Comments()) - yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) + + // save position + yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2928 + //line php5/php5.y:3980 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) } case 365: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2937 + //line php5/php5.y:3993 { target := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) + + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(target, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + yylex.(*Parser).comments.AddFromToken(target, yyDollar[3].token, comment.IdentifierToken) } case 366: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2950 + //line php5/php5.y:4009 { yyVAL.node = yyDollar[1].node } case 367: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2955 + //line php5/php5.y:4014 { yyVAL.node = yyDollar[1].node } case 368: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2957 + //line php5/php5.y:4016 { yyVAL.node = yyDollar[1].node } case 369: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:2959 + //line php5/php5.y:4018 { name := name.NewName(yyDollar[1].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) - yyVAL.node = expr.NewConstFetch(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(name)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[name]) } case 370: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2969 + //line php5/php5.y:4027 { name := name.NewRelative(yyDollar[3].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) - yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) - yyVAL.node = expr.NewConstFetch(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[name]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NsSeparatorToken) } case 371: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:2979 + //line php5/php5.y:4040 { name := name.NewFullyQualified(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) - yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) - yyVAL.node = expr.NewConstFetch(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[name]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) } case 372: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:2989 + //line php5/php5.y:4052 { yyVAL.node = expr.NewArray(yyDollar[3].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ArrayToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) } case 373: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:2995 + //line php5/php5.y:4064 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseSquareBracket) } case 374: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3001 + //line php5/php5.y:4075 { yyVAL.node = yyDollar[1].node } case 375: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3003 + //line php5/php5.y:4077 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassCToken) } case 376: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3009 + //line php5/php5.y:4087 { yyVAL.node = yyDollar[1].node } case 377: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3014 + //line php5/php5.y:4092 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) } case 378: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3020 + //line php5/php5.y:4103 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PlusToken) } case 379: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3026 + //line php5/php5.y:4113 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.MinusToken) } case 380: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3032 + //line php5/php5.y:4123 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AsteriskToken) } case 381: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3038 + //line php5/php5.y:4133 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PowToken) } case 382: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3044 + //line php5/php5.y:4143 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlashToken) } case 383: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3050 + //line php5/php5.y:4153 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PercentToken) } case 384: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3056 + //line php5/php5.y:4163 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ExclamationMarkToken) } case 385: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3062 + //line php5/php5.y:4173 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.TildeToken) } case 386: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3068 + //line php5/php5.y:4183 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.VerticalBarToken) } case 387: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3074 + //line php5/php5.y:4193 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.AmpersandToken) } case 388: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3080 + //line php5/php5.y:4203 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CaretToken) } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3086 + //line php5/php5.y:4213 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SlToken) } case 390: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3092 + //line php5/php5.y:4223 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.SrToken) } case 391: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3098 + //line php5/php5.y:4233 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.DotToken) } case 392: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3104 + //line php5/php5.y:4243 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalXorToken) } case 393: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3110 + //line php5/php5.y:4253 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalAndToken) } case 394: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3116 + //line php5/php5.y:4263 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LogicalOrToken) } case 395: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3122 + //line php5/php5.y:4273 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanAndToken) } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3128 + //line php5/php5.y:4283 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.BooleanOrToken) } case 397: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3134 + //line php5/php5.y:4293 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsIdenticalToken) } case 398: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3140 + //line php5/php5.y:4303 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotIdenticalToken) } case 399: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3146 + //line php5/php5.y:4313 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsEqualToken) } case 400: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3152 + //line php5/php5.y:4323 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsNotEqualToken) } case 401: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3158 + //line php5/php5.y:4333 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.LessToken) } case 402: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3164 + //line php5/php5.y:4343 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.GreaterToken) } case 403: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3170 + //line php5/php5.y:4353 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsSmallerOrEqualToken) } case 404: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3176 + //line php5/php5.y:4363 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.IsGreaterOrEqualToken) } case 405: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3182 + //line php5/php5.y:4373 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.ColonToken) } case 406: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3188 + //line php5/php5.y:4384 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[5].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.QuestionMarkToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.ColonToken) } case 407: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3194 + //line php5/php5.y:4395 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.PlusToken) } case 408: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3200 + //line php5/php5.y:4405 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.MinusToken) } case 409: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3206 + //line php5/php5.y:4415 { yyVAL.node = yyDollar[2].node + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseParenthesisToken) } case 410: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3211 + //line php5/php5.y:4426 { yyVAL.node = yyDollar[1].node } case 411: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3213 + //line php5/php5.y:4428 { name := name.NewName(yyDollar[1].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments(yyDollar[1].list)) - yyVAL.node = expr.NewConstFetch(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition(yyDollar[1].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(name)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[name]) } case 412: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3223 + //line php5/php5.y:4437 { name := name.NewRelative(yyDollar[3].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) - yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) - yyVAL.node = expr.NewConstFetch(name) + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(name)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[name]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.NsSeparatorToken) } case 413: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3233 + //line php5/php5.y:4448 { name := name.NewFullyQualified(yyDollar[2].list) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) - yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) - yyVAL.node = expr.NewConstFetch(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(name)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[name]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NsSeparatorToken) } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3246 + //line php5/php5.y:4463 { name := node.NewIdentifier(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = expr.NewVariable(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(name, yyDollar[1].token, comment.StringVarnameToken) } case 415: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3256 + //line php5/php5.y:4475 { yyVAL.node = yyDollar[1].node } case 416: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3258 + //line php5/php5.y:4477 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3260 + //line php5/php5.y:4479 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3262 + //line php5/php5.y:4481 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DoubleQuoteToken) } case 419: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3268 + //line php5/php5.y:4491 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StartHeredocToken) } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3274 + //line php5/php5.y:4501 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.ClassCToken) } case 421: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3283 + //line php5/php5.y:4514 { yyVAL.list = nil } case 422: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3285 + //line php5/php5.y:4516 { yyVAL.list = yyDollar[1].list + + // save comments + if yyDollar[2].token != nil { + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + } + } + case 423: + yyDollar = yyS[yypt-0 : yypt+1] + //line php5/php5.y:4528 + { + yyVAL.token = nil + } + case 424: + yyDollar = yyS[yypt-1 : yypt+1] + //line php5/php5.y:4530 + { + yyVAL.token = yyDollar[1].token } case 425: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3295 + //line php5/php5.y:4535 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[3].node]) - yyVAL.list = append(yyDollar[1].list, arrayItem) + + // save position + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(arrayItem, yyDollar[4].token, comment.DoubleArrowToken) } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3303 + //line php5/php5.y:4547 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[3].node]) - yyVAL.list = append(yyDollar[1].list, arrayItem) + + // save position + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 427: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3311 + //line php5/php5.y:4558 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[1].node]) - yyVAL.list = []node.Node{arrayItem} + + // save position + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(arrayItem, yyDollar[2].token, comment.DoubleArrowToken) } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3319 + //line php5/php5.y:4569 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[1].node]) - yyVAL.list = []node.Node{arrayItem} + + // save position + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 429: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3330 + //line php5/php5.y:4580 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3332 + //line php5/php5.y:4582 { yyVAL.node = yyDollar[1].node } case 431: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3337 + //line php5/php5.y:4587 { yyVAL.node = yyDollar[2].node } case 432: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3339 + //line php5/php5.y:4589 { yyVAL.node = yyDollar[2].node } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3345 + //line php5/php5.y:4595 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3351 + //line php5/php5.y:4601 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3356 + //line php5/php5.y:4606 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3361 + //line php5/php5.y:4611 { yyVAL.node = yyDollar[1].node @@ -6158,24 +7379,24 @@ yydefault: yyDollar[3].list = append(yyDollar[3].list[:len(yyDollar[3].list)-1], yyDollar[4].list...) } + // save comments + yylex.(*Parser).comments.AddFromToken(yyDollar[3].list[0], yyDollar[2].token, comment.ObjectOperatorToken) + for _, n := range yyDollar[3].list { switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = yyVAL.node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[yyDollar[1].node]) yyVAL.node = nn case *expr.PropertyFetch: nn.Variable = yyVAL.node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[yyDollar[1].node]) yyVAL.node = nn case *expr.MethodCall: nn.Variable = yyVAL.node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[yyDollar[1].node]) yyVAL.node = nn } } @@ -6185,44 +7406,41 @@ yydefault: case *expr.ArrayDimFetch: nn.Variable = yyVAL.node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[yyDollar[1].node]) yyVAL.node = nn case *expr.PropertyFetch: nn.Variable = yyVAL.node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[yyDollar[1].node]) yyVAL.node = nn case *expr.MethodCall: nn.Variable = yyVAL.node yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyVAL.node, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[yyDollar[1].node]) yyVAL.node = nn } } } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3414 + //line php5/php5.y:4661 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3419 + //line php5/php5.y:4666 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 439: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3421 + //line php5/php5.y:4668 { yyVAL.list = []node.Node{} } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3427 + //line php5/php5.y:4674 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*expr.MethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*expr.PropertyFetch).Property @@ -6230,59 +7448,74 @@ yydefault: } yyVAL.list = yyDollar[2].list + + // save comments + yylex.(*Parser).comments.AddFromToken(yyDollar[2].list[0], yyDollar[1].token, comment.ObjectOperatorToken) } case 441: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3439 + //line php5/php5.y:4689 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) + yyVAL.list = append(yyDollar[1].list, fetch) + + // save position yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) - yyVAL.list = append(yyDollar[1].list, fetch) + // save comments + yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[4].token, comment.CloseSquareBracket) } case 442: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3446 + //line php5/php5.y:4701 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) + yyVAL.list = []node.Node{yyDollar[1].node, fetch} + + // save position yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) - yyVAL.list = []node.Node{yyDollar[1].node, fetch} + // save comments + yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[4].token, comment.CloseSquareBracket) } case 443: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3456 + //line php5/php5.y:4716 { yyVAL.node = expr.NewMethodCall(nil, nil, yyDollar[1].node.(*node.ArgumentList)) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 444: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3464 + //line php5/php5.y:4726 { yyVAL.list = []node.Node{yyDollar[1].node} } case 445: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3466 + //line php5/php5.y:4728 { yyVAL.list = yyDollar[1].list } case 446: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3468 + //line php5/php5.y:4730 { yyVAL.list = nil } case 447: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3473 + //line php5/php5.y:4735 { yyVAL.node = yyDollar[1].node } case 448: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3475 + //line php5/php5.y:4737 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6294,69 +7527,87 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3488 + //line php5/php5.y:4750 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) } case 450: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3494 + //line php5/php5.y:4760 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3504 + //line php5/php5.y:4774 { yyVAL.node = yyDollar[1].node } case 452: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3509 + //line php5/php5.y:4779 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) } case 453: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3515 + //line php5/php5.y:4790 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3523 + //line php5/php5.y:4803 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3524 + //line php5/php5.y:4804 { yyVAL.node = yyDollar[1].node } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3525 + //line php5/php5.y:4805 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3531 + //line php5/php5.y:4811 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3533 + //line php5/php5.y:4813 { yyDollar[1].simpleIndirectReference.last.SetVarName(yyDollar[2].node) @@ -6368,153 +7619,203 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3543 + //line php5/php5.y:4823 { yyVAL.node = yyDollar[1].node } case 460: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3548 + //line php5/php5.y:4828 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3554 + //line php5/php5.y:4839 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) } case 462: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3560 + //line php5/php5.y:4850 { yyVAL.node = yyDollar[1].node } case 463: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3566 + //line php5/php5.y:4856 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = expr.NewVariable(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3576 + //line php5/php5.y:4868 { yyVAL.node = expr.NewVariable(yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseCurlyBracesToken) } case 465: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3585 + //line php5/php5.y:4883 { yyVAL.node = nil } case 466: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3587 + //line php5/php5.y:4885 { yyVAL.node = yyDollar[1].node } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3593 + //line php5/php5.y:4891 { yyVAL.list = yyDollar[1].list } case 468: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3595 + //line php5/php5.y:4893 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) - yyVAL.list = []node.Node{fetch} + + // save position + yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 469: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3605 + //line php5/php5.y:4904 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) + yyVAL.list = append(yyDollar[1].list, fetch) + + // save position yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) - yyVAL.list = append(yyDollar[1].list, fetch) + // save comments + yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[4].token, comment.CloseSquareBracket) } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3612 + //line php5/php5.y:4916 { fetch := expr.NewArrayDimFetch(nil, yyDollar[3].node) + yyVAL.list = append(yyDollar[1].list, fetch) + + // save position yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) - yyVAL.list = append(yyDollar[1].list, fetch) + // save comments + yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[2].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[4].token, comment.CloseCurlyBracesToken) } case 471: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3619 + //line php5/php5.y:4928 { fetch := expr.NewPropertyFetch(nil, yyDollar[1].node) - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) - yyVAL.list = []node.Node{fetch} + + // save position + yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 472: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3629 + //line php5/php5.y:4939 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringToken) } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3635 + //line php5/php5.y:4949 { yyVAL.node = yyDollar[2].node + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) } case 474: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3640 + //line php5/php5.y:4963 { n := expr.NewVariable(nil) - yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(n, yyDollar[1].token.Comments()) - yyVAL.simpleIndirectReference = simpleIndirectReference{[]*expr.Variable{n}, n} + + // save position + yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(n, yyDollar[1].token, comment.DollarToken) } case 475: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3648 + //line php5/php5.y:4974 { n := expr.NewVariable(nil) - yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yylex.(*Parser).comments.AddComments(n, yyDollar[2].token.Comments()) yyDollar[1].simpleIndirectReference.last.SetVarName(n) - yyDollar[1].simpleIndirectReference.all = append(yyDollar[1].simpleIndirectReference.all, n) yyDollar[1].simpleIndirectReference.last = n yyVAL.simpleIndirectReference = yyDollar[1].simpleIndirectReference + + // save position + yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(n, yyDollar[2].token, comment.DollarToken) } case 476: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3663 + //line php5/php5.y:4992 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3665 + //line php5/php5.y:4999 { if yyDollar[1].node == nil { yyVAL.list = []node.Node{} @@ -6524,399 +7825,540 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3677 + //line php5/php5.y:5011 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) } case 479: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3683 + //line php5/php5.y:5018 { item := expr.NewList(yyDollar[3].list) - yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(item, yyDollar[1].token.Comments()) - yyVAL.node = expr.NewArrayItem(nil, item) + + // save position + yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodePosition(item)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[item]) + + // save comments + yylex.(*Parser).comments.AddFromToken(item, yyDollar[1].token, comment.ListToken) + yylex.(*Parser).comments.AddFromToken(item, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(item, yyDollar[4].token, comment.CloseParenthesisToken) } case 480: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3693 + //line php5/php5.y:5032 { yyVAL.node = nil } case 481: yyDollar = yyS[yypt-0 : yypt+1] - //line php5/php5.y:3699 + //line php5/php5.y:5038 { yyVAL.list = []node.Node{} } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3701 + //line php5/php5.y:5040 { yyVAL.list = yyDollar[1].list + + // save comments + if yyDollar[2].token != nil { + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + } } case 483: yyDollar = yyS[yypt-5 : yypt+1] - //line php5/php5.y:3706 + //line php5/php5.y:5052 { arrayItem := expr.NewArrayItem(yyDollar[3].node, yyDollar[5].node) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[3].node]) - yyVAL.list = append(yyDollar[1].list, arrayItem) + + // save position + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[5].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(arrayItem, yyDollar[4].token, comment.DoubleArrowToken) } case 484: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3714 + //line php5/php5.y:5064 { arrayItem := expr.NewArrayItem(nil, yyDollar[3].node) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[3].node]) - yyVAL.list = append(yyDollar[1].list, arrayItem) + + // save position + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[3].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 485: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3722 + //line php5/php5.y:5075 { arrayItem := expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[1].node]) - yyVAL.list = []node.Node{arrayItem} + + // save position + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(arrayItem, yyDollar[2].token, comment.DoubleArrowToken) } case 486: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3730 + //line php5/php5.y:5086 { arrayItem := expr.NewArrayItem(nil, yyDollar[1].node) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[1].node]) - yyVAL.list = []node.Node{arrayItem} + + // save position + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition(yyDollar[1].node)) } case 487: yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3738 + //line php5/php5.y:5094 { reference := expr.NewReference(yyDollar[6].node) arrayItem := expr.NewArrayItem(yyDollar[3].node, reference) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[3].node]) - yyVAL.list = append(yyDollar[1].list, arrayItem) + + // save position + yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[5].token, yyDollar[6].node)) + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[3].node, yyDollar[6].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(arrayItem, yyDollar[4].token, comment.DoubleArrowToken) + yylex.(*Parser).comments.AddFromToken(reference, yyDollar[5].token, comment.AmpersandToken) } case 488: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3747 + //line php5/php5.y:5109 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(nil, reference) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(arrayItem, yyDollar[3].token.Comments()) - yyVAL.list = append(yyDollar[1].list, arrayItem) + + // save position + yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(reference, yyDollar[3].token, comment.AmpersandToken) } case 489: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3756 + //line php5/php5.y:5123 { reference := expr.NewReference(yyDollar[4].node) arrayItem := expr.NewArrayItem(yyDollar[1].node, reference) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[yyDollar[1].node]) - yyVAL.list = []node.Node{arrayItem} + + // save position + yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[3].token, yyDollar[4].node)) + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(arrayItem, yyDollar[2].token, comment.DoubleArrowToken) + yylex.(*Parser).comments.AddFromToken(reference, yyDollar[3].token, comment.AmpersandToken) } case 490: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3765 + //line php5/php5.y:5137 { reference := expr.NewReference(yyDollar[2].node) arrayItem := expr.NewArrayItem(nil, reference) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(arrayItem, yyDollar[1].token.Comments()) - yyVAL.list = []node.Node{arrayItem} + + // save position + yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(reference, yyDollar[1].token, comment.AmpersandToken) } case 491: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3777 + //line php5/php5.y:5153 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 492: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3779 + //line php5/php5.y:5155 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) yyVAL.list = append(yyDollar[1].list, encapsed) - yylex.(*Parser).comments.AddComments(encapsed, yyDollar[2].token.Comments()) + + // save position + yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(encapsed, yyDollar[2].token, comment.EncapsedAndWhitespaceToken) } case 493: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3786 + //line php5/php5.y:5166 { yyVAL.list = []node.Node{yyDollar[1].node} } case 494: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3788 + //line php5/php5.y:5168 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} - yylex.(*Parser).comments.AddComments(encapsed, yyDollar[1].token.Comments()) + + // save position + yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(encapsed, yyDollar[1].token, comment.EncapsedAndWhitespaceToken) } case 495: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3798 + //line php5/php5.y:5182 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = expr.NewVariable(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(name, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) } case 496: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3808 + //line php5/php5.y:5194 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yyVAL.node = expr.NewArrayDimFetch(variable, yyDollar[3].node) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseSquareBracket) } case 497: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3821 + //line php5/php5.y:5210 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) fetch := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.node = expr.NewPropertyFetch(variable, fetch) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(fetch, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[1].token, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.ObjectOperatorToken) + yylex.(*Parser).comments.AddFromToken(fetch, yyDollar[3].token, comment.StringToken) } case 498: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3837 + //line php5/php5.y:5228 { - yyVAL.node = yyDollar[2].node + yyVAL.node = expr.NewVariable(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) } case 499: - yyDollar = yyS[yypt-6 : yypt+1] - //line php5/php5.y:3843 + yyDollar = yyS[yypt-3 : yypt+1] + //line php5/php5.y:5239 { - identifier := node.NewIdentifier(yyDollar[2].token.Value) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) - yyVAL.node = expr.NewArrayDimFetch(variable, yyDollar[4].node) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) + name := node.NewIdentifier(yyDollar[2].token.Value) + yyVAL.node = expr.NewVariable(name) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[2].token.Comments()) - yylex.(*Parser).comments.AddComments(variable, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(name, yyDollar[2].token, comment.StringVarnameToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CloseCurlyBracesToken) } case 500: - yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3857 + yyDollar = yyS[yypt-6 : yypt+1] + //line php5/php5.y:5253 { - yyVAL.node = yyDollar[2].node + identifier := node.NewIdentifier(yyDollar[2].token.Value) + variable := expr.NewVariable(identifier) + yyVAL.node = expr.NewArrayDimFetch(variable, yyDollar[4].node) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[2].token)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.DollarOpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(variable, yyDollar[2].token, comment.StringVarnameToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[5].token, comment.CloseSquareBracket) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[6].token, comment.CloseCurlyBracesToken) } case 501: - yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3862 + yyDollar = yyS[yypt-3 : yypt+1] + //line php5/php5.y:5271 { - yyVAL.node = scalar.NewString(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yyVAL.node = yyDollar[2].node } case 502: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3868 + //line php5/php5.y:5278 + { + yyVAL.node = scalar.NewString(yyDollar[1].token.Value) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.StringToken) + } + case 503: + yyDollar = yyS[yypt-1 : yypt+1] + //line php5/php5.y:5288 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) } else { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) } - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) - } - case 503: - yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3880 - { - identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yyVAL.node = expr.NewVariable(identifier) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) - yylex.(*Parser).comments.AddComments(identifier, yyDollar[1].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.NumStringToken) } case 504: - yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3893 + yyDollar = yyS[yypt-1 : yypt+1] + //line php5/php5.y:5303 { - yyVAL.node = expr.NewIsset(yyDollar[3].list) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) + yyVAL.node = expr.NewVariable(identifier) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[1].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.VariableToken) } case 505: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3899 + //line php5/php5.y:5318 { - yyVAL.node = expr.NewEmpty(yyDollar[3].node) + yyVAL.node = expr.NewIsset(yyDollar[3].list) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IssetToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) } case 506: yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3905 + //line php5/php5.y:5330 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EmptyToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) } case 507: - yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3911 + yyDollar = yyS[yypt-4 : yypt+1] + //line php5/php5.y:5342 { - yyVAL.node = expr.NewInclude(yyDollar[2].node) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yyVAL.node = expr.NewEmpty(yyDollar[3].node) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EmptyToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) } case 508: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3917 + //line php5/php5.y:5354 { - yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) + yyVAL.node = expr.NewInclude(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncludeToken) } case 509: - yyDollar = yyS[yypt-4 : yypt+1] - //line php5/php5.y:3923 + yyDollar = yyS[yypt-2 : yypt+1] + //line php5/php5.y:5364 { - yyVAL.node = expr.NewEval(yyDollar[3].node) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.IncludeOnceToken) } case 510: - yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3929 + yyDollar = yyS[yypt-4 : yypt+1] + //line php5/php5.y:5374 { - yyVAL.node = expr.NewRequire(yyDollar[2].node) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + yyVAL.node = expr.NewEval(yyDollar[3].node) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.EvalToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) } case 511: yyDollar = yyS[yypt-2 : yypt+1] - //line php5/php5.y:3935 + //line php5/php5.y:5386 { - yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) + yyVAL.node = expr.NewRequire(yyDollar[2].node) + + // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) - yylex.(*Parser).comments.AddComments(yyVAL.node, yyDollar[1].token.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.RequireToken) } case 512: + yyDollar = yyS[yypt-2 : yypt+1] + //line php5/php5.y:5396 + { + yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) + + // save position + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.RequireOnceToken) + } + case 513: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3944 + //line php5/php5.y:5409 { yyVAL.list = []node.Node{yyDollar[1].node} } - case 513: + case 514: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3946 + //line php5/php5.y:5411 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) - } - case 514: - yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3951 - { - yyVAL.node = yyDollar[1].node + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(yyDollar[1].list), yyDollar[2].token, comment.CommaToken) } case 515: yyDollar = yyS[yypt-1 : yypt+1] - //line php5/php5.y:3953 + //line php5/php5.y:5421 { yyVAL.node = yyDollar[1].node } case 516: - yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3958 + yyDollar = yyS[yypt-1 : yypt+1] + //line php5/php5.y:5423 { - target := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) - yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) - yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) - - yylex.(*Parser).comments.AddComments(target, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + yyVAL.node = yyDollar[1].node } case 517: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3968 + //line php5/php5.y:5428 { target := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) + + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(target, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) } case 518: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3981 + //line php5/php5.y:5440 { target := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) + + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(target, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) } case 519: yyDollar = yyS[yypt-3 : yypt+1] - //line php5/php5.y:3994 + //line php5/php5.y:5455 { target := node.NewIdentifier(yyDollar[3].token.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) + + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) - yylex.(*Parser).comments.AddComments(target, yyDollar[3].token.Comments()) - yylex.(*Parser).comments.AddComments(yyVAL.node, yylex.(*Parser).comments[yyDollar[1].node]) + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) + } + case 520: + yyDollar = yyS[yypt-3 : yypt+1] + //line php5/php5.y:5470 + { + target := node.NewIdentifier(yyDollar[3].token.Value) + yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) + + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[3].token)) + yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(yyDollar[1].node, yyDollar[3].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.PaamayimNekudotayimToken) } } goto yystack /* stack new state and value */ diff --git a/php5/php5.y b/php5/php5.y index 94947e7..a25a750 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -5,6 +5,7 @@ import ( "strings" "strconv" + "github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/scanner" "github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node/scalar" @@ -227,6 +228,8 @@ import ( %right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC %type function interface_entry +%type possible_comma +%type case_separator %type top_statement use_declaration use_function_declaration use_const_declaration common_scalar %type static_class_constant compound_variable reference_variable class_name variable_class_name @@ -295,16 +298,25 @@ namespace_name: T_STRING { namePart := name.NewNamePart($1.Value) - yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) $$ = []node.Node{namePart} - yylex.(*Parser).comments.AddComments(namePart, $1.Comments()) + + // save position + yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddFromToken(namePart, $1, comment.StringToken) } | namespace_name T_NS_SEPARATOR T_STRING { namePart := name.NewNamePart($3.Value) - yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) $$ = append($1, namePart) - yylex.(*Parser).comments.AddComments(namePart, $3.Comments()) + + // save position + yylex.(*Parser).positions.AddPosition(namePart, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken(namePart, $3, comment.StringToken) } ; @@ -323,68 +335,114 @@ top_statement: | T_HALT_COMPILER '(' ')' ';' { $$ = stmt.NewHaltCompiler() + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.HaltCompilerToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } | T_NAMESPACE namespace_name ';' { name := name.NewName($2) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) $$ = stmt.NewNamespace(name, nil) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_NAMESPACE namespace_name '{' top_statement_list '}' { name := name.NewName($2) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) $$ = stmt.NewNamespace(name, $4) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.CloseCurlyBracesToken) } | T_NAMESPACE '{' top_statement_list '}' { $$ = stmt.NewNamespace(nil, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) } | T_USE use_declarations ';' { $$ = stmt.NewUseList(nil, $2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_USE T_FUNCTION use_function_declarations ';' { useType := node.NewIdentifier($2.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - $$ = stmt.NewUseList(useType, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) + yylex.(*Parser).comments.AddFromToken(useType, $2, comment.UseToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } | T_USE T_CONST use_const_declarations ';' { useType := node.NewIdentifier($2.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) - $$ = stmt.NewUseList(useType, $3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) + yylex.(*Parser).comments.AddFromToken(useType, $2, comment.UseToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } | constant_declaration ';' - { $$ = $1 } + { + $$ = $1 + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) + } ; use_declarations: use_declarations ',' use_declaration - { $$ = append($1, $3) } + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + } | use_declaration { $$ = []node.Node{$1} } ; @@ -393,54 +451,65 @@ use_declaration: namespace_name { name := name.NewName($1) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) $$ = stmt.NewUse(nil, name, nil) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($1)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) } | namespace_name T_AS T_STRING { name := name.NewName($1) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) alias := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) $$ = stmt.NewUse(nil, name, alias) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($1)) - yylex.(*Parser).comments.AddComments(alias, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(alias, $3, comment.StringToken) } | T_NS_SEPARATOR namespace_name { name := name.NewName($2) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) $$ = stmt.NewUse(nil, name, nil) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($2)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($2)) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) } | T_NS_SEPARATOR namespace_name T_AS T_STRING { name := name.NewName($2) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) alias := node.NewIdentifier($4.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) $$ = stmt.NewUse(nil, name, alias) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($2)) - yylex.(*Parser).comments.AddComments(alias, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($2)) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.AsToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.StringToken) } ; use_function_declarations: use_function_declarations ',' use_function_declaration - { $$ = append($1, $3) } + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + } | use_function_declaration { $$ = []node.Node{$1} } ; @@ -449,54 +518,65 @@ use_function_declaration: namespace_name { name := name.NewName($1) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) $$ = stmt.NewUse(nil, name, nil) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($1)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) } | namespace_name T_AS T_STRING { name := name.NewName($1) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) alias := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) $$ = stmt.NewUse(nil, name, alias) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($1)) - yylex.(*Parser).comments.AddComments(alias, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(alias, $3, comment.StringToken) } | T_NS_SEPARATOR namespace_name { name := name.NewName($2) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) $$ = stmt.NewUse(nil, name, nil) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($2)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($2)) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) } | T_NS_SEPARATOR namespace_name T_AS T_STRING { name := name.NewName($2) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) alias := node.NewIdentifier($4.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) $$ = stmt.NewUse(nil, name, alias) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($2)) - yylex.(*Parser).comments.AddComments(alias, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($2)) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.AsToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.StringToken) } ; use_const_declarations: use_const_declarations ',' use_const_declaration - { $$ = append($1, $3) } + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + } | use_const_declaration { $$ = []node.Node{$1} } ; @@ -505,48 +585,54 @@ use_const_declaration: namespace_name { name := name.NewName($1) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) $$ = stmt.NewUse(nil, name, nil) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($1)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) } | namespace_name T_AS T_STRING { name := name.NewName($1) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) alias := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) $$ = stmt.NewUse(nil, name, alias) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($1)) - yylex.(*Parser).comments.AddComments(alias, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(alias, $3, comment.StringToken) } | T_NS_SEPARATOR namespace_name { name := name.NewName($2) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) $$ = stmt.NewUse(nil, name, nil) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($2)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($2)) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) } | T_NS_SEPARATOR namespace_name T_AS T_STRING { name := name.NewName($2) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) alias := node.NewIdentifier($4.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) $$ = stmt.NewUse(nil, name, alias) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($2)) - yylex.(*Parser).comments.AddComments(alias, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($2)) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.AsToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.StringToken) } ; @@ -554,34 +640,37 @@ constant_declaration: constant_declaration ',' T_STRING '=' static_scalar { name := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).comments.AddComments(name, $3.Comments()) - constant := stmt.NewConstant(name, $5, "") - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) - yylex.(*Parser).comments.AddComments(constant, $3.Comments()) - constList := $1.(*stmt.ConstList) constList.Consts = append(constList.Consts, constant) - $$ = $1 + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, constList.Consts)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(constList.Consts), $2, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(name, $3, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(constant, $4, comment.EqualToken) } | T_CONST T_STRING '=' static_scalar { name := node.NewIdentifier($2.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).comments.AddComments(name, $2.Comments()) - constant := stmt.NewConstant(name, $4, "") - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) - yylex.(*Parser).comments.AddComments(constant, $2.Comments()) - constList := []node.Node{constant} - $$ = stmt.NewConstList(constList) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, constList)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstToken) + yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(constant, $3, comment.EqualToken) } ; @@ -612,8 +701,15 @@ inner_statement: | T_HALT_COMPILER '(' ')' ';' { $$ = stmt.NewHaltCompiler() + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.HaltCompilerToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } ; @@ -624,12 +720,15 @@ statement: | T_STRING ':' { label := node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) $$ = stmt.NewLabel(label) + + // save position + yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - yylex.(*Parser).comments.AddComments(label, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(label, $1, comment.StringToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.ColonToken) } ; @@ -637,13 +736,19 @@ unticked_statement: '{' inner_statement_list '}' { $$ = stmt.NewStmtList($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) } | T_IF parenthesis_expr statement elseif_list else_single { $$ = stmt.NewIf($2, $3, $4, $5) - + + // save position if $5 != nil { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) } else if len($4) > 0 { @@ -652,16 +757,23 @@ unticked_statement: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) } - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.IfToken) } | T_IF parenthesis_expr ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';' { stmts := stmt.NewStmtList($4) - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($4)) - $$ = stmt.NewAltIf($2, stmts, $5, $6) + + // save position + yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($4)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.IfToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken($$, $7, comment.EndifToken) + yylex.(*Parser).comments.AddFromToken($$, $8, comment.SemiColonToken) } | T_WHILE parenthesis_expr while_statement { @@ -674,14 +786,23 @@ unticked_statement: $$ = $3 + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.WhileToken) } | T_DO statement T_WHILE parenthesis_expr ';' { $$ = stmt.NewDo($2, $4) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.WhileToken) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.SemiColonToken) } | T_FOR '(' for_expr ';' for_expr ';' for_expr ')' for_statement { @@ -698,8 +819,15 @@ unticked_statement: $$ = $9 + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.ForInitSemicolonToken) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.ForCondSemicolonToken) + yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseParenthesisToken) } | T_SWITCH parenthesis_expr switch_case_list { @@ -714,92 +842,164 @@ unticked_statement: $$ = $3 + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.SwitchToken) } | T_BREAK ';' { $$ = stmt.NewBreak(nil) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.BreakToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) } | T_BREAK expr ';' { $$ = stmt.NewBreak($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.BreakToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_CONTINUE ';' { $$ = stmt.NewContinue(nil) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ContinueToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) } | T_CONTINUE expr ';' { $$ = stmt.NewContinue($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ContinueToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_RETURN ';' { $$ = stmt.NewReturn(nil) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ReturnToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) } | T_RETURN expr_without_variable ';' { $$ = stmt.NewReturn($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ReturnToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_RETURN variable ';' { $$ = stmt.NewReturn($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ReturnToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | yield_expr ';' { $$ = stmt.NewExpression($1) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) } | T_GLOBAL global_var_list ';' { $$ = stmt.NewGlobal($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.GlobalToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_STATIC static_var_list ';' { $$ = stmt.NewStatic($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_ECHO echo_expr_list ';' { $$ = stmt.NewEcho($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.EchoToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_INLINE_HTML { $$ = stmt.NewInlineHtml($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.InlineHTMLToken) } | expr ';' { $$ = stmt.NewExpression($1) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) } | T_UNSET '(' unset_variables ')' ';' { $$ = stmt.NewUnset($3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.UnsetToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.SemiColonToken) } | T_FOREACH '(' variable T_AS foreach_variable foreach_optional_arg ')' foreach_statement { @@ -827,8 +1027,14 @@ unticked_statement: $$ = $8 + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForeachToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.AsToken) + yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseParenthesisToken) } | T_FOREACH '(' expr_without_variable T_AS foreach_variable foreach_optional_arg ')' foreach_statement { @@ -854,50 +1060,79 @@ unticked_statement: } } + // save position $$ = $8 yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ForeachToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.AsToken) + yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseParenthesisToken) } | T_DECLARE '(' declare_list ')' declare_statement { $$ = stmt.NewDeclare($3, $5) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DeclareToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) } | ';' { $$ = stmt.NewNop() + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) } | T_TRY '{' inner_statement_list '}' catch_statement finally_statement { $$ = stmt.NewTry($3, $5, $6) + // save position if $6 == nil { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $5)) } else { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) } - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.TryToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) } | T_THROW expr ';' { $$ = stmt.NewThrow($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ThrowToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | T_GOTO T_STRING ';' { label := node.NewIdentifier($2.Value) - yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) $$ = stmt.NewGoto(label) + + // save position + yylex.(*Parser).positions.AddPosition(label, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments(label, $2.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.GotoToken) + yylex.(*Parser).comments.AddFromToken(label, $2, comment.StringToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } ; @@ -907,18 +1142,22 @@ catch_statement: | T_CATCH '(' fully_qualified_class_name T_VARIABLE ')' '{' inner_statement_list '}' additional_catches { identifier := node.NewIdentifier(strings.TrimLeft($4.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).comments.AddComments(identifier, $4.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).comments.AddComments(variable, $4.Comments()) - catch := stmt.NewCatch([]node.Node{$3}, variable, $7) - yylex.(*Parser).positions.AddPosition(catch, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) - yylex.(*Parser).comments.AddComments(catch, $1.Comments()) - $$ = append([]node.Node{catch}, $9...) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + yylex.(*Parser).positions.AddPosition(catch, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) + + // save comments + yylex.(*Parser).comments.AddFromToken(catch, $1, comment.CatchToken) + yylex.(*Parser).comments.AddFromToken(catch, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(variable, $4, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(catch, $5, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken(catch, $6, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(catch, $8, comment.CloseCurlyBracesToken) } finally_statement: @@ -927,8 +1166,14 @@ finally_statement: | T_FINALLY '{' inner_statement_list '}' { $$ = stmt.NewFinally($3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.FinallyToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) } ; @@ -950,16 +1195,21 @@ additional_catch: T_CATCH '(' fully_qualified_class_name T_VARIABLE ')' '{' inner_statement_list '}' { identifier := node.NewIdentifier(strings.TrimLeft($4.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).comments.AddComments(identifier, $4.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).comments.AddComments(variable, $4.Comments()) - $$ = stmt.NewCatch([]node.Node{$3}, variable, $7) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.CatchToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(variable, $4, comment.StringToken) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $8, comment.CloseCurlyBracesToken) } ; @@ -967,7 +1217,12 @@ unset_variables: unset_variable { $$ = []node.Node{$1} } | unset_variables ',' unset_variable - { $$ = append($1, $3) } + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + } ; unset_variable: @@ -1003,22 +1258,31 @@ unticked_function_declaration_statement: function is_reference T_STRING '(' parameter_list ')' '{' inner_statement_list '}' { name := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).comments.AddComments(name, $3.Comments()) - $$ = stmt.NewFunction(name, $2 != nil, $5, nil, $8, "") + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.FunctionToken) + if $2 != nil { + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) + } + yylex.(*Parser).comments.AddFromToken(name, $3, comment.StringToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $7, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $9, comment.CloseCurlyBracesToken) } ; unticked_class_declaration_statement: class_entry_type T_STRING extends_from implements_list '{' class_statement_list '}' { + name := node.NewIdentifier($2.Value) switch n := $1.(type) { case *stmt.Class : - name := node.NewIdentifier($2.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) n.ClassName = name n.Stmts = $6 n.Extends = $3 @@ -1026,23 +1290,32 @@ unticked_class_declaration_statement: case *stmt.Trait : // TODO: is it possible that trait extend or implement - name := node.NewIdentifier($2.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) n.TraitName = name n.Stmts = $6 } - $$ = $1 + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + + // save comments + yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringToken) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseCurlyBracesToken) } | interface_entry T_STRING interface_extends_list '{' class_statement_list '}' { name := node.NewIdentifier($2.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).comments.AddComments(name, $2.Comments()) - $$ = stmt.NewInterface(name, $3, $5, "") + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseCurlyBracesToken) } ; @@ -1051,34 +1324,48 @@ class_entry_type: T_CLASS { $$ = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassToken) } | T_ABSTRACT T_CLASS { classModifier := node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(classModifier, $1.Comments()) - $$ = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") + + // save position + yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(classModifier, $1, comment.AbstractToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.ClassToken) } | T_TRAIT { $$ = stmt.NewTrait(nil, nil, "") + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.TraitToken) } | T_FINAL T_CLASS { classModifier := node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(classModifier, $1.Comments()) - $$ = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") + + // save position + yylex.(*Parser).positions.AddPosition(classModifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(classModifier, $1, comment.FinalToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.ClassToken) } ; @@ -1091,6 +1378,9 @@ extends_from: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExtendsToken) } ; @@ -1108,6 +1398,9 @@ interface_extends_list: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExtendsToken) } ; @@ -1120,6 +1413,9 @@ implements_list: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ImplementsToken) } ; @@ -1127,27 +1423,50 @@ interface_list: fully_qualified_class_name { $$ = []node.Node{$1} } | interface_list ',' fully_qualified_class_name - { $$ = append($1, $3) } + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + } ; foreach_optional_arg: /* empty */ { $$ = nil } | T_DOUBLE_ARROW foreach_variable - { $$ = $2 } + { + $$ = $2 + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoubleArrowToken) + } ; foreach_variable: variable { $$ = $1 } | '&' variable - { $$ = expr.NewReference($2) } + { + $$ = expr.NewReference($2) + + // save position + yylex.(*Parser).positions.AddPosition($2, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.AmpersandToken) + } | T_LIST '(' assignment_list ')' { - list := expr.NewList($3) - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - $$ = list - yylex.(*Parser).comments.AddComments(list, $1.Comments()) + $$ = expr.NewList($3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ListToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) } ; @@ -1155,6 +1474,8 @@ for_statement: statement { $$ = stmt.NewFor(nil, nil, nil, $1) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) } | ':' inner_statement_list T_ENDFOR ';' @@ -1162,16 +1483,23 @@ for_statement: stmtList := stmt.NewStmtList($2) $$ = stmt.NewAltFor(nil, nil, nil, stmtList) + // save position yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.EndforToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } ; - foreach_statement: statement { $$ = stmt.NewForeach(nil, nil, nil, $1) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) } | ':' inner_statement_list T_ENDFOREACH ';' @@ -1179,8 +1507,14 @@ foreach_statement: stmtList := stmt.NewStmtList($2) $$ = stmt.NewAltForeach(nil, nil, nil, stmtList) + // save position yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.EndforeachToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } ; @@ -1191,8 +1525,14 @@ declare_statement: | ':' inner_statement_list T_ENDDECLARE ';' { $$ = stmt.NewStmtList($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.EnddeclareToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } ; @@ -1201,26 +1541,31 @@ declare_list: T_STRING '=' static_scalar { name := node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(name, $1.Comments()) - constant := stmt.NewConstant(name, $3, "") - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - yylex.(*Parser).comments.AddComments(constant, $1.Comments()) - $$ = []node.Node{constant} + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddFromToken(name, $1, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(constant, $2, comment.EqualToken) } | declare_list ',' T_STRING '=' static_scalar { name := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).comments.AddComments(name, $3.Comments()) - constant := stmt.NewConstant(name, $5, "") - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) - yylex.(*Parser).comments.AddComments(constant, $3.Comments()) - $$ = append($1, constant) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(name, $3, comment.StringToken) + yylex.(*Parser).comments.AddFromToken(constant, $4, comment.EqualToken) } ; @@ -1231,33 +1576,57 @@ switch_case_list: caseList := stmt.NewCaseList($2) $$ = stmt.NewSwitch(nil, caseList) + // save position yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(caseList, $3, comment.CloseCurlyBracesToken) } | '{' ';' case_list '}' { caseList := stmt.NewCaseList($3) $$ = stmt.NewSwitch(nil, caseList) + // save position yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(caseList, $2, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken(caseList, $4, comment.CloseCurlyBracesToken) } | ':' case_list T_ENDSWITCH ';' { caseList := stmt.NewCaseList($2) $$ = stmt.NewAltSwitch(nil, caseList) + // save position yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(caseList, $3, comment.EndswitchToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } | ':' ';' case_list T_ENDSWITCH ';' { - + caseList := stmt.NewCaseList($3) $$ = stmt.NewAltSwitch(nil, caseList) + // save position yylex.(*Parser).positions.AddPosition(caseList, yylex.(*Parser).positionBuilder.NewNodeListPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + + // save comments + yylex.(*Parser).comments.AddFromToken(caseList, $1, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken(caseList, $2, comment.SemiColonToken) + yylex.(*Parser).comments.AddFromToken(caseList, $4, comment.EndswitchToken) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.SemiColonToken) } ; @@ -1268,23 +1637,35 @@ case_list: | case_list T_CASE expr case_separator inner_statement_list { _case := stmt.NewCase($3, $5) - yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) $$ = append($1, _case) - yylex.(*Parser).comments.AddComments(_case, $2.Comments()) + + // save position + yylex.(*Parser).positions.AddPosition(_case, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) + + // save comments + yylex.(*Parser).comments.AddFromToken(_case, $2, comment.CaseToken) + yylex.(*Parser).comments.AddFromToken(_case, $4, comment.CaseSeparatorToken) } | case_list T_DEFAULT case_separator inner_statement_list { _default := stmt.NewDefault($4) - yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) $$ = append($1, _default) - yylex.(*Parser).comments.AddComments(_default, $2.Comments()) + + // save position + yylex.(*Parser).positions.AddPosition(_default, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken(_default, $2, comment.DefaultToken) + yylex.(*Parser).comments.AddFromToken(_default, $3, comment.CaseSeparatorToken) } ; case_separator: ':' + { $$ = $1 } | ';' + { $$ = $1 } ; @@ -1292,6 +1673,8 @@ while_statement: statement { $$ = stmt.NewWhile(nil, $1) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) } | ':' inner_statement_list T_ENDWHILE ';' @@ -1299,8 +1682,14 @@ while_statement: stmtList := stmt.NewStmtList($2) $$ = stmt.NewAltWhile(nil, stmtList) + // save position yylex.(*Parser).positions.AddPosition(stmtList, yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ColonToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.EndwhileToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.SemiColonToken) } ; @@ -1312,10 +1701,13 @@ elseif_list: | elseif_list T_ELSEIF parenthesis_expr statement { _elseIf := stmt.NewElseIf($3, $4) - yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) - yylex.(*Parser).comments.AddComments(_elseIf, $2.Comments()) - $$ = append($1, _elseIf) + + // save position + yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken(_elseIf, $2, comment.ElseifToken) } ; @@ -1326,13 +1718,16 @@ new_elseif_list: | new_elseif_list T_ELSEIF parenthesis_expr ':' inner_statement_list { stmts := stmt.NewStmtList($5) - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($5)) - _elseIf := stmt.NewAltElseIf($3, stmts) - yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) - yylex.(*Parser).comments.AddComments(_elseIf, $2.Comments()) - $$ = append($1, _elseIf) + + // save position + yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($5)) + yylex.(*Parser).positions.AddPosition(_elseIf, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) + + // save comments + yylex.(*Parser).comments.AddFromToken(_elseIf, $2, comment.ElseifToken) + yylex.(*Parser).comments.AddFromToken(_elseIf, $4, comment.ColonToken) } ; @@ -1343,8 +1738,12 @@ else_single: | T_ELSE statement { $$ = stmt.NewElse($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ElseToken) } ; @@ -1355,11 +1754,15 @@ new_else_single: | T_ELSE ':' inner_statement_list { stmts := stmt.NewStmtList($3) - yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($3)) - $$ = stmt.NewAltElse(stmts) + + // save position + yylex.(*Parser).positions.AddPosition(stmts, yylex.(*Parser).positionBuilder.NewNodeListPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ElseToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.ColonToken) } ; @@ -1375,61 +1778,71 @@ non_empty_parameter_list: parameter { $$ = []node.Node{$1} } | non_empty_parameter_list ',' parameter - { $$ = append($1, $3) } + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + } ; parameter: optional_class_type is_reference is_variadic T_VARIABLE { identifier := node.NewIdentifier(strings.TrimLeft($4.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) - $$ = node.NewParameter($1, variable, nil, $2 != nil, $3 != nil) - + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) if $1 != nil { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) } else if $2 != nil { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($2, $4)) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) } else if $3 != nil { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) } else { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) } + + // save comments + if $2 != nil { + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) + } + if $3 != nil { + yylex.(*Parser).comments.AddFromToken($$, $3, comment.EllipsisToken) + } + yylex.(*Parser).comments.AddFromToken(variable, $4, comment.VariableToken) } | optional_class_type is_reference is_variadic T_VARIABLE '=' static_scalar { identifier := node.NewIdentifier(strings.TrimLeft($4.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).comments.AddComments(identifier, $4.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).comments.AddComments(variable, $4.Comments()) - $$ = node.NewParameter($1, variable, $6, $2 != nil, $3 != nil) + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) if $1 != nil { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) } else if $2 != nil { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6)) - yylex.(*Parser).comments.AddComments($$, $2.Comments()) } else if $3 != nil { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $6)) - yylex.(*Parser).comments.AddComments($$, $3.Comments()) } else { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) - yylex.(*Parser).comments.AddComments($$, $4.Comments()) } + + // save comments + if $2 != nil { + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) + } + if $3 != nil { + yylex.(*Parser).comments.AddFromToken($$, $3, comment.EllipsisToken) + } + yylex.(*Parser).comments.AddFromToken(variable, $4, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.EqualToken) } ; @@ -1440,14 +1853,22 @@ optional_class_type: | T_ARRAY { $$ = node.NewIdentifier($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayToken) } | T_CALLABLE { $$ = node.NewIdentifier($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.CallableToken) } | fully_qualified_class_name { $$ = $1 } @@ -1461,6 +1882,10 @@ function_call_parameter_list: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.CloseParenthesisToken) } | '(' non_empty_function_call_parameter_list ')' { @@ -1468,6 +1893,10 @@ function_call_parameter_list: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) } | '(' yield_expr ')' { @@ -1477,6 +1906,10 @@ function_call_parameter_list: // save position yylex.(*Parser).positions.AddPosition(arg, yylex.(*Parser).positionBuilder.NewNodePosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) } ; @@ -1485,39 +1918,59 @@ non_empty_function_call_parameter_list: function_call_parameter { $$ = []node.Node{$1} } | non_empty_function_call_parameter_list ',' function_call_parameter - { $$ = append($1, $3) } + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + } ; function_call_parameter: expr_without_variable { $$ = node.NewArgument($1, false, false) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) } | variable { $$ = node.NewArgument($1, false, false) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) } | '&' w_variable { $$ = node.NewArgument($2, false, true) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.AmpersandToken) } | T_ELLIPSIS expr { $$ = node.NewArgument($2, true, false) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.EllipsisToken) } ; global_var_list: global_var_list ',' global_var - { $$ = append($1, $3) } + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + } | global_var { $$ = []node.Node{$1} } ; @@ -1527,24 +1980,36 @@ global_var: T_VARIABLE { name := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) $$ = expr.NewVariable(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(name, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) } | '$' r_variable { $$ = expr.NewVariable($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarToken) } | '$' '{' expr '}' { $$ = expr.NewVariable($3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) } ; @@ -1553,72 +2018,67 @@ static_var_list: static_var_list ',' T_VARIABLE { identifier := node.NewIdentifier(strings.TrimLeft($3.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - staticVar := stmt.NewStaticVar(variable, nil) + $$ = append($1, staticVar) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$ = append($1, staticVar) - - yylex.(*Parser).comments.AddComments(identifier, $3.Comments()) - yylex.(*Parser).comments.AddComments(variable, $3.Comments()) - yylex.(*Parser).comments.AddComments(staticVar, $3.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(variable, $3, comment.VariableToken) } | static_var_list ',' T_VARIABLE '=' static_scalar { identifier := node.NewIdentifier(strings.TrimLeft($3.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - staticVar := stmt.NewStaticVar(variable, $5) + $$ = append($1, staticVar) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) - $$ = append($1, staticVar) - - yylex.(*Parser).comments.AddComments(identifier, $3.Comments()) - yylex.(*Parser).comments.AddComments(variable, $3.Comments()) - yylex.(*Parser).comments.AddComments(staticVar, $3.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(variable, $3, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(staticVar, $4, comment.EqualToken) } | T_VARIABLE { identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - staticVar := stmt.NewStaticVar(variable, nil) + $$ = []node.Node{staticVar} + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$ = []node.Node{staticVar} - - yylex.(*Parser).comments.AddComments(identifier, $1.Comments()) - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments(staticVar, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) } | T_VARIABLE '=' static_scalar { identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - staticVar := stmt.NewStaticVar(variable, $3) + $$ = []node.Node{staticVar} + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition(staticVar, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - $$ = []node.Node{staticVar} - - yylex.(*Parser).comments.AddComments(identifier, $1.Comments()) - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments(staticVar, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(staticVar, $2, comment.EqualToken) } - ; @@ -1634,28 +2094,48 @@ class_statement: variable_modifiers class_variable_declaration ';' { $$ = stmt.NewPropertyList($1, $2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $3, comment.SemiColonToken) } | class_constant_declaration ';' - { $$ = $1 } + { + $$ = $1 + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) + } | trait_use_statement - { $$ = $1 } + { + $$ = $1 + } | method_modifiers function is_reference T_STRING '(' parameter_list ')' method_body { name := node.NewIdentifier($4.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).comments.AddComments(name, $4.Comments()) - $$ = stmt.NewClassMethod(name, $1, $3 != nil, $6, nil, $8, "") + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) if $1 == nil { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $8)) } else { yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListNodePosition($1, $8)) } - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.FunctionToken) + if $3 != nil { + yylex.(*Parser).comments.AddFromToken($$, $3, comment.AmpersandToken) + } + yylex.(*Parser).comments.AddFromToken(name, $4, comment.IdentifierToken) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $7, comment.CloseParenthesisToken) } ; @@ -1669,10 +2149,13 @@ trait_use_statement: default: adaptationList = nil } - $$ = stmt.NewTraitUse($2, adaptationList) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.UseToken) } ; @@ -1680,7 +2163,12 @@ trait_list: fully_qualified_class_name { $$ = []node.Node{$1} } | trait_list ',' fully_qualified_class_name - { $$ = append($1, $3) } + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + } ; trait_adaptations: @@ -1689,12 +2177,20 @@ trait_adaptations: $$ = stmt.NewNop() yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) + } | '{' trait_adaptation_list '}' { $$ = stmt.NewTraitAdaptationList($2) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) } ; @@ -1714,17 +2210,31 @@ non_empty_trait_adaptation_list: trait_adaptation_statement: trait_precedence ';' - { $$ = $1 } + { + $$ = $1; + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) + } | trait_alias ';' - { $$ = $1 } + { + $$ = $1; + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SemiColonToken) + } ; trait_precedence: trait_method_reference_fully_qualified T_INSTEADOF trait_reference_list { $$ = stmt.NewTraitUsePrecedence($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.InsteadofToken) } ; @@ -1732,19 +2242,26 @@ trait_reference_list: fully_qualified_class_name { $$ = []node.Node{$1} } | trait_reference_list ',' fully_qualified_class_name - { $$ = append($1, $3) } + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + } ; trait_method_reference: T_STRING { name := node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(name, $1.Comments()) - $$ = stmt.NewTraitMethodRef(nil, name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(name, $1, comment.IdentifierToken) } | trait_method_reference_fully_qualified { $$ = $1 } @@ -1754,12 +2271,15 @@ trait_method_reference_fully_qualified: fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { target := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).comments.AddComments(target, $3.Comments()) - $$ = stmt.NewTraitMethodRef($1, target) + + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + yylex.(*Parser).comments.AddFromToken(target, $3, comment.IdentifierToken) } ; @@ -1767,18 +2287,25 @@ trait_alias: trait_method_reference T_AS trait_modifiers T_STRING { alias := node.NewIdentifier($4.Value) - yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) $$ = stmt.NewTraitUseAlias($1, $3, alias) + + // save position + yylex.(*Parser).positions.AddPosition(alias, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - - yylex.(*Parser).comments.AddComments(alias, $4.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) + yylex.(*Parser).comments.AddFromToken(alias, $4, comment.IdentifierToken) } | trait_method_reference T_AS member_modifier { $$ = stmt.NewTraitUseAlias($1, $3, nil) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsToken) } ; @@ -1794,13 +2321,22 @@ method_body: { $$ = stmt.NewNop() + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.SemiColonToken) } | '{' inner_statement_list '}' { $$ = stmt.NewStmtList($2) + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) } ; @@ -1810,10 +2346,13 @@ variable_modifiers: | T_VAR { modifier := node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(modifier, $1.Comments()) - $$ = []node.Node{modifier} + + // save position + yylex.(*Parser).positions.AddPosition(modifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddFromToken(modifier, $1, comment.VarToken) } ; @@ -1835,38 +2374,62 @@ member_modifier: T_PUBLIC { $$ = node.NewIdentifier($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.PublicToken) } | T_PROTECTED { $$ = node.NewIdentifier($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ProtectedToken) } | T_PRIVATE { $$ = node.NewIdentifier($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.PrivateToken) } | T_STATIC { $$ = node.NewIdentifier($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) } | T_ABSTRACT { $$ = node.NewIdentifier($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.AbstractToken) } | T_FINAL { $$ = node.NewIdentifier($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.FinalToken) } ; @@ -1874,66 +2437,66 @@ class_variable_declaration: class_variable_declaration ',' T_VARIABLE { identifier := node.NewIdentifier(strings.TrimLeft($3.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).comments.AddComments(identifier, $3.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).comments.AddComments(variable, $3.Comments()) - property := stmt.NewProperty(variable, nil, "") - yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).comments.AddComments(property, $3.Comments()) - $$ = append($1, property) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(variable, $3, comment.VariableToken) } | class_variable_declaration ',' T_VARIABLE '=' static_scalar { identifier := node.NewIdentifier(strings.TrimLeft($3.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).comments.AddComments(identifier, $3.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).comments.AddComments(variable, $3.Comments()) - property := stmt.NewProperty(variable, $5, "") - yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) - yylex.(*Parser).comments.AddComments(property, $3.Comments()) - $$ = append($1, property) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(variable, $3, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(property, $4, comment.EqualToken) } | T_VARIABLE { identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(identifier, $1.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - property := stmt.NewProperty(variable, nil, "") - yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(property, $1.Comments()) - $$ = []node.Node{property} + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) } | T_VARIABLE '=' static_scalar { identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(identifier, $1.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - property := stmt.NewProperty(variable, $3, "") - yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - yylex.(*Parser).comments.AddComments(property, $1.Comments()) - $$ = []node.Node{property} + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(property, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(property, $2, comment.EqualToken) } ; @@ -1941,37 +2504,47 @@ class_constant_declaration: class_constant_declaration ',' T_STRING '=' static_scalar { name := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).comments.AddComments(name, $3.Comments()) - constant := stmt.NewConstant(name, $5, "") - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) - yylex.(*Parser).comments.AddComments(constant, $3.Comments()) + constList := $1.(*stmt.ClassConstList) + constList.Consts = append(constList.Consts, constant) + $$ = $1 - $1.(*stmt.ClassConstList).Consts = append($1.(*stmt.ClassConstList).Consts, constant) + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) yylex.(*Parser).positions.AddPosition($1, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) - $$ = $1 + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode(constList.Consts), $2, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(name, $3, comment.IdentifierToken) + yylex.(*Parser).comments.AddFromToken(constant, $4, comment.EqualToken) } | T_CONST T_STRING '=' static_scalar { name := node.NewIdentifier($2.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).comments.AddComments(name, $2.Comments()) - constant := stmt.NewConstant(name, $4, "") - yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) - yylex.(*Parser).comments.AddComments(constant, $2.Comments()) - $$ = stmt.NewClassConstList(nil, []node.Node{constant}) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + yylex.(*Parser).positions.AddPosition(constant, yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstToken) + yylex.(*Parser).comments.AddFromToken(name, $2, comment.IdentifierToken) + yylex.(*Parser).comments.AddFromToken(constant, $3, comment.EqualToken) } ; echo_expr_list: echo_expr_list ',' expr - { $$ = append($1, $3) } + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + } | expr { $$ = []node.Node{$1} } ; @@ -1986,7 +2559,12 @@ for_expr: non_empty_for_expr: non_empty_for_expr ',' expr - { $$ = append($1, $3) } + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + } | expr { $$ = []node.Node{$1} } ; @@ -2002,16 +2580,26 @@ chaining_dereference: chaining_dereference '[' dim_offset ']' { fetch := expr.NewArrayDimFetch(nil, $3) + $$ = append($1, fetch) + + // save position yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($3)) - $$ = append($1, fetch) + // save comments + yylex.(*Parser).comments.AddFromToken(fetch, $2, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(fetch, $4, comment.CloseSquareBracket) } | '[' dim_offset ']' { fetch := expr.NewArrayDimFetch(nil, $2) + $$ = []node.Node{fetch} + + // save position yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($2)) - $$ = []node.Node{fetch} + // save comments + yylex.(*Parser).comments.AddFromToken(fetch, $1, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(fetch, $3, comment.CloseSquareBracket) } ; @@ -2043,7 +2631,8 @@ new_expr: yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) } - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NewToken) } ; @@ -2051,24 +2640,38 @@ expr_without_variable: T_LIST '(' assignment_list ')' '=' expr { list := expr.NewList($3) - yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) $$ = assign.NewAssign(list, $6) + + // save position + yylex.(*Parser).positions.AddPosition(list, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) - yylex.(*Parser).comments.AddComments(list, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(list, $1, comment.ListToken) + yylex.(*Parser).comments.AddFromToken(list, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(list, $4, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.EqualToken) } | variable '=' expr { $$ = assign.NewAssign($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) } | variable '=' '&' variable { $$ = assign.NewReference($1, $4) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.AmpersandToken) } | variable '=' '&' T_NEW class_name_reference ctor_arguments { @@ -2076,298 +2679,493 @@ expr_without_variable: if $6 != nil { _new = expr.NewNew($5, $6.(*node.ArgumentList)) - yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) } else { _new = expr.NewNew($5, nil) + } + $$ = assign.NewReference($1, _new) + + // save position + if $6 != nil { + yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) + } else { yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $5)) } - yylex.(*Parser).comments.AddComments(_new, yylex.(*Parser).comments[$1]) - - $$ = assign.NewReference($1, _new) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, _new)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.EqualToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.AmpersandToken) + yylex.(*Parser).comments.AddFromToken(_new, $4, comment.NewToken) } | T_CLONE expr { $$ = expr.NewClone($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.CloneToken) } | variable T_PLUS_EQUAL expr { $$ = assign.NewPlus($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PlusEqualToken) } | variable T_MINUS_EQUAL expr { $$ = assign.NewMinus($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.MinusEqualToken) } | variable T_MUL_EQUAL expr { $$ = assign.NewMul($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.MulEqualToken) } | variable T_POW_EQUAL expr { $$ = assign.NewPow($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PowEqualToken) } | variable T_DIV_EQUAL expr { $$ = assign.NewDiv($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.DivEqualToken) } | variable T_CONCAT_EQUAL expr { $$ = assign.NewConcat($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.ConcatEqualToken) } | variable T_MOD_EQUAL expr { $$ = assign.NewMod($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.ModEqualToken) } | variable T_AND_EQUAL expr { $$ = assign.NewBitwiseAnd($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AndEqualToken) } | variable T_OR_EQUAL expr { $$ = assign.NewBitwiseOr($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OrEqualToken) } | variable T_XOR_EQUAL expr { $$ = assign.NewBitwiseXor($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.XorEqualToken) } | variable T_SL_EQUAL expr { $$ = assign.NewShiftLeft($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlEqualToken) } | variable T_SR_EQUAL expr { $$ = assign.NewShiftRight($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SrEqualToken) } | rw_variable T_INC { $$ = expr.NewPostInc($1) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IncToken) } | T_INC rw_variable { $$ = expr.NewPreInc($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncToken) } | rw_variable T_DEC { $$ = expr.NewPostDec($1) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.DecToken) } | T_DEC rw_variable { $$ = expr.NewPreDec($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DecToken) } | expr T_BOOLEAN_OR expr { $$ = binary.NewBooleanOr($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanOrToken) } | expr T_BOOLEAN_AND expr { $$ = binary.NewBooleanAnd($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanAndToken) } | expr T_LOGICAL_OR expr { $$ = binary.NewLogicalOr($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalOrToken) } | expr T_LOGICAL_AND expr { $$ = binary.NewLogicalAnd($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalAndToken) } | expr T_LOGICAL_XOR expr { $$ = binary.NewLogicalXor($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalXorToken) } | expr '|' expr { $$ = binary.NewBitwiseOr($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.VerticalBarToken) } | expr '&' expr { $$ = binary.NewBitwiseAnd($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) } | expr '^' expr { $$ = binary.NewBitwiseXor($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.CaretToken) } | expr '.' expr { $$ = binary.NewConcat($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.DotToken) } | expr '+' expr { $$ = binary.NewPlus($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PlusToken) } | expr '-' expr { $$ = binary.NewMinus($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.MinusToken) } | expr '*' expr { $$ = binary.NewMul($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsteriskToken) } | expr T_POW expr { $$ = binary.NewPow($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PowToken) } | expr '/' expr { $$ = binary.NewDiv($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlashToken) } | expr '%' expr { $$ = binary.NewMod($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PercentToken) } | expr T_SL expr { $$ = binary.NewShiftLeft($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlToken) } | expr T_SR expr { $$ = binary.NewShiftRight($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SrToken) } | '+' expr %prec T_INC { $$ = expr.NewUnaryPlus($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.PlusToken) } | '-' expr %prec T_INC { $$ = expr.NewUnaryMinus($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.MinusToken) } | '!' expr { $$ = expr.NewBooleanNot($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExclamationMarkToken) } | '~' expr { $$ = expr.NewBitwiseNot($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.TildeToken) } | expr T_IS_IDENTICAL expr { $$ = binary.NewIdentical($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsIdenticalToken) } | expr T_IS_NOT_IDENTICAL expr { $$ = binary.NewNotIdentical($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotIdenticalToken) } | expr T_IS_EQUAL expr { $$ = binary.NewEqual($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsEqualToken) } | expr T_IS_NOT_EQUAL expr { $$ = binary.NewNotEqual($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotEqualToken) } | expr '<' expr { $$ = binary.NewSmaller($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.LessToken) } | expr T_IS_SMALLER_OR_EQUAL expr { $$ = binary.NewSmallerOrEqual($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsSmallerOrEqualToken) } | expr '>' expr { $$ = binary.NewGreater($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.GreaterToken) } | expr T_IS_GREATER_OR_EQUAL expr { $$ = binary.NewGreaterOrEqual($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsGreaterOrEqualToken) } | expr T_INSTANCEOF class_name_reference { $$ = expr.NewInstanceOf($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.InstanceofToken) } | parenthesis_expr { $$ = $1 } @@ -2381,95 +3179,156 @@ expr_without_variable: switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = $$ - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) - yylex.(*Parser).comments.AddComments(nn, $1.Comments()) $$ = nn case *expr.PropertyFetch: nn.Variable = $$ - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) - yylex.(*Parser).comments.AddComments(nn, $1.Comments()) $$ = nn case *expr.MethodCall: nn.Variable = $$ - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) - yylex.(*Parser).comments.AddComments(nn, $1.Comments()) $$ = nn } + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, n)) } + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) } | expr '?' expr ':' expr { $$ = expr.NewTernary($1, $3, $5) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.ColonToken) } | expr '?' ':' expr { $$ = expr.NewTernary($1, nil, $4) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.ColonToken) } | internal_functions_in_yacc { $$ = $1 } | T_INT_CAST expr { $$ = cast.NewInt($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.IntCastToken) } | T_DOUBLE_CAST expr { $$ = cast.NewDouble($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoubleCastToken) } | T_STRING_CAST expr { $$ = cast.NewString($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringCastToken) } | T_ARRAY_CAST expr { $$ = cast.NewArray($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayCastToken) } | T_OBJECT_CAST expr { $$ = cast.NewObject($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ObjectCastToken) } | T_BOOL_CAST expr { $$ = cast.NewBool($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.BoolCastToken) } | T_UNSET_CAST expr { $$ = cast.NewUnset($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.UnsetCastToken) } | T_EXIT exit_expr { if (strings.EqualFold($1.Value, "die")) { - $$ = expr.NewDie($2) + $$ = expr.NewDie(nil) + if $2 != nil { + $$.(*expr.Die).Expr = $2.(*expr.Exit).Expr + } } else { - $$ = expr.NewExit($2) + $$ = expr.NewExit(nil) + if $2 != nil { + $$.(*expr.Exit).Expr = $2.(*expr.Exit).Expr + } + } + + // save position + if $2 == nil { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + } else { + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + } + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExitToken) + + if $2 != nil { + yylex.(*Parser).comments.AddFromChildNode($$, $2) } - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) } | '@' expr { $$ = expr.NewErrorSuppress($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.AtToken) } | scalar { $$ = $1 } @@ -2480,34 +3339,68 @@ expr_without_variable: | '`' backticks_expr '`' { $$ = expr.NewShellExec($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.BackquoteToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.BackquoteToken) } | T_PRINT expr { $$ = expr.NewPrint($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.PrintToken) } | T_YIELD { $$ = expr.NewYield(nil, nil) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) } | function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { $$ = expr.NewClosure($4, $6, nil, $8, false, $2 != nil, "") + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.FunctionToken) + if $2 != nil { + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) + } + yylex.(*Parser).comments.AddFromToken($$, $3, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $7, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $9, comment.CloseCurlyBracesToken) } | T_STATIC function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { $$ = expr.NewClosure($5, $7, nil, $9, true, $3 != nil, "") + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $10)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.FunctionToken) + if $3 != nil { + yylex.(*Parser).comments.AddFromToken($$, $3, comment.AmpersandToken) + } + yylex.(*Parser).comments.AddFromToken($$, $4, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $8, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $10, comment.CloseCurlyBracesToken) } ; @@ -2515,26 +3408,44 @@ yield_expr: T_YIELD expr_without_variable { $$ = expr.NewYield(nil, $2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) } | T_YIELD variable { $$ = expr.NewYield(nil, $2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) } | T_YIELD expr T_DOUBLE_ARROW expr_without_variable { $$ = expr.NewYield($2, $4) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.DoubleArrowToken) } | T_YIELD expr T_DOUBLE_ARROW variable { $$ = expr.NewYield($2, $4) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.YieldToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.DoubleArrowToken) } ; @@ -2542,30 +3453,48 @@ combined_scalar_offset: combined_scalar '[' dim_offset ']' { $$ = expr.NewArrayDimFetch($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) } | combined_scalar_offset '[' dim_offset ']' { $$ = expr.NewArrayDimFetch($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) } | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' { str := scalar.NewString($1.Value) - yylex.(*Parser).positions.AddPosition(str, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(str, $1.Comments()) - $$ = expr.NewArrayDimFetch(str, $3) + + // save position + yylex.(*Parser).positions.AddPosition(str, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[str]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) } | general_constant '[' dim_offset ']' { $$ = expr.NewArrayDimFetch($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) } ; @@ -2573,14 +3502,25 @@ combined_scalar: T_ARRAY '(' array_pair_list ')' { $$ = expr.NewArray($3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) } | '[' array_pair_list ']' { $$ = expr.NewShortArray($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseSquareBracket) } ; @@ -2604,54 +3544,61 @@ lexical_var_list: lexical_var_list ',' T_VARIABLE { identifier := node.NewIdentifier(strings.TrimLeft($3.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).comments.AddComments(identifier, $3.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - yylex.(*Parser).comments.AddComments(variable, $3.Comments()) - $$ = append($1, variable) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(variable, $3, comment.VariableToken) } | lexical_var_list ',' '&' T_VARIABLE { identifier := node.NewIdentifier(strings.TrimLeft($4.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).comments.AddComments(identifier, $4.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - yylex.(*Parser).comments.AddComments(variable, $3.Comments()) - reference := expr.NewReference(variable) - $$ = append($1, reference) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(reference, $3, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(variable, $4, comment.VariableToken) } | T_VARIABLE { identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(identifier, $1.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - $$ = []node.Node{variable} + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) } | '&' T_VARIABLE { identifier := node.NewIdentifier(strings.TrimLeft($2.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).comments.AddComments(identifier, $2.Comments()) - variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - reference := expr.NewReference(variable) - $$ = []node.Node{reference} + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddFromToken(reference, $1, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken(variable, $2, comment.VariableToken) } ; @@ -2659,62 +3606,83 @@ function_call: namespace_name function_call_parameter_list { name := name.NewName($1) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($1)) - $$ = expr.NewFunctionCall(name, $2.(*node.ArgumentList)) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition(name, $2)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[name]) } | T_NAMESPACE T_NS_SEPARATOR namespace_name function_call_parameter_list { funcName := name.NewRelative($3) - yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - yylex.(*Parser).comments.AddComments(funcName, $1.Comments()) - $$ = expr.NewFunctionCall(funcName, $4.(*node.ArgumentList)) + + // save position + yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[funcName]) + + // save comments + yylex.(*Parser).comments.AddFromToken(funcName, $1, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken(funcName, $2, comment.NsSeparatorToken) } | T_NS_SEPARATOR namespace_name function_call_parameter_list { funcName := name.NewFullyQualified($2) - yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - yylex.(*Parser).comments.AddComments(funcName, $1.Comments()) - $$ = expr.NewFunctionCall(funcName, $3.(*node.ArgumentList)) + + // save position + yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[funcName]) + + // save comments + yylex.(*Parser).comments.AddFromToken(funcName, $1, comment.NsSeparatorToken) } | class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list { $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } | class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list { $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list { $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list { $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } | variable_without_objects function_call_parameter_list { $$ = expr.NewFunctionCall($1, $2.(*node.ArgumentList)) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) } ; @@ -2722,26 +3690,40 @@ class_name: T_STATIC { $$ = node.NewIdentifier($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StaticToken) } | namespace_name { $$ = name.NewName($1) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = name.NewRelative($3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.NsSeparatorToken) } | T_NS_SEPARATOR namespace_name { $$ = name.NewFullyQualified($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) } ; @@ -2749,20 +3731,30 @@ fully_qualified_class_name: namespace_name { $$ = name.NewName($1) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).listGetFirstNodeComments($1)) } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = name.NewRelative($3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.NsSeparatorToken) } | T_NS_SEPARATOR namespace_name { $$ = name.NewFullyQualified($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) } ; @@ -2778,18 +3770,19 @@ dynamic_class_name_reference: { $$ = $1 + // save comments + yylex.(*Parser).comments.AddFromToken($3[0], $2, comment.ObjectOperatorToken) + for _, n := range($3) { switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = $$ yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[$1]) $$ = nn case *expr.PropertyFetch: nn.Variable = $$ yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[$1]) $$ = nn } } @@ -2799,13 +3792,11 @@ dynamic_class_name_reference: case *expr.ArrayDimFetch: nn.Variable = $$ yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[$1]) $$ = nn case *expr.PropertyFetch: nn.Variable = $$ yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[$1]) $$ = nn } } @@ -2825,16 +3816,35 @@ dynamic_class_name_variable_properties: dynamic_class_name_variable_property: T_OBJECT_OPERATOR object_property - { $$ = $2 } + { + $$ = $2 + + // save comments + yylex.(*Parser).comments.AddFromToken($2[0], $1, comment.ObjectOperatorToken) + } ; exit_expr: /* empty */ { $$ = nil } | '(' ')' - { $$ = nil } + { + $$ = expr.NewExit(nil); + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.CloseParenthesisToken) + } | parenthesis_expr - { $$ = $1 } + { + $$ = expr.NewExit($1); + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) + } ; backticks_expr: @@ -2857,78 +3867,124 @@ common_scalar: T_LNUMBER { $$ = scalar.NewLnumber($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.LnumberToken) } | T_DNUMBER { $$ = scalar.NewDnumber($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DnumberToken) } | T_CONSTANT_ENCAPSED_STRING { $$ = scalar.NewString($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ConstantEncapsedStringToken) } | T_LINE { $$ = scalar.NewMagicConstant($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.LineToken) } | T_FILE { $$ = scalar.NewMagicConstant($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.FileToken) } | T_DIR { $$ = scalar.NewMagicConstant($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DirToken) } | T_TRAIT_C { $$ = scalar.NewMagicConstant($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.TraitCToken) } | T_METHOD_C { $$ = scalar.NewMagicConstant($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.MethodCToken) } | T_FUNC_C { $$ = scalar.NewMagicConstant($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.FuncCToken) } | T_NS_C { $$ = scalar.NewMagicConstant($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsCToken) } - | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC + | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { encapsed := scalar.NewEncapsedStringPart($2.Value) - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).comments.AddComments(encapsed, $2.Comments()) - $$ = scalar.NewHeredoc($1.Value, []node.Node{encapsed}) + + // save position + yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) } | T_START_HEREDOC T_END_HEREDOC { $$ = scalar.NewHeredoc($1.Value, nil) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) } ; @@ -2936,12 +3992,15 @@ static_class_constant: class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { target := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) $$ = expr.NewClassConstFetch($1, target) + + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - yylex.(*Parser).comments.AddComments(target, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) + yylex.(*Parser).comments.AddFromToken(target, $3, comment.IdentifierToken) } ; @@ -2958,52 +4017,71 @@ static_scalar_value: | namespace_name { name := name.NewName($1) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($1)) - $$ = expr.NewConstFetch(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition(name)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[name]) } | T_NAMESPACE T_NS_SEPARATOR namespace_name { name := name.NewRelative($3) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - yylex.(*Parser).comments.AddComments(name, $1.Comments()) - $$ = expr.NewConstFetch(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[name]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.NsSeparatorToken) } | T_NS_SEPARATOR namespace_name { name := name.NewFullyQualified($2) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - yylex.(*Parser).comments.AddComments(name, $1.Comments()) - $$ = expr.NewConstFetch(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[name]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) } | T_ARRAY '(' static_array_pair_list ')' { $$ = expr.NewArray($3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ArrayToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) } | '[' static_array_pair_list ']' { $$ = expr.NewShortArray($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseSquareBracket) } | static_class_constant { $$ = $1 } | T_CLASS_C { $$ = scalar.NewMagicConstant($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassCToken) } | static_operation { $$ = $1 } @@ -3013,197 +4091,334 @@ static_operation: static_scalar_value '[' static_scalar_value ']' { $$ = expr.NewArrayDimFetch($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) } | static_scalar_value '+' static_scalar_value { $$ = binary.NewPlus($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PlusToken) } | static_scalar_value '-' static_scalar_value { $$ = binary.NewMinus($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.MinusToken) } | static_scalar_value '*' static_scalar_value { $$ = binary.NewMul($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AsteriskToken) } | static_scalar_value T_POW static_scalar_value { $$ = binary.NewPow($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PowToken) } | static_scalar_value '/' static_scalar_value { $$ = binary.NewDiv($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlashToken) } | static_scalar_value '%' static_scalar_value { $$ = binary.NewMod($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PercentToken) } | '!' static_scalar_value { $$ = expr.NewBooleanNot($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ExclamationMarkToken) } | '~' static_scalar_value { $$ = expr.NewBitwiseNot($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.TildeToken) } | static_scalar_value '|' static_scalar_value { $$ = binary.NewBitwiseOr($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.VerticalBarToken) } | static_scalar_value '&' static_scalar_value { $$ = binary.NewBitwiseAnd($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.AmpersandToken) } | static_scalar_value '^' static_scalar_value { $$ = binary.NewBitwiseXor($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.CaretToken) } | static_scalar_value T_SL static_scalar_value { $$ = binary.NewShiftLeft($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SlToken) } | static_scalar_value T_SR static_scalar_value { $$ = binary.NewShiftRight($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.SrToken) } | static_scalar_value '.' static_scalar_value { $$ = binary.NewConcat($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.DotToken) } | static_scalar_value T_LOGICAL_XOR static_scalar_value { $$ = binary.NewLogicalXor($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalXorToken) } | static_scalar_value T_LOGICAL_AND static_scalar_value { $$ = binary.NewLogicalAnd($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalAndToken) } | static_scalar_value T_LOGICAL_OR static_scalar_value { $$ = binary.NewLogicalOr($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.LogicalOrToken) } | static_scalar_value T_BOOLEAN_AND static_scalar_value { $$ = binary.NewBooleanAnd($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanAndToken) } | static_scalar_value T_BOOLEAN_OR static_scalar_value { $$ = binary.NewBooleanOr($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.BooleanOrToken) } | static_scalar_value T_IS_IDENTICAL static_scalar_value { $$ = binary.NewIdentical($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsIdenticalToken) } | static_scalar_value T_IS_NOT_IDENTICAL static_scalar_value { $$ = binary.NewNotIdentical($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotIdenticalToken) } | static_scalar_value T_IS_EQUAL static_scalar_value { $$ = binary.NewEqual($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsEqualToken) } | static_scalar_value T_IS_NOT_EQUAL static_scalar_value { $$ = binary.NewNotEqual($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsNotEqualToken) } | static_scalar_value '<' static_scalar_value { $$ = binary.NewSmaller($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.LessToken) } | static_scalar_value '>' static_scalar_value { $$ = binary.NewGreater($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.GreaterToken) } | static_scalar_value T_IS_SMALLER_OR_EQUAL static_scalar_value { $$ = binary.NewSmallerOrEqual($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsSmallerOrEqualToken) } | static_scalar_value T_IS_GREATER_OR_EQUAL static_scalar_value { $$ = binary.NewGreaterOrEqual($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.IsGreaterOrEqualToken) } | static_scalar_value '?' ':' static_scalar_value { $$ = expr.NewTernary($1, nil, $4) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.ColonToken) } | static_scalar_value '?' static_scalar_value ':' static_scalar_value { $$ = expr.NewTernary($1, $3, $5) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.QuestionMarkToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.ColonToken) } | '+' static_scalar_value { $$ = expr.NewUnaryPlus($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.PlusToken) } | '-' static_scalar_value { $$ = expr.NewUnaryMinus($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.MinusToken) } | '(' static_scalar_value ')' - { $$ = $2 } + { + $$ = $2 + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseParenthesisToken) + } ; general_constant: @@ -3212,32 +4427,34 @@ general_constant: | namespace_name { name := name.NewName($1) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($1)) - $$ = expr.NewConstFetch(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition(name)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[name]) } | T_NAMESPACE T_NS_SEPARATOR namespace_name { name := name.NewRelative($3) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - yylex.(*Parser).comments.AddComments(name, $1.Comments()) - $$ = expr.NewConstFetch(name) + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition(name)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[name]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NamespaceToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.NsSeparatorToken) } | T_NS_SEPARATOR namespace_name { name := name.NewFullyQualified($2) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - yylex.(*Parser).comments.AddComments(name, $1.Comments()) - $$ = expr.NewConstFetch(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition(name)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[name]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NsSeparatorToken) } ; @@ -3245,12 +4462,14 @@ scalar: T_STRING_VARNAME { name := node.NewIdentifier($1.Value) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) $$ = expr.NewVariable(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(name, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(name, $1, comment.StringVarnameToken) } | general_constant { $$ = $1 } @@ -3261,20 +4480,32 @@ scalar: | '"' encaps_list '"' { $$ = scalar.NewEncapsed($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DoubleQuoteToken) } | T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = scalar.NewHeredoc($1.Value, $2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StartHeredocToken) } | T_CLASS_C { $$ = scalar.NewMagicConstant($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.ClassCToken) } ; @@ -3282,46 +4513,65 @@ static_array_pair_list: /* empty */ { $$ = nil } | non_empty_static_array_pair_list possible_comma - { $$ = $1 } + { + $$ = $1 + + // save comments + if $2 != nil { + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + } + } ; possible_comma: /* empty */ + { $$ = nil } | ',' + { $$ = $1 } ; non_empty_static_array_pair_list: non_empty_static_array_pair_list ',' static_scalar_value T_DOUBLE_ARROW static_scalar_value { arrayItem := expr.NewArrayItem($3, $5) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$3]) - $$ = append($1, arrayItem) + + // save position + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(arrayItem, $4, comment.DoubleArrowToken) } | non_empty_static_array_pair_list ',' static_scalar_value { arrayItem := expr.NewArrayItem(nil, $3) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition($3)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$3]) - $$ = append($1, arrayItem) + + // save position + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition($3)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } | static_scalar_value T_DOUBLE_ARROW static_scalar_value { arrayItem := expr.NewArrayItem($1, $3) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$1]) - $$ = []node.Node{arrayItem} + + // save position + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddFromToken(arrayItem, $2, comment.DoubleArrowToken) } | static_scalar_value { arrayItem := expr.NewArrayItem(nil, $1) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition($1)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$1]) - $$ = []node.Node{arrayItem} + + // save position + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition($1)) } ; @@ -3366,24 +4616,24 @@ variable: $3 = append($3[:len($3)-1], $4...) } + // save comments + yylex.(*Parser).comments.AddFromToken($3[0], $2, comment.ObjectOperatorToken) + for _, n := range($3) { switch nn := n.(type) { case *expr.ArrayDimFetch: nn.Variable = $$ yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[$1]) $$ = nn case *expr.PropertyFetch: nn.Variable = $$ yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[$1]) $$ = nn case *expr.MethodCall: nn.Variable = $$ yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[$1]) $$ = nn } } @@ -3393,19 +4643,16 @@ variable: case *expr.ArrayDimFetch: nn.Variable = $$ yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[$1]) $$ = nn case *expr.PropertyFetch: nn.Variable = $$ yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[$1]) $$ = nn case *expr.MethodCall: nn.Variable = $$ yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) - yylex.(*Parser).comments.AddComments(nn, yylex.(*Parser).comments[$1]) $$ = nn } } @@ -3431,6 +4678,9 @@ variable_property: } $$ = $2 + + // save comments + yylex.(*Parser).comments.AddFromToken($2[0], $1, comment.ObjectOperatorToken) } ; @@ -3438,16 +4688,26 @@ array_method_dereference: array_method_dereference '[' dim_offset ']' { fetch := expr.NewArrayDimFetch(nil, $3) + $$ = append($1, fetch) + + // save position yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($3)) - $$ = append($1, fetch) + // save comments + yylex.(*Parser).comments.AddFromToken(fetch, $2, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(fetch, $4, comment.CloseSquareBracket) } | method '[' dim_offset ']' { fetch := expr.NewArrayDimFetch(nil, $3) + $$ = []node.Node{$1, fetch} + + // save position yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($3)) - $$ = []node.Node{$1, fetch} + // save comments + yylex.(*Parser).comments.AddFromToken(fetch, $2, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(fetch, $4, comment.CloseSquareBracket) } ; @@ -3455,6 +4715,8 @@ method: function_call_parameter_list { $$ = expr.NewMethodCall(nil, nil, $1.(*node.ArgumentList)) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) } ; @@ -3487,14 +4749,22 @@ static_member: class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { $$ = expr.NewStaticPropertyFetch($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { $$ = expr.NewStaticPropertyFetch($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } ; @@ -3508,14 +4778,24 @@ array_function_dereference: array_function_dereference '[' dim_offset ']' { $$ = expr.NewArrayDimFetch($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) } | function_call '[' dim_offset ']' { $$ = expr.NewArrayDimFetch($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) } ; @@ -3547,14 +4827,24 @@ reference_variable: reference_variable '[' dim_offset ']' { $$ = expr.NewArrayDimFetch($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) } | reference_variable '{' expr '}' { $$ = expr.NewArrayDimFetch($1, $3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) } | compound_variable { $$ = $1 } @@ -3565,18 +4855,26 @@ compound_variable: T_VARIABLE { name := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) $$ = expr.NewVariable(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(name, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) } | '$' '{' expr '}' { $$ = expr.NewVariable($3) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseCurlyBracesToken) } ; @@ -3594,9 +4892,10 @@ object_property: | variable_without_objects { fetch := expr.NewPropertyFetch(nil, $1) - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($1)) - $$ = []node.Node{fetch} + + // save position + yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($1)) } ; @@ -3604,23 +4903,34 @@ object_dim_list: object_dim_list '[' dim_offset ']' { fetch := expr.NewArrayDimFetch(nil, $3) + $$ = append($1, fetch) + + // save position yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($3)) - $$ = append($1, fetch) + // save comments + yylex.(*Parser).comments.AddFromToken(fetch, $2, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken(fetch, $4, comment.CloseSquareBracket) } | object_dim_list '{' expr '}' { fetch := expr.NewArrayDimFetch(nil, $3) + $$ = append($1, fetch) + + // save position yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($3)) - $$ = append($1, fetch) + // save comments + yylex.(*Parser).comments.AddFromToken(fetch, $2, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(fetch, $4, comment.CloseCurlyBracesToken) } | variable_name { fetch := expr.NewPropertyFetch(nil, $1) - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($1)) - $$ = []node.Node{fetch} + + // save position + yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewNodePosition($1)) } ; @@ -3628,39 +4938,63 @@ variable_name: T_STRING { $$ = node.NewIdentifier($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringToken) } | '{' expr '}' - { $$ = $2 } + { + $$ = $2 + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) + } ; simple_indirect_reference: '$' { n := expr.NewVariable(nil) - yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(n, $1.Comments()) - $$ = simpleIndirectReference{[]*expr.Variable{n}, n} + + // save position + yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddFromToken(n, $1, comment.DollarToken) } | simple_indirect_reference '$' { n := expr.NewVariable(nil) - yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - yylex.(*Parser).comments.AddComments(n, $2.Comments()) $1.last.SetVarName(n) - $1.all = append($1.all, n) $1.last = n $$ = $1 + + // save position + yylex.(*Parser).positions.AddPosition(n, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + + // save comments + yylex.(*Parser).comments.AddFromToken(n, $2, comment.DollarToken) } ; assignment_list: assignment_list ',' assignment_list_element - { $$ = append($1, $3) } + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + } | assignment_list_element { if $1 == nil { @@ -3676,18 +5010,23 @@ assignment_list_element: variable { $$ = expr.NewArrayItem(nil, $1) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) } | T_LIST '(' assignment_list ')' { item := expr.NewList($3) - yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments(item, $1.Comments()) - $$ = expr.NewArrayItem(nil, item) + + // save position + yylex.(*Parser).positions.AddPosition(item, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition(item)) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[item]) + + // save comments + yylex.(*Parser).comments.AddFromToken(item, $1, comment.ListToken) + yylex.(*Parser).comments.AddFromToken(item, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(item, $4, comment.CloseParenthesisToken) } | /* empty */ { $$ = nil } @@ -3698,77 +5037,114 @@ array_pair_list: /* empty */ { $$ = []node.Node{} } | non_empty_array_pair_list possible_comma - { $$ = $1 } + { + $$ = $1 + + // save comments + if $2 != nil { + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + } + } ; non_empty_array_pair_list: non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { arrayItem := expr.NewArrayItem($3, $5) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$3]) - $$ = append($1, arrayItem) + + // save position + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(arrayItem, $4, comment.DoubleArrowToken) } | non_empty_array_pair_list ',' expr { arrayItem := expr.NewArrayItem(nil, $3) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition($3)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$3]) - $$ = append($1, arrayItem) + + // save position + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition($3)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) } | expr T_DOUBLE_ARROW expr { arrayItem := expr.NewArrayItem($1, $3) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$1]) - $$ = []node.Node{arrayItem} + + // save position + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddFromToken(arrayItem, $2, comment.DoubleArrowToken) } | expr { arrayItem := expr.NewArrayItem(nil, $1) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition($1)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$1]) - $$ = []node.Node{arrayItem} + + // save position + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodePosition($1)) } | non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_variable { reference := expr.NewReference($6) arrayItem := expr.NewArrayItem($3, reference) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($3, $6)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$3]) - $$ = append($1, arrayItem) + + // save position + yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokenNodePosition($5, $6)) + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($3, $6)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(arrayItem, $4, comment.DoubleArrowToken) + yylex.(*Parser).comments.AddFromToken(reference, $5, comment.AmpersandToken) } | non_empty_array_pair_list ',' '&' w_variable { reference := expr.NewReference($4) arrayItem := expr.NewArrayItem(nil, reference) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) - yylex.(*Parser).comments.AddComments(arrayItem, $3.Comments()) - $$ = append($1, arrayItem) + + // save position + yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + yylex.(*Parser).comments.AddFromToken(reference, $3, comment.AmpersandToken) } | expr T_DOUBLE_ARROW '&' w_variable { reference := expr.NewReference($4) arrayItem := expr.NewArrayItem($1, reference) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - yylex.(*Parser).comments.AddComments(arrayItem, yylex.(*Parser).comments[$1]) - $$ = []node.Node{arrayItem} + + // save position + yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken(arrayItem, $2, comment.DoubleArrowToken) + yylex.(*Parser).comments.AddFromToken(reference, $3, comment.AmpersandToken) } | '&' w_variable { reference := expr.NewReference($2) arrayItem := expr.NewArrayItem(nil, reference) - yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments(arrayItem, $1.Comments()) - $$ = []node.Node{arrayItem} + + // save position + yylex.(*Parser).positions.AddPosition(reference, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + yylex.(*Parser).positions.AddPosition(arrayItem, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddFromToken(reference, $1, comment.AmpersandToken) } ; @@ -3778,18 +5154,26 @@ encaps_list: | encaps_list T_ENCAPSED_AND_WHITESPACE { encapsed := scalar.NewEncapsedStringPart($2.Value) - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) $$ = append($1, encapsed) - yylex.(*Parser).comments.AddComments(encapsed, $2.Comments()) + + // save position + yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + + // save comments + yylex.(*Parser).comments.AddFromToken(encapsed, $2, comment.EncapsedAndWhitespaceToken) } | encaps_var { $$ = []node.Node{$1} } | T_ENCAPSED_AND_WHITESPACE encaps_var { encapsed := scalar.NewEncapsedStringPart($1.Value) - yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) $$ = []node.Node{encapsed, $2} - yylex.(*Parser).comments.AddComments(encapsed, $1.Comments()) + + // save position + yylex.(*Parser).positions.AddPosition(encapsed, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddFromToken(encapsed, $1, comment.EncapsedAndWhitespaceToken) } ; @@ -3797,153 +5181,239 @@ encaps_var: T_VARIABLE { name := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) $$ = expr.NewVariable(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(name, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) } | T_VARIABLE '[' encaps_var_offset ']' { identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) $$ = expr.NewArrayDimFetch(variable, $3) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments(identifier, $1.Comments()) - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseSquareBracket) } | T_VARIABLE T_OBJECT_OPERATOR T_STRING { identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) fetch := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) $$ = expr.NewPropertyFetch(variable, fetch) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + yylex.(*Parser).positions.AddPosition(fetch, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - yylex.(*Parser).comments.AddComments(identifier, $1.Comments()) - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments(fetch, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken(variable, $1, comment.VariableToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.ObjectOperatorToken) + yylex.(*Parser).comments.AddFromToken(fetch, $3, comment.StringToken) } | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { - $$ = $2 + $$ = expr.NewVariable($2) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) + } + | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' + { + name := node.NewIdentifier($2.Value) + $$ = expr.NewVariable(name) + + // save position + yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(name, $2, comment.StringVarnameToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CloseCurlyBracesToken) } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { identifier := node.NewIdentifier($2.Value) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) variable := expr.NewVariable(identifier) - yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) $$ = expr.NewArrayDimFetch(variable, $4) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + yylex.(*Parser).positions.AddPosition(variable, yylex.(*Parser).positionBuilder.NewTokenPosition($2)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) - - yylex.(*Parser).comments.AddComments(identifier, $2.Comments()) - yylex.(*Parser).comments.AddComments(variable, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.DollarOpenCurlyBracesToken) + yylex.(*Parser).comments.AddFromToken(variable, $2, comment.StringVarnameToken) + yylex.(*Parser).comments.AddFromToken($$, $3, comment.OpenSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $5, comment.CloseSquareBracket) + yylex.(*Parser).comments.AddFromToken($$, $6, comment.CloseCurlyBracesToken) } | T_CURLY_OPEN variable '}' - { $$ = $2; } + { + $$ = $2; + } ; encaps_var_offset: T_STRING { $$ = scalar.NewString($1.Value) + + // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.StringToken) } | T_NUM_STRING { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi($1.Value); err == nil { $$ = scalar.NewLnumber($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) } else { $$ = scalar.NewString($1.Value) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) } - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.NumStringToken) } | T_VARIABLE { identifier := node.NewIdentifier(strings.TrimLeft($1.Value, "$")) - yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) $$ = expr.NewVariable(identifier) + + // save position + yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - yylex.(*Parser).comments.AddComments(identifier, $1.Comments()) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.VariableToken) } ; internal_functions_in_yacc: - T_ISSET '(' isset_variables ')' - { - $$ = expr.NewIsset($3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + T_ISSET '(' isset_variables ')' + { + $$ = expr.NewIsset($3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.IssetToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + } | T_EMPTY '(' variable ')' - { - $$ = expr.NewEmpty($3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } - | T_EMPTY '(' expr_without_variable ')' - { - $$ = expr.NewEmpty($3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewEmpty($3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.EmptyToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + } + | T_EMPTY '(' expr ')' + { + $$ = expr.NewEmpty($3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.EmptyToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + } | T_INCLUDE expr - { - $$ = expr.NewInclude($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewInclude($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncludeToken) + } | T_INCLUDE_ONCE expr - { - $$ = expr.NewIncludeOnce($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewIncludeOnce($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.IncludeOnceToken) + } | T_EVAL '(' expr ')' - { - $$ = expr.NewEval($3) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewEval($3) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.EvalToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) + } | T_REQUIRE expr - { - $$ = expr.NewRequire($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewRequire($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.RequireToken) + } | T_REQUIRE_ONCE expr - { - $$ = expr.NewRequireOnce($2) - yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - yylex.(*Parser).comments.AddComments($$, $1.Comments()) - } + { + $$ = expr.NewRequireOnce($2) + + // save position + yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.RequireOnceToken) + } ; isset_variables: isset_variable { $$ = []node.Node{$1} } | isset_variables ',' isset_variable - { $$ = append($1, $3) } + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).comments.AddFromToken(lastNode($1), $2, comment.CommaToken) + } ; isset_variable: @@ -3957,22 +5427,26 @@ class_constant: class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { target := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) $$ = expr.NewClassConstFetch($1, target) + + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - yylex.(*Parser).comments.AddComments(target, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { target := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) $$ = expr.NewClassConstFetch($1, target) + + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - yylex.(*Parser).comments.AddComments(target, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } ; @@ -3980,12 +5454,14 @@ static_class_name_scalar: class_name T_PAAMAYIM_NEKUDOTAYIM T_CLASS { target := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) $$ = expr.NewClassConstFetch($1, target) + + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - yylex.(*Parser).comments.AddComments(target, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } ; @@ -3993,12 +5469,14 @@ class_name_scalar: class_name T_PAAMAYIM_NEKUDOTAYIM T_CLASS { target := node.NewIdentifier($3.Value) - yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) $$ = expr.NewClassConstFetch($1, target) + + // save position + yylex.(*Parser).positions.AddPosition(target, yylex.(*Parser).positionBuilder.NewTokenPosition($3)) yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - yylex.(*Parser).comments.AddComments(target, $3.Comments()) - yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1]) + // save comments + yylex.(*Parser).comments.AddFromToken($$, $2, comment.PaamayimNekudotayimToken) } ; diff --git a/php7/parser.go b/php7/parser.go index 7dad2bc..476c794 100644 --- a/php7/parser.go +++ b/php7/parser.go @@ -96,11 +96,6 @@ func (l *Parser) GetPositions() parser.Positions { return l.positions } -func (l *Parser) setCommentsFromChildNode(n node.Node, c node.Node) { - l.comments.AddComments(n, l.comments[c]) - delete(l.comments, c) -} - // helpers func lastNode(nn []node.Node) node.Node { diff --git a/php7/php7.go b/php7/php7.go index 0dba5ce..87a00fb 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -346,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line php7/php7.y:4311 +//line php7/php7.y:4306 //line yacctab:1 var yyExca = [...]int{ @@ -4168,16 +4168,7 @@ yydefault: { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) - - if yyDollar[1].node != nil { - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].token != nil, yyDollar[3].token != nil) - } else if yyDollar[2].token != nil { - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].token != nil, yyDollar[3].token != nil) - } else if yyDollar[3].token != nil { - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].token != nil, yyDollar[3].token != nil) - } else { - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].token != nil, yyDollar[3].token != nil) - } + yyVAL.node = node.NewParameter(yyDollar[1].node, variable, nil, yyDollar[2].token != nil, yyDollar[3].token != nil) // save position yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -4203,19 +4194,11 @@ yydefault: } case 217: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:1731 + //line php7/php7.y:1722 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[4].token.Value, "$")) variable := expr.NewVariable(identifier) - if yyDollar[1].node != nil { - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].token != nil, yyDollar[3].token != nil) - } else if yyDollar[2].token != nil { - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].token != nil, yyDollar[3].token != nil) - } else if yyDollar[3].token != nil { - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].token != nil, yyDollar[3].token != nil) - } else { - yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].token != nil, yyDollar[3].token != nil) - } + yyVAL.node = node.NewParameter(yyDollar[1].node, variable, yyDollar[6].node, yyDollar[2].token != nil, yyDollar[3].token != nil) // save position yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition(yyDollar[4].token)) @@ -4242,25 +4225,25 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1771 + //line php7/php7.y:1754 { yyVAL.node = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1773 + //line php7/php7.y:1756 { yyVAL.node = yyDollar[1].node } case 220: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1778 + //line php7/php7.y:1761 { yyVAL.node = yyDollar[1].node } case 221: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1780 + //line php7/php7.y:1763 { yyVAL.node = node.NewNullable(yyDollar[2].node) @@ -4272,7 +4255,7 @@ yydefault: } case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1793 + //line php7/php7.y:1776 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4284,7 +4267,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1803 + //line php7/php7.y:1786 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4296,19 +4279,19 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1813 + //line php7/php7.y:1796 { yyVAL.node = yyDollar[1].node } case 225: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1818 + //line php7/php7.y:1801 { yyVAL.node = nil } case 226: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1820 + //line php7/php7.y:1803 { yyVAL.node = yyDollar[2].node @@ -4317,31 +4300,42 @@ yydefault: } case 227: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1830 + //line php7/php7.y:1813 { yyVAL.node = node.NewArgumentList(nil) // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[2].token, comment.CloseParenthesisToken) } case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1837 + //line php7/php7.y:1824 { yyVAL.node = node.NewArgumentList(yyDollar[2].list) // save position yylex.(*Parser).positions.AddPosition(yyVAL.node, yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) + + // save comments + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[1].token, comment.OpenParenthesisToken) + if yyDollar[3].token != nil { + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[3].token, comment.CommaToken) + } + yylex.(*Parser).comments.AddFromToken(yyVAL.node, yyDollar[4].token, comment.CloseParenthesisToken) } case 229: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1847 + //line php7/php7.y:1841 { yyVAL.list = []node.Node{yyDollar[1].node} } case 230: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1849 + //line php7/php7.y:1843 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4350,7 +4344,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1859 + //line php7/php7.y:1853 { yyVAL.node = node.NewArgument(yyDollar[1].node, false, false) @@ -4359,7 +4353,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1866 + //line php7/php7.y:1860 { yyVAL.node = node.NewArgument(yyDollar[2].node, true, false) @@ -4371,7 +4365,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1879 + //line php7/php7.y:1873 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4380,19 +4374,19 @@ yydefault: } case 234: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1886 + //line php7/php7.y:1880 { yyVAL.list = []node.Node{yyDollar[1].node} } case 235: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1891 + //line php7/php7.y:1885 { yyVAL.node = yyDollar[1].node } case 236: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1896 + //line php7/php7.y:1890 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4401,13 +4395,13 @@ yydefault: } case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1903 + //line php7/php7.y:1897 { yyVAL.list = []node.Node{yyDollar[1].node} } case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:1908 + //line php7/php7.y:1902 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4423,7 +4417,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1922 + //line php7/php7.y:1916 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4440,19 +4434,19 @@ yydefault: } case 240: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:1940 + //line php7/php7.y:1934 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 241: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:1942 + //line php7/php7.y:1936 { yyVAL.list = []node.Node{} } case 242: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1947 + //line php7/php7.y:1941 { yyVAL.node = stmt.NewPropertyList(yyDollar[1].list, yyDollar[2].list) @@ -4464,7 +4458,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:1957 + //line php7/php7.y:1951 { yyVAL.node = stmt.NewClassConstList(yyDollar[1].list, yyDollar[3].list) @@ -4477,7 +4471,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:1968 + //line php7/php7.y:1962 { var adaptationList *stmt.TraitAdaptationList @@ -4499,7 +4493,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-10 : yypt+1] - //line php7/php7.y:1988 + //line php7/php7.y:1982 { name := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewClassMethod(name, yyDollar[1].list, yyDollar[3].token != nil, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node, yyDollar[5].str) @@ -4523,13 +4517,13 @@ yydefault: } case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2013 + //line php7/php7.y:2007 { yyVAL.list = []node.Node{yyDollar[1].node} } case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2015 + //line php7/php7.y:2009 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4538,7 +4532,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2025 + //line php7/php7.y:2019 { yyVAL.node = stmt.NewNop() @@ -4550,7 +4544,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2035 + //line php7/php7.y:2029 { yyVAL.node = stmt.NewTraitAdaptationList(nil) @@ -4562,7 +4556,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2045 + //line php7/php7.y:2039 { yyVAL.node = stmt.NewTraitAdaptationList(yyDollar[2].list) @@ -4574,19 +4568,19 @@ yydefault: } case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2058 + //line php7/php7.y:2052 { yyVAL.list = []node.Node{yyDollar[1].node} } case 252: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2060 + //line php7/php7.y:2054 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 253: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2065 + //line php7/php7.y:2059 { yyVAL.node = yyDollar[1].node @@ -4595,7 +4589,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2072 + //line php7/php7.y:2066 { yyVAL.node = yyDollar[1].node @@ -4604,7 +4598,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2082 + //line php7/php7.y:2076 { yyVAL.node = stmt.NewTraitUsePrecedence(yyDollar[1].node, yyDollar[3].list) @@ -4616,7 +4610,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2095 + //line php7/php7.y:2089 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4631,7 +4625,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2108 + //line php7/php7.y:2102 { alias := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, nil, alias) @@ -4646,7 +4640,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2121 + //line php7/php7.y:2115 { alias := node.NewIdentifier(yyDollar[4].token.Value) yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, alias) @@ -4661,7 +4655,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2134 + //line php7/php7.y:2128 { yyVAL.node = stmt.NewTraitUseAlias(yyDollar[1].node, yyDollar[3].node, nil) @@ -4673,7 +4667,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2147 + //line php7/php7.y:2141 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewTraitMethodRef(nil, name) @@ -4687,13 +4681,13 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2159 + //line php7/php7.y:2153 { yyVAL.node = yyDollar[1].node } case 262: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2164 + //line php7/php7.y:2158 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = stmt.NewTraitMethodRef(yyDollar[1].node, target) @@ -4708,7 +4702,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2180 + //line php7/php7.y:2174 { yyVAL.node = stmt.NewNop() @@ -4720,7 +4714,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2190 + //line php7/php7.y:2184 { yyVAL.node = stmt.NewStmtList(yyDollar[2].list) @@ -4733,13 +4727,13 @@ yydefault: } case 265: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2204 + //line php7/php7.y:2198 { yyVAL.list = yyDollar[1].list } case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2206 + //line php7/php7.y:2200 { modifier := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.list = []node.Node{modifier} @@ -4752,31 +4746,31 @@ yydefault: } case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2220 + //line php7/php7.y:2214 { yyVAL.list = nil } case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2222 + //line php7/php7.y:2216 { yyVAL.list = yyDollar[1].list } case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2227 + //line php7/php7.y:2221 { yyVAL.list = []node.Node{yyDollar[1].node} } case 270: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2229 + //line php7/php7.y:2223 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 271: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2234 + //line php7/php7.y:2228 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4788,7 +4782,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2244 + //line php7/php7.y:2238 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4800,7 +4794,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2254 + //line php7/php7.y:2248 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4812,7 +4806,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2264 + //line php7/php7.y:2258 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4824,7 +4818,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2274 + //line php7/php7.y:2268 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4836,7 +4830,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2284 + //line php7/php7.y:2278 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -4848,7 +4842,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2297 + //line php7/php7.y:2291 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4857,13 +4851,13 @@ yydefault: } case 278: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2304 + //line php7/php7.y:2298 { yyVAL.list = []node.Node{yyDollar[1].node} } case 279: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2309 + //line php7/php7.y:2303 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4879,7 +4873,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2323 + //line php7/php7.y:2317 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -4896,7 +4890,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2341 + //line php7/php7.y:2335 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4905,13 +4899,13 @@ yydefault: } case 282: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2348 + //line php7/php7.y:2342 { yyVAL.list = []node.Node{yyDollar[1].node} } case 283: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2353 + //line php7/php7.y:2347 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4926,7 +4920,7 @@ yydefault: } case 284: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2369 + //line php7/php7.y:2363 { name := node.NewIdentifier(yyDollar[1].token.Value) yyVAL.node = stmt.NewConstant(name, yyDollar[3].node, yyDollar[4].str) @@ -4941,7 +4935,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2385 + //line php7/php7.y:2379 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4950,31 +4944,31 @@ yydefault: } case 286: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2392 + //line php7/php7.y:2386 { yyVAL.list = []node.Node{yyDollar[1].node} } case 287: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2397 + //line php7/php7.y:2391 { yyVAL.node = yyDollar[1].node } case 288: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:2402 + //line php7/php7.y:2396 { yyVAL.list = nil } case 289: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2404 + //line php7/php7.y:2398 { yyVAL.list = yyDollar[1].list } case 290: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2409 + //line php7/php7.y:2403 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4983,13 +4977,13 @@ yydefault: } case 291: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:2416 + //line php7/php7.y:2410 { yyVAL.list = []node.Node{yyDollar[1].node} } case 292: yyDollar = yyS[yypt-8 : yypt+1] - //line php7/php7.y:2421 + //line php7/php7.y:2415 { if yyDollar[2].node != nil { yyVAL.node = stmt.NewClass(nil, nil, yyDollar[2].node.(*node.ArgumentList), yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list, yyDollar[5].str) @@ -5007,7 +5001,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2440 + //line php7/php7.y:2434 { if yyDollar[3].node != nil { yyVAL.node = expr.NewNew(yyDollar[2].node, yyDollar[3].node.(*node.ArgumentList)) @@ -5022,7 +5016,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2453 + //line php7/php7.y:2447 { yyVAL.node = expr.NewNew(yyDollar[2].node, nil) @@ -5034,7 +5028,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:2466 + //line php7/php7.y:2460 { list := expr.NewList(yyDollar[3].list) yyVAL.node = assign.NewAssign(list, yyDollar[6].node) @@ -5051,7 +5045,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:2481 + //line php7/php7.y:2475 { shortList := expr.NewShortList(yyDollar[2].list) yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node) @@ -5067,7 +5061,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2495 + //line php7/php7.y:2489 { yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node) @@ -5079,7 +5073,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:2505 + //line php7/php7.y:2499 { yyVAL.node = assign.NewReference(yyDollar[1].node, yyDollar[4].node) @@ -5092,7 +5086,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2516 + //line php7/php7.y:2510 { yyVAL.node = expr.NewClone(yyDollar[2].node) @@ -5104,7 +5098,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2526 + //line php7/php7.y:2520 { yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5116,7 +5110,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2536 + //line php7/php7.y:2530 { yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5128,7 +5122,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2546 + //line php7/php7.y:2540 { yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5140,7 +5134,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2556 + //line php7/php7.y:2550 { yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5152,7 +5146,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2566 + //line php7/php7.y:2560 { yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5164,7 +5158,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2576 + //line php7/php7.y:2570 { yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5176,7 +5170,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2586 + //line php7/php7.y:2580 { yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5188,7 +5182,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2596 + //line php7/php7.y:2590 { yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5200,7 +5194,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2606 + //line php7/php7.y:2600 { yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5212,7 +5206,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2616 + //line php7/php7.y:2610 { yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5224,7 +5218,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2626 + //line php7/php7.y:2620 { yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5236,7 +5230,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2636 + //line php7/php7.y:2630 { yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5248,7 +5242,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2646 + //line php7/php7.y:2640 { yyVAL.node = expr.NewPostInc(yyDollar[1].node) @@ -5260,7 +5254,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2656 + //line php7/php7.y:2650 { yyVAL.node = expr.NewPreInc(yyDollar[2].node) @@ -5272,7 +5266,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2666 + //line php7/php7.y:2660 { yyVAL.node = expr.NewPostDec(yyDollar[1].node) @@ -5284,7 +5278,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2676 + //line php7/php7.y:2670 { yyVAL.node = expr.NewPreDec(yyDollar[2].node) @@ -5296,7 +5290,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2686 + //line php7/php7.y:2680 { yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node) @@ -5308,7 +5302,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2696 + //line php7/php7.y:2690 { yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node) @@ -5320,7 +5314,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2706 + //line php7/php7.y:2700 { yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node) @@ -5332,7 +5326,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2716 + //line php7/php7.y:2710 { yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node) @@ -5344,7 +5338,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2726 + //line php7/php7.y:2720 { yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node) @@ -5356,7 +5350,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2736 + //line php7/php7.y:2730 { yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node) @@ -5368,7 +5362,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2746 + //line php7/php7.y:2740 { yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node) @@ -5380,7 +5374,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2756 + //line php7/php7.y:2750 { yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node) @@ -5392,7 +5386,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2766 + //line php7/php7.y:2760 { yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node) @@ -5404,7 +5398,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2776 + //line php7/php7.y:2770 { yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node) @@ -5416,7 +5410,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2786 + //line php7/php7.y:2780 { yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node) @@ -5428,7 +5422,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2796 + //line php7/php7.y:2790 { yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node) @@ -5440,7 +5434,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2806 + //line php7/php7.y:2800 { yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node) @@ -5452,7 +5446,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2816 + //line php7/php7.y:2810 { yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node) @@ -5464,7 +5458,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2826 + //line php7/php7.y:2820 { yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node) @@ -5476,7 +5470,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2836 + //line php7/php7.y:2830 { yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node) @@ -5488,7 +5482,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2846 + //line php7/php7.y:2840 { yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node) @@ -5500,7 +5494,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2856 + //line php7/php7.y:2850 { yyVAL.node = expr.NewUnaryPlus(yyDollar[2].node) @@ -5512,7 +5506,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2866 + //line php7/php7.y:2860 { yyVAL.node = expr.NewUnaryMinus(yyDollar[2].node) @@ -5524,7 +5518,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2876 + //line php7/php7.y:2870 { yyVAL.node = expr.NewBooleanNot(yyDollar[2].node) @@ -5536,7 +5530,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:2886 + //line php7/php7.y:2880 { yyVAL.node = expr.NewBitwiseNot(yyDollar[2].node) @@ -5548,7 +5542,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2896 + //line php7/php7.y:2890 { yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5560,7 +5554,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2906 + //line php7/php7.y:2900 { yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node) @@ -5572,7 +5566,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2916 + //line php7/php7.y:2910 { yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node) @@ -5584,7 +5578,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2926 + //line php7/php7.y:2920 { yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node) @@ -5596,7 +5590,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2936 + //line php7/php7.y:2930 { yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node) @@ -5608,7 +5602,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2946 + //line php7/php7.y:2940 { yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5620,7 +5614,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2956 + //line php7/php7.y:2950 { yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node) @@ -5632,7 +5626,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2966 + //line php7/php7.y:2960 { yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node) @@ -5644,7 +5638,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2976 + //line php7/php7.y:2970 { yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node) @@ -5656,7 +5650,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2986 + //line php7/php7.y:2980 { yyVAL.node = expr.NewInstanceOf(yyDollar[1].node, yyDollar[3].node) @@ -5668,7 +5662,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:2996 + //line php7/php7.y:2990 { yyVAL.node = yyDollar[2].node @@ -5678,13 +5672,13 @@ yydefault: } case 348: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3004 + //line php7/php7.y:2998 { yyVAL.node = yyDollar[1].node } case 349: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:3006 + //line php7/php7.y:3000 { yyVAL.node = expr.NewTernary(yyDollar[1].node, yyDollar[3].node, yyDollar[5].node) @@ -5697,7 +5691,7 @@ yydefault: } case 350: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3017 + //line php7/php7.y:3011 { yyVAL.node = expr.NewTernary(yyDollar[1].node, nil, yyDollar[4].node) @@ -5710,7 +5704,7 @@ yydefault: } case 351: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3028 + //line php7/php7.y:3022 { yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node) @@ -5722,13 +5716,13 @@ yydefault: } case 352: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3038 + //line php7/php7.y:3032 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3040 + //line php7/php7.y:3034 { yyVAL.node = cast.NewInt(yyDollar[2].node) @@ -5740,7 +5734,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3050 + //line php7/php7.y:3044 { yyVAL.node = cast.NewDouble(yyDollar[2].node) @@ -5752,7 +5746,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3060 + //line php7/php7.y:3054 { yyVAL.node = cast.NewString(yyDollar[2].node) @@ -5764,7 +5758,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3070 + //line php7/php7.y:3064 { yyVAL.node = cast.NewArray(yyDollar[2].node) @@ -5776,7 +5770,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3080 + //line php7/php7.y:3074 { yyVAL.node = cast.NewObject(yyDollar[2].node) @@ -5788,7 +5782,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3090 + //line php7/php7.y:3084 { yyVAL.node = cast.NewBool(yyDollar[2].node) @@ -5800,7 +5794,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3100 + //line php7/php7.y:3094 { yyVAL.node = cast.NewUnset(yyDollar[2].node) @@ -5812,7 +5806,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3110 + //line php7/php7.y:3104 { if strings.EqualFold(yyDollar[1].token.Value, "die") { yyVAL.node = expr.NewDie(nil) @@ -5842,7 +5836,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3138 + //line php7/php7.y:3132 { yyVAL.node = expr.NewErrorSuppress(yyDollar[2].node) @@ -5854,13 +5848,13 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3148 + //line php7/php7.y:3142 { yyVAL.node = yyDollar[1].node } case 363: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3150 + //line php7/php7.y:3144 { yyVAL.node = expr.NewShellExec(yyDollar[2].list) @@ -5873,7 +5867,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3161 + //line php7/php7.y:3155 { yyVAL.node = expr.NewPrint(yyDollar[2].node) @@ -5885,7 +5879,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3171 + //line php7/php7.y:3165 { yyVAL.node = expr.NewYield(nil, nil) @@ -5897,7 +5891,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3181 + //line php7/php7.y:3175 { yyVAL.node = expr.NewYield(nil, yyDollar[2].node) @@ -5909,7 +5903,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3191 + //line php7/php7.y:3185 { yyVAL.node = expr.NewYield(yyDollar[2].node, yyDollar[4].node) @@ -5922,7 +5916,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3202 + //line php7/php7.y:3196 { yyVAL.node = expr.NewYieldFrom(yyDollar[2].node) @@ -5934,7 +5928,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-11 : yypt+1] - //line php7/php7.y:3212 + //line php7/php7.y:3206 { yyVAL.node = expr.NewClosure(yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list, false, yyDollar[2].token != nil, yyDollar[3].str) @@ -5953,7 +5947,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-12 : yypt+1] - //line php7/php7.y:3229 + //line php7/php7.y:3223 { yyVAL.node = expr.NewClosure(yyDollar[6].list, yyDollar[8].ClosureUse, yyDollar[9].node, yyDollar[11].list, true, yyDollar[3].token != nil, yyDollar[4].str) @@ -5973,32 +5967,32 @@ yydefault: } case 371: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3250 + //line php7/php7.y:3244 { yyVAL.str = yylex.(*Parser).PhpDocComment yylex.(*Parser).PhpDocComment = "" } case 372: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3258 + //line php7/php7.y:3252 { yyVAL.token = nil } case 373: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3260 + //line php7/php7.y:3254 { yyVAL.token = yyDollar[1].token } case 374: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3265 + //line php7/php7.y:3259 { yyVAL.ClosureUse = nil } case 375: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3267 + //line php7/php7.y:3261 { yyVAL.ClosureUse = expr.NewClosureUse(yyDollar[3].list) @@ -6012,7 +6006,7 @@ yydefault: } case 376: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3282 + //line php7/php7.y:3276 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6021,13 +6015,13 @@ yydefault: } case 377: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3289 + //line php7/php7.y:3283 { yyVAL.list = []node.Node{yyDollar[1].node} } case 378: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3294 + //line php7/php7.y:3288 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(identifier) @@ -6041,7 +6035,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3306 + //line php7/php7.y:3300 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[2].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6058,7 +6052,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3324 + //line php7/php7.y:3318 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6067,7 +6061,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3331 + //line php7/php7.y:3325 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6079,7 +6073,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3341 + //line php7/php7.y:3335 { yyVAL.node = expr.NewStaticCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6091,7 +6085,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3351 + //line php7/php7.y:3345 { yyVAL.node = expr.NewFunctionCall(yyDollar[1].node, yyDollar[2].node.(*node.ArgumentList)) @@ -6100,7 +6094,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3361 + //line php7/php7.y:3355 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6112,31 +6106,31 @@ yydefault: } case 385: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3371 + //line php7/php7.y:3365 { yyVAL.node = yyDollar[1].node } case 386: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3376 + //line php7/php7.y:3370 { yyVAL.node = yyDollar[1].node } case 387: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3378 + //line php7/php7.y:3372 { yyVAL.node = yyDollar[1].node } case 388: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3383 + //line php7/php7.y:3377 { yyVAL.node = nil } case 389: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3385 + //line php7/php7.y:3379 { yyVAL.node = expr.NewExit(yyDollar[2].node) @@ -6149,37 +6143,37 @@ yydefault: } case 390: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3399 + //line php7/php7.y:3393 { yyVAL.list = []node.Node{} } case 391: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3401 + //line php7/php7.y:3395 { yyVAL.list = []node.Node{scalar.NewEncapsedStringPart(yyDollar[1].token.Value)} } case 392: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3403 + //line php7/php7.y:3397 { yyVAL.list = yyDollar[1].list } case 393: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3408 + //line php7/php7.y:3402 { yyVAL.node = nil } case 394: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3410 + //line php7/php7.y:3404 { yyVAL.node = yyDollar[1].node } case 395: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3415 + //line php7/php7.y:3409 { yyVAL.node = expr.NewArray(yyDollar[3].list) @@ -6193,7 +6187,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3427 + //line php7/php7.y:3421 { yyVAL.node = expr.NewShortArray(yyDollar[2].list) @@ -6206,7 +6200,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3438 + //line php7/php7.y:3432 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -6218,7 +6212,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3451 + //line php7/php7.y:3445 { yyVAL.node = scalar.NewLnumber(yyDollar[1].token.Value) @@ -6230,7 +6224,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3461 + //line php7/php7.y:3455 { yyVAL.node = scalar.NewDnumber(yyDollar[1].token.Value) @@ -6242,7 +6236,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3471 + //line php7/php7.y:3465 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6254,7 +6248,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3481 + //line php7/php7.y:3475 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6266,7 +6260,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3491 + //line php7/php7.y:3485 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6278,7 +6272,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3501 + //line php7/php7.y:3495 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6290,7 +6284,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3511 + //line php7/php7.y:3505 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6302,7 +6296,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3521 + //line php7/php7.y:3515 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6314,7 +6308,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3531 + //line php7/php7.y:3525 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6326,7 +6320,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3541 + //line php7/php7.y:3535 { yyVAL.node = scalar.NewMagicConstant(yyDollar[1].token.Value) @@ -6338,7 +6332,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3551 + //line php7/php7.y:3545 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, []node.Node{encapsed}) @@ -6352,7 +6346,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3563 + //line php7/php7.y:3557 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, nil) @@ -6364,7 +6358,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3573 + //line php7/php7.y:3567 { yyVAL.node = scalar.NewEncapsed(yyDollar[2].list) @@ -6376,7 +6370,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3583 + //line php7/php7.y:3577 { yyVAL.node = scalar.NewHeredoc(yyDollar[1].token.Value, yyDollar[2].list) @@ -6388,19 +6382,19 @@ yydefault: } case 412: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3593 + //line php7/php7.y:3587 { yyVAL.node = yyDollar[1].node } case 413: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3595 + //line php7/php7.y:3589 { yyVAL.node = yyDollar[1].node } case 414: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3600 + //line php7/php7.y:3594 { yyVAL.node = expr.NewConstFetch(yyDollar[1].node) @@ -6409,7 +6403,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3607 + //line php7/php7.y:3601 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6424,7 +6418,7 @@ yydefault: } case 416: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3620 + //line php7/php7.y:3614 { target := node.NewIdentifier(yyDollar[3].token.Value) yyVAL.node = expr.NewClassConstFetch(yyDollar[1].node, target) @@ -6439,43 +6433,43 @@ yydefault: } case 417: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3636 + //line php7/php7.y:3630 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3638 + //line php7/php7.y:3632 { yyVAL.node = yyDollar[1].node } case 419: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3643 + //line php7/php7.y:3637 { yyVAL.node = nil } case 420: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3645 + //line php7/php7.y:3639 { yyVAL.node = yyDollar[1].node } case 421: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3650 + //line php7/php7.y:3644 { yyVAL.node = yyDollar[1].node } case 422: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3655 + //line php7/php7.y:3649 { yyVAL.node = yyDollar[1].node } case 423: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3657 + //line php7/php7.y:3651 { yyVAL.node = yyDollar[2].node @@ -6485,19 +6479,19 @@ yydefault: } case 424: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3665 + //line php7/php7.y:3659 { yyVAL.node = yyDollar[1].node } case 425: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3670 + //line php7/php7.y:3664 { yyVAL.node = yyDollar[1].node } case 426: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3672 + //line php7/php7.y:3666 { yyVAL.node = yyDollar[2].node @@ -6507,19 +6501,19 @@ yydefault: } case 427: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3680 + //line php7/php7.y:3674 { yyVAL.node = yyDollar[1].node } case 428: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3685 + //line php7/php7.y:3679 { yyVAL.node = yyDollar[1].node } case 429: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3687 + //line php7/php7.y:3681 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6532,7 +6526,7 @@ yydefault: } case 430: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3698 + //line php7/php7.y:3692 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6545,7 +6539,7 @@ yydefault: } case 431: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3709 + //line php7/php7.y:3703 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6558,7 +6552,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3720 + //line php7/php7.y:3714 { yyVAL.node = expr.NewMethodCall(yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*node.ArgumentList)) @@ -6570,25 +6564,25 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3730 + //line php7/php7.y:3724 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3735 + //line php7/php7.y:3729 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3737 + //line php7/php7.y:3731 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3739 + //line php7/php7.y:3733 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6600,7 +6594,7 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3752 + //line php7/php7.y:3746 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6614,7 +6608,7 @@ yydefault: } case 438: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3764 + //line php7/php7.y:3758 { yyVAL.node = expr.NewVariable(yyDollar[3].node) @@ -6628,7 +6622,7 @@ yydefault: } case 439: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3776 + //line php7/php7.y:3770 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -6640,7 +6634,7 @@ yydefault: } case 440: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3789 + //line php7/php7.y:3783 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6652,7 +6646,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3799 + //line php7/php7.y:3793 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6664,13 +6658,13 @@ yydefault: } case 442: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3812 + //line php7/php7.y:3806 { yyVAL.node = yyDollar[1].node } case 443: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3814 + //line php7/php7.y:3808 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6683,7 +6677,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3825 + //line php7/php7.y:3819 { yyVAL.node = expr.NewArrayDimFetch(yyDollar[1].node, yyDollar[3].node) @@ -6696,7 +6690,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3836 + //line php7/php7.y:3830 { yyVAL.node = expr.NewPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6708,7 +6702,7 @@ yydefault: } case 446: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3846 + //line php7/php7.y:3840 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6720,7 +6714,7 @@ yydefault: } case 447: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3856 + //line php7/php7.y:3850 { yyVAL.node = expr.NewStaticPropertyFetch(yyDollar[1].node, yyDollar[3].node) @@ -6732,7 +6726,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3869 + //line php7/php7.y:3863 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6744,7 +6738,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3879 + //line php7/php7.y:3873 { yyVAL.node = yyDollar[2].node @@ -6754,13 +6748,13 @@ yydefault: } case 450: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3887 + //line php7/php7.y:3881 { yyVAL.node = yyDollar[1].node } case 451: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3892 + //line php7/php7.y:3886 { yyVAL.node = node.NewIdentifier(yyDollar[1].token.Value) @@ -6772,7 +6766,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3902 + //line php7/php7.y:3896 { yyVAL.node = yyDollar[2].node @@ -6782,13 +6776,13 @@ yydefault: } case 453: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3910 + //line php7/php7.y:3904 { yyVAL.node = yyDollar[1].node } case 454: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3915 + //line php7/php7.y:3909 { if yyDollar[1].list[len(yyDollar[1].list)-1] == nil { yyVAL.list = yyDollar[1].list[:len(yyDollar[1].list)-1] @@ -6798,19 +6792,19 @@ yydefault: } case 455: yyDollar = yyS[yypt-0 : yypt+1] - //line php7/php7.y:3926 + //line php7/php7.y:3920 { yyVAL.node = nil } case 456: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3928 + //line php7/php7.y:3922 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3933 + //line php7/php7.y:3927 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6819,13 +6813,13 @@ yydefault: } case 458: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3940 + //line php7/php7.y:3934 { yyVAL.list = []node.Node{yyDollar[1].node} } case 459: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:3945 + //line php7/php7.y:3939 { yyVAL.node = expr.NewArrayItem(yyDollar[1].node, yyDollar[3].node) @@ -6837,7 +6831,7 @@ yydefault: } case 460: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:3955 + //line php7/php7.y:3949 { yyVAL.node = expr.NewArrayItem(nil, yyDollar[1].node) @@ -6846,7 +6840,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:3962 + //line php7/php7.y:3956 { reference := expr.NewReference(yyDollar[4].node) yyVAL.node = expr.NewArrayItem(yyDollar[1].node, reference) @@ -6860,7 +6854,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:3974 + //line php7/php7.y:3968 { reference := expr.NewReference(yyDollar[2].node) yyVAL.node = expr.NewArrayItem(nil, reference) @@ -6873,7 +6867,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:3985 + //line php7/php7.y:3979 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[5].list) @@ -6891,7 +6885,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4001 + //line php7/php7.y:3995 { // TODO: Cannot use list() as standalone expression list := expr.NewList(yyDollar[3].list) @@ -6908,13 +6902,13 @@ yydefault: } case 465: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4019 + //line php7/php7.y:4013 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 466: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4021 + //line php7/php7.y:4015 { encapsed := scalar.NewEncapsedStringPart(yyDollar[2].token.Value) yyVAL.list = append(yyDollar[1].list, encapsed) @@ -6927,13 +6921,13 @@ yydefault: } case 467: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4032 + //line php7/php7.y:4026 { yyVAL.list = []node.Node{yyDollar[1].node} } case 468: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4034 + //line php7/php7.y:4028 { encapsed := scalar.NewEncapsedStringPart(yyDollar[1].token.Value) yyVAL.list = []node.Node{encapsed, yyDollar[2].node} @@ -6946,7 +6940,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4048 + //line php7/php7.y:4042 { name := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(name) @@ -6960,7 +6954,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4060 + //line php7/php7.y:4054 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6978,7 +6972,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4076 + //line php7/php7.y:4070 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) variable := expr.NewVariable(identifier) @@ -6998,7 +6992,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4094 + //line php7/php7.y:4088 { yyVAL.node = expr.NewVariable(yyDollar[2].node) @@ -7011,7 +7005,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4105 + //line php7/php7.y:4099 { name := node.NewIdentifier(yyDollar[2].token.Value) yyVAL.node = expr.NewVariable(name) @@ -7027,7 +7021,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-6 : yypt+1] - //line php7/php7.y:4119 + //line php7/php7.y:4113 { identifier := node.NewIdentifier(yyDollar[2].token.Value) variable := expr.NewVariable(identifier) @@ -7047,13 +7041,13 @@ yydefault: } case 475: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4137 + //line php7/php7.y:4131 { yyVAL.node = yyDollar[2].node } case 476: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4143 + //line php7/php7.y:4138 { yyVAL.node = scalar.NewString(yyDollar[1].token.Value) @@ -7065,7 +7059,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4153 + //line php7/php7.y:4148 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(yyDollar[1].token.Value); err == nil { @@ -7082,7 +7076,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4168 + //line php7/php7.y:4163 { var lnumber *scalar.Lnumber // TODO: add option to handle 64 bit integer @@ -7113,7 +7107,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4197 + //line php7/php7.y:4192 { identifier := node.NewIdentifier(strings.TrimLeft(yyDollar[1].token.Value, "$")) yyVAL.node = expr.NewVariable(identifier) @@ -7127,7 +7121,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-5 : yypt+1] - //line php7/php7.y:4212 + //line php7/php7.y:4207 { yyVAL.node = expr.NewIsset(yyDollar[3].list) @@ -7144,7 +7138,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4227 + //line php7/php7.y:4222 { yyVAL.node = expr.NewEmpty(yyDollar[3].node) @@ -7158,7 +7152,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4239 + //line php7/php7.y:4234 { yyVAL.node = expr.NewInclude(yyDollar[2].node) @@ -7170,7 +7164,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4249 + //line php7/php7.y:4244 { yyVAL.node = expr.NewIncludeOnce(yyDollar[2].node) @@ -7182,7 +7176,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-4 : yypt+1] - //line php7/php7.y:4259 + //line php7/php7.y:4254 { yyVAL.node = expr.NewEval(yyDollar[3].node) @@ -7196,7 +7190,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4271 + //line php7/php7.y:4266 { yyVAL.node = expr.NewRequire(yyDollar[2].node) @@ -7208,7 +7202,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-2 : yypt+1] - //line php7/php7.y:4281 + //line php7/php7.y:4276 { yyVAL.node = expr.NewRequireOnce(yyDollar[2].node) @@ -7220,13 +7214,13 @@ yydefault: } case 487: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4294 + //line php7/php7.y:4289 { yyVAL.list = []node.Node{yyDollar[1].node} } case 488: yyDollar = yyS[yypt-3 : yypt+1] - //line php7/php7.y:4296 + //line php7/php7.y:4291 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -7235,7 +7229,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-1 : yypt+1] - //line php7/php7.y:4306 + //line php7/php7.y:4301 { yyVAL.node = yyDollar[1].node } diff --git a/php7/php7.y b/php7/php7.y index 4190b68..0c7514e 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -1694,16 +1694,7 @@ parameter: { identifier := node.NewIdentifier(strings.TrimLeft($4.Value, "$")) variable := expr.NewVariable(identifier) - - if $1 != nil { - $$ = node.NewParameter($1, variable, nil, $2 != nil, $3 != nil) - } else if $2 != nil { - $$ = node.NewParameter($1, variable, nil, $2 != nil, $3 != nil) - } else if $3 != nil { - $$ = node.NewParameter($1, variable, nil, $2 != nil, $3 != nil) - } else { - $$ = node.NewParameter($1, variable, nil, $2 != nil, $3 != nil) - } + $$ = node.NewParameter($1, variable, nil, $2 != nil, $3 != nil) // save position yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) @@ -1731,15 +1722,7 @@ parameter: { identifier := node.NewIdentifier(strings.TrimLeft($4.Value, "$")) variable := expr.NewVariable(identifier) - if $1 != nil { - $$ = node.NewParameter($1, variable, $6, $2 != nil, $3 != nil) - } else if $2 != nil { - $$ = node.NewParameter($1, variable, $6, $2 != nil, $3 != nil) - } else if $3 != nil { - $$ = node.NewParameter($1, variable, $6, $2 != nil, $3 != nil) - } else { - $$ = node.NewParameter($1, variable, $6, $2 != nil, $3 != nil) - } + $$ = node.NewParameter($1, variable, $6, $2 != nil, $3 != nil) // save position yylex.(*Parser).positions.AddPosition(identifier, yylex.(*Parser).positionBuilder.NewTokenPosition($4)) @@ -1832,6 +1815,10 @@ argument_list: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) + yylex.(*Parser).comments.AddFromToken($$, $2, comment.CloseParenthesisToken) } | '(' non_empty_argument_list possible_comma ')' { @@ -1839,6 +1826,13 @@ argument_list: // save position yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + + // save comments + yylex.(*Parser).comments.AddFromToken($$, $1, comment.OpenParenthesisToken) + if $3 != nil { + yylex.(*Parser).comments.AddFromToken($$, $3, comment.CommaToken) + } + yylex.(*Parser).comments.AddFromToken($$, $4, comment.CloseParenthesisToken) } ; @@ -4138,6 +4132,7 @@ encaps_var: $$ = $2; } ; + encaps_var_offset: T_STRING {