diff --git a/internal/php5/parser.go b/internal/php5/parser.go index 311e544..060be97 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -1,15 +1,14 @@ package php5 import ( - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/node" - "strings" + "bytes" "github.com/z7zmey/php-parser/internal/positionbuilder" + "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/errors" "github.com/z7zmey/php-parser/pkg/position" - "github.com/z7zmey/php-parser/scanner" + "github.com/z7zmey/php-parser/pkg/token" ) func (lval *yySymType) Token(t *scanner.Token) { @@ -56,7 +55,7 @@ func (l *Parser) Error(msg string) { } func (l *Parser) WithTokens() { - l.Lexer.SetWithFreeFloating(true) + l.Lexer.SetWithTokens(true) } // Parse the php7 Parser entrypoint @@ -83,14 +82,14 @@ func (l *Parser) GetErrors() []*errors.Error { // helpers -func lastNode(nn []node.Node) node.Node { +func lastNode(nn []ast.Vertex) ast.Vertex { if len(nn) == 0 { return nil } return nn[len(nn)-1] } -func firstNode(nn []node.Node) node.Node { +func firstNode(nn []ast.Vertex) ast.Vertex { return nn[0] } @@ -98,20 +97,20 @@ func isDollar(r rune) bool { return r == '$' } -func (l *Parser) MoveFreeFloating(src node.Node, dst node.Node) { +func (l *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { if l.Lexer.GetWithFreeFloating() == false { return } - if src.GetFreeFloating() == nil { + if src.GetNode().Tokens == nil { return } - l.setFreeFloating(dst, freefloating.Start, (*src.GetFreeFloating())[freefloating.Start]) - delete((*src.GetFreeFloating()), freefloating.Start) + l.setFreeFloating(dst, token.Start, src.GetNode().Tokens[token.Start]) + delete(src.GetNode().Tokens, token.Start) } -func (l *Parser) setFreeFloating(dst node.Node, p freefloating.Position, strings []freefloating.String) { +func (l *Parser) setFreeFloating(dst ast.Vertex, p token.Position, strings []token.Token) { if l.Lexer.GetWithFreeFloating() == false { return } @@ -120,100 +119,65 @@ func (l *Parser) setFreeFloating(dst node.Node, p freefloating.Position, strings return } - dstCollection := dst.GetFreeFloating() + dstCollection := &dst.GetNode().Tokens if *dstCollection == nil { - *dstCollection = make(freefloating.Collection) + *dstCollection = make(token.Collection) } (*dstCollection)[p] = strings } -func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []freefloating.String { +func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { if l.Lexer.GetWithFreeFloating() == false { - return []freefloating.String{} + return []token.Token{} } - return t.GetFreeFloatingToken() + tokens := make([]token.Token, len(t.Tokens)) + copy(tokens, t.Tokens) + + return tokens } -func (l *Parser) addDollarToken(v node.Node) { +func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { if l.Lexer.GetWithFreeFloating() == false { return } - l.setFreeFloating(v, freefloating.Dollar, []freefloating.String{ - { - StringType: freefloating.TokenType, - Value: "$", - Position: &position.Position{ - StartLine: v.GetPosition().StartLine, - EndLine: v.GetPosition().StartLine, - StartPos: v.GetPosition().StartPos, - EndPos: v.GetPosition().StartPos + 1, - }, - }, - }) -} - -func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode node.Node, prevNode node.Node) { - if l.Lexer.GetWithFreeFloating() == false { - return - } - - semiColon := (*prevNode.GetFreeFloating())[freefloating.SemiColon] - delete((*prevNode.GetFreeFloating()), freefloating.SemiColon) + semiColon := prevNode.GetNode().Tokens[token.SemiColon] + delete(prevNode.GetNode().Tokens, token.SemiColon) if len(semiColon) == 0 { return } - p := semiColon[0].Position if semiColon[0].Value[0] == ';' { - l.setFreeFloating(prevNode, freefloating.SemiColon, []freefloating.String{ + l.setFreeFloating(prevNode, token.SemiColon, []token.Token{ { - StringType: freefloating.TokenType, - Value: ";", - Position: &position.Position{ - StartLine: p.StartLine, - EndLine: p.StartLine, - StartPos: p.StartPos, - EndPos: p.StartPos + 1, - }, + ID: token.ID(';'), + Value: semiColon[0].Value[0:1], }, }) } vlen := len(semiColon[0].Value) tlen := 2 - if strings.HasSuffix(semiColon[0].Value, "?>\n") { + if bytes.HasSuffix(semiColon[0].Value, []byte("?>\n")) { tlen = 3 } - phpCloseTag := []freefloating.String{} + phpCloseTag := []token.Token{} if vlen-tlen > 1 { - phpCloseTag = append(phpCloseTag, freefloating.String{ - StringType: freefloating.WhiteSpaceType, - Value: semiColon[0].Value[1 : vlen-tlen], - Position: &position.Position{ - StartLine: p.StartLine, - EndLine: p.EndLine, - StartPos: p.StartPos + 1, - EndPos: p.EndPos - tlen, - }, + phpCloseTag = append(phpCloseTag, token.Token{ + ID: token.T_WHITESPACE, + Value: semiColon[0].Value[1 : vlen-tlen], }) } - phpCloseTag = append(phpCloseTag, freefloating.String{ - StringType: freefloating.WhiteSpaceType, - Value: semiColon[0].Value[vlen-tlen:], - Position: &position.Position{ - StartLine: p.EndLine, - EndLine: p.EndLine, - StartPos: p.EndPos - tlen, - EndPos: p.EndPos, - }, + phpCloseTag = append(phpCloseTag, token.Token{ + ID: T_CLOSE_TAG, + Value: semiColon[0].Value[vlen-tlen:], }) - l.setFreeFloating(htmlNode, freefloating.Start, append(phpCloseTag, (*htmlNode.GetFreeFloating())[freefloating.Start]...)) + l.setFreeFloating(htmlNode, token.Start, append(phpCloseTag, htmlNode.GetNode().Tokens[token.Start]...)) } func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 8bb5291..0b7071c 100644 Binary files a/internal/php5/php5.go and b/internal/php5/php5.go differ diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 9102dd8..fc42063 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -2,33 +2,26 @@ package php5 import ( - "strings" + "bytes" "strconv" - "github.com/z7zmey/php-parser/freefloating" - "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" - "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/node/expr/assign" - "github.com/z7zmey/php-parser/node/expr/binary" - "github.com/z7zmey/php-parser/node/expr/cast" + "github.com/z7zmey/php-parser/pkg/token" + "github.com/z7zmey/php-parser/internal/scanner" + "github.com/z7zmey/php-parser/pkg/ast" ) %} %union{ - node node.Node + node ast.Vertex token *scanner.Token - list []node.Node + list []ast.Vertex simpleIndirectReference simpleIndirectReference - ClassExtends *stmt.ClassExtends - ClassImplements *stmt.ClassImplements - InterfaceExtends *stmt.InterfaceExtends - ClosureUse *expr.ClosureUse + ClassExtends *ast.StmtClassExtends + ClassImplements *ast.StmtClassImplements + InterfaceExtends *ast.StmtInterfaceExtends + ClosureUse *ast.ExprClosureUse } %type $unk @@ -281,10 +274,10 @@ import ( start: top_statement_list { - yylex.(*Parser).rootNode = node.NewRoot($1) - yylex.(*Parser).rootNode.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + yylex.(*Parser).rootNode = &ast.Root{ast.Node{}, $1} + yylex.(*Parser).rootNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) - yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, freefloating.End, yylex.(*Parser).currentToken.FreeFloating) + yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, token.End, yylex.(*Parser).currentToken.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -293,7 +286,7 @@ start: top_statement_list: top_statement_list top_statement { - if inlineHtmlNode, ok := $2.(*stmt.InlineHtml); ok && len($1) > 0 { + if inlineHtmlNode, ok := $2.(*ast.StmtInlineHtml); ok && len($1) > 0 { prevNode := lastNode($1) yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) } @@ -306,7 +299,7 @@ top_statement_list: } | /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -315,28 +308,28 @@ top_statement_list: namespace_name: T_STRING { - namePart := name.NewNamePart($1.Value) - $$ = []node.Node{namePart} + namePart := &ast.NameNamePart{ast.Node{}, $1.Value} + $$ = []ast.Vertex{namePart} // save position - namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + namePart.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(namePart, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(namePart, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name T_NS_SEPARATOR T_STRING { - namePart := name.NewNamePart($3.Value) + namePart := &ast.NameNamePart{ast.Node{}, $3.Value} $$ = append($1, namePart) // save position - namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + namePart.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(namePart, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(namePart, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -352,131 +345,131 @@ top_statement: } | statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_declaration_statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_declaration_statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_HALT_COMPILER '(' ')' ';' { - $$ = stmt.NewHaltCompiler() + $$ = &ast.StmtHaltCompiler{ast.Node{}, } // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.HaltCompiller, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.OpenParenthesisToken, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.CloseParenthesisToken, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.HaltCompiller, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.OpenParenthesisToken, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NAMESPACE namespace_name ';' { - name := name.NewName($2) - $$ = stmt.NewNamespace(name, nil) + name := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtNamespace{ast.Node{}, name, nil} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NAMESPACE namespace_name '{' top_statement_list '}' { - name := name.NewName($2) - $$ = stmt.NewNamespace(name, $4) + name := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtNamespace{ast.Node{}, name, $4} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $5.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $5.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NAMESPACE '{' top_statement_list '}' { - $$ = stmt.NewNamespace(nil, $3) + $$ = &ast.StmtNamespace{ast.Node{}, nil, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Namespace, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_USE use_declarations ';' { - $$ = stmt.NewUseList(nil, $2) + $$ = &ast.StmtUseList{ast.Node{}, nil, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_USE T_FUNCTION use_function_declarations ';' { - useType := node.NewIdentifier($2.Value) - $$ = stmt.NewUseList(useType, $3) + useType := &ast.Identifier{ast.Node{}, $2.Value} + $$ = &ast.StmtUseList{ast.Node{}, useType, $3} // save position - useType.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + useType.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(useType, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(useType, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_USE T_CONST use_const_declarations ';' { - useType := node.NewIdentifier($2.Value) - $$ = stmt.NewUseList(useType, $3) + useType := &ast.Identifier{ast.Node{}, $2.Value} + $$ = &ast.StmtUseList{ast.Node{}, useType, $3} // save position - useType.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + useType.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(useType, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(useType, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -485,11 +478,11 @@ top_statement: $$ = $1 // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -501,13 +494,13 @@ use_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | use_declaration { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -516,12 +509,12 @@ use_declarations: use_declaration: namespace_name { - name := name.NewName($1) - $$ = stmt.NewUse(nil, name, nil) + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -530,55 +523,55 @@ use_declaration: } | namespace_name T_AS T_STRING { - name := name.NewName($1) - alias := node.NewIdentifier($3.Value) - $$ = stmt.NewUse(nil, name, alias) + name := &ast.NameName{ast.Node{}, $1} + alias := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name { - name := name.NewName($2) - $$ = stmt.NewUse(nil, name, nil) + name := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).MoveFreeFloating($2[0], name) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name T_AS T_STRING { - name := name.NewName($2) - alias := node.NewIdentifier($4.Value) - $$ = stmt.NewUse(nil, name, alias) + name := &ast.NameName{ast.Node{}, $2} + alias := &ast.Identifier{ast.Node{}, $4.Value} + $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -590,13 +583,13 @@ use_function_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | use_function_declaration { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -605,12 +598,12 @@ use_function_declarations: use_function_declaration: namespace_name { - name := name.NewName($1) - $$ = stmt.NewUse(nil, name, nil) + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -619,55 +612,55 @@ use_function_declaration: } | namespace_name T_AS T_STRING { - name := name.NewName($1) - alias := node.NewIdentifier($3.Value) - $$ = stmt.NewUse(nil, name, alias) + name := &ast.NameName{ast.Node{}, $1} + alias := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name { - name := name.NewName($2) - $$ = stmt.NewUse(nil, name, nil) + name := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).MoveFreeFloating($2[0], name) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name T_AS T_STRING { - name := name.NewName($2) - alias := node.NewIdentifier($4.Value) - $$ = stmt.NewUse(nil, name, alias) + name := &ast.NameName{ast.Node{}, $2} + alias := &ast.Identifier{ast.Node{}, $4.Value} + $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -679,13 +672,13 @@ use_const_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | use_const_declaration { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -694,12 +687,12 @@ use_const_declarations: use_const_declaration: namespace_name { - name := name.NewName($1) - $$ = stmt.NewUse(nil, name, nil) + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -708,55 +701,55 @@ use_const_declaration: } | namespace_name T_AS T_STRING { - name := name.NewName($1) - alias := node.NewIdentifier($3.Value) - $$ = stmt.NewUse(nil, name, alias) + name := &ast.NameName{ast.Node{}, $1} + alias := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name { - name := name.NewName($2) - $$ = stmt.NewUse(nil, name, nil) + name := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).MoveFreeFloating($2[0], name) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name T_AS T_STRING { - name := name.NewName($2) - alias := node.NewIdentifier($4.Value) - $$ = stmt.NewUse(nil, name, alias) + name := &ast.NameName{ast.Node{}, $2} + alias := &ast.Identifier{ast.Node{}, $4.Value} + $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -765,41 +758,41 @@ use_const_declaration: constant_declaration: constant_declaration ',' T_STRING '=' static_scalar { - name := node.NewIdentifier($3.Value) - constant := stmt.NewConstant(name, $5, "") - constList := $1.(*stmt.ConstList) + name := &ast.Identifier{ast.Node{}, $3.Value} + constant := &ast.StmtConstant{ast.Node{}, name, $5} + constList := $1.(*ast.StmtConstList) lastConst := lastNode(constList.Consts) constList.Consts = append(constList.Consts, constant) $$ = $1 // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, constList.Consts)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, constList.Consts) // save comments - yylex.(*Parser).setFreeFloating(lastConst, freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(lastConst, token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CONST T_STRING '=' static_scalar { - name := node.NewIdentifier($2.Value) - constant := stmt.NewConstant(name, $4, "") - constList := []node.Node{constant} - $$ = stmt.NewConstList(constList) + name := &ast.Identifier{ast.Node{}, $2.Value} + constant := &ast.StmtConstant{ast.Node{}, name, $4} + constList := []ast.Vertex{constant} + $$ = &ast.StmtConstList{ast.Node{}, constList} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, constList)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, constList) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -808,7 +801,7 @@ constant_declaration: inner_statement_list: inner_statement_list inner_statement { - if inlineHtmlNode, ok := $2.(*stmt.InlineHtml); ok && len($1) > 0 { + if inlineHtmlNode, ok := $2.(*ast.StmtInlineHtml); ok && len($1) > 0 { prevNode := lastNode($1) yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) } @@ -821,7 +814,7 @@ inner_statement_list: } | /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -838,35 +831,35 @@ inner_statement: } | statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_declaration_statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_declaration_statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_HALT_COMPILER '(' ')' ';' { - $$ = stmt.NewHaltCompiler() + $$ = &ast.StmtHaltCompiler{ast.Node{}, } // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.HaltCompiller, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.OpenParenthesisToken, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.CloseParenthesisToken, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.HaltCompiller, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.OpenParenthesisToken, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -876,22 +869,22 @@ inner_statement: statement: unticked_statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_STRING ':' { - label := node.NewIdentifier($1.Value) - $$ = stmt.NewLabel(label) + label := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.StmtLabel{ast.Node{}, label} // save position - label.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + label.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Label, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Label, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -900,119 +893,119 @@ statement: unticked_statement: '{' inner_statement_list '}' { - $$ = stmt.NewStmtList($2) + $$ = &ast.StmtStmtList{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_IF parenthesis_expr statement elseif_list else_single { - $$ = stmt.NewIf($2, $3, $4, $5) + $$ = &ast.StmtIf{ast.Node{}, $2, $3, $4, $5} // save position if $5 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) } else if len($4) > 0 { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $4) } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) } // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.If, (*$2.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.If, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) } - if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.CloseParenthesisToken) + if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_IF parenthesis_expr ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';' { - stmts := stmt.NewStmtList($4) - $$ = stmt.NewAltIf($2, stmts, $5, $6) + stmts := &ast.StmtStmtList{ast.Node{}, $4} + $$ = &ast.StmtAltIf{ast.Node{}, $2, stmts, $5, $6} // save position - stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) + stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.If, (*$2.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.If, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) } - if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.CloseParenthesisToken) + if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) } - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $7.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $8.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($8)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $8.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($8)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_WHILE parenthesis_expr while_statement { switch n := $3.(type) { - case *stmt.While : + case *ast.StmtWhile : n.Cond = $2 - case *stmt.AltWhile : + case *ast.StmtAltWhile : n.Cond = $2 } $$ = $3 // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.While, (*$2.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.While, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) } - if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.CloseParenthesisToken) + if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DO statement T_WHILE parenthesis_expr ';' { - $$ = stmt.NewDo($2, $4) + $$ = &ast.StmtDo{ast.Node{}, $2, $4} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - if len((*$4.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.While, (*$4.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$4.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$4.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + if len($4.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.While, $4.GetNode().Tokens[token.OpenParenthesisToken][:len($4.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($4.GetNode().Tokens, token.OpenParenthesisToken) } - if len((*$4.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$4.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$4.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$4.GetFreeFloating()), freefloating.CloseParenthesisToken) + if len($4.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.GetNode().Tokens[token.CloseParenthesisToken][:len($4.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($4.GetNode().Tokens, token.CloseParenthesisToken) } - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_FOR '(' for_expr ';' for_expr ';' for_expr ')' for_statement { switch n := $9.(type) { - case *stmt.For : + case *ast.StmtFor : n.Init = $3 n.Cond = $5 n.Loop = $7 - case *stmt.AltFor : + case *ast.StmtAltFor : n.Init = $3 n.Cond = $5 n.Loop = $7 @@ -1021,23 +1014,23 @@ unticked_statement: $$ = $9 // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.For, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.InitExpr, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.CondExpr, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.IncExpr, $8.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.For, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.InitExpr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.CondExpr, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.IncExpr, $8.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_SWITCH parenthesis_expr switch_case_list { switch n := $3.(type) { - case *stmt.Switch: + case *ast.StmtSwitch: n.Cond = $2 - case *stmt.AltSwitch: + case *ast.StmtAltSwitch: n.Cond = $2 default: panic("unexpected node type") @@ -1046,213 +1039,213 @@ unticked_statement: $$ = $3 // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.Switch, (*$2.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.Switch, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) } - if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.CloseParenthesisToken) + if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_BREAK ';' { - $$ = stmt.NewBreak(nil) + $$ = &ast.StmtBreak{ast.Node{}, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_BREAK expr ';' { - $$ = stmt.NewBreak($2) + $$ = &ast.StmtBreak{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CONTINUE ';' { - $$ = stmt.NewContinue(nil) + $$ = &ast.StmtContinue{ast.Node{}, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CONTINUE expr ';' { - $$ = stmt.NewContinue($2) + $$ = &ast.StmtContinue{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_RETURN ';' { - $$ = stmt.NewReturn(nil) + $$ = &ast.StmtReturn{ast.Node{}, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_RETURN expr_without_variable ';' { - $$ = stmt.NewReturn($2) + $$ = &ast.StmtReturn{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_RETURN variable ';' { - $$ = stmt.NewReturn($2) + $$ = &ast.StmtReturn{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | yield_expr ';' { - $$ = stmt.NewExpression($1) + $$ = &ast.StmtExpression{ast.Node{}, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_GLOBAL global_var_list ';' { - $$ = stmt.NewGlobal($2) + $$ = &ast.StmtGlobal{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_STATIC static_var_list ';' { - $$ = stmt.NewStatic($2) + $$ = &ast.StmtStatic{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ECHO echo_expr_list ';' { - $$ = stmt.NewEcho($2) + $$ = &ast.StmtEcho{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Echo, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Echo, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_INLINE_HTML { - $$ = stmt.NewInlineHtml($1.Value) + $$ = &ast.StmtInlineHtml{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr ';' { - $$ = stmt.NewExpression($1) + $$ = &ast.StmtExpression{ast.Node{}, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_UNSET '(' unset_variables ')' ';' { - $$ = stmt.NewUnset($3) + $$ = &ast.StmtUnset{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Unset, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.CloseParenthesisToken, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Unset, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1260,39 +1253,39 @@ unticked_statement: { if $6 == nil { switch n := $8.(type) { - case *stmt.Foreach : + case *ast.StmtForeach : n.Expr = $3 - n.Variable = $5 - case *stmt.AltForeach : + n.Var = $5 + case *ast.StmtAltForeach : n.Expr = $3 - n.Variable = $5 + n.Var = $5 } } else { switch n := $8.(type) { - case *stmt.Foreach : + case *ast.StmtForeach : n.Expr = $3 n.Key = $5 - n.Variable = $6 - case *stmt.AltForeach : + n.Var = $6 + case *ast.StmtAltForeach : n.Expr = $3 n.Key = $5 - n.Variable = $6 + n.Var = $6 } } - + $$ = $8 // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Foreach, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) if $6 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Key, (*$6.GetFreeFloating())[freefloating.Key]); delete((*$6.GetFreeFloating()), freefloating.Key) + yylex.(*Parser).setFreeFloating($$, token.Key, $6.GetNode().Tokens[token.Key]); delete($6.GetNode().Tokens, token.Key) } - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $7.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $7.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1300,116 +1293,116 @@ unticked_statement: { if $6 == nil { switch n := $8.(type) { - case *stmt.Foreach : + case *ast.StmtForeach : n.Expr = $3 - n.Variable = $5 - case *stmt.AltForeach : + n.Var = $5 + case *ast.StmtAltForeach : n.Expr = $3 - n.Variable = $5 + n.Var = $5 } } else { switch n := $8.(type) { - case *stmt.Foreach : + case *ast.StmtForeach : n.Expr = $3 n.Key = $5 - n.Variable = $6 - case *stmt.AltForeach : + n.Var = $6 + case *ast.StmtAltForeach : n.Expr = $3 n.Key = $5 - n.Variable = $6 + n.Var = $6 } } - + // save position $$ = $8 - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Foreach, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) if $6 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Key, (*$6.GetFreeFloating())[freefloating.Key]); delete((*$6.GetFreeFloating()), freefloating.Key) + yylex.(*Parser).setFreeFloating($$, token.Key, $6.GetNode().Tokens[token.Key]); delete($6.GetNode().Tokens, token.Key) } - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $7.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $7.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DECLARE '(' declare_list ')' declare_statement { $$ = $5 - $$.(*stmt.Declare).Consts = $3 + $$.(*ast.StmtDeclare).Consts = $3 // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Declare, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ConstList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Declare, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ';' { - $$ = stmt.NewNop() + $$ = &ast.StmtNop{ast.Node{}, } // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_TRY '{' inner_statement_list '}' catch_statement finally_statement { - $$ = stmt.NewTry($3, $5, $6) + $$ = &ast.StmtTry{ast.Node{}, $3, $5, $6} // save position if $6 == nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $5)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $5) } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6) } // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Try, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Try, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_THROW expr ';' { - $$ = stmt.NewThrow($2) + $$ = &ast.StmtThrow{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_GOTO T_STRING ';' { - label := node.NewIdentifier($2.Value) - $$ = stmt.NewGoto(label) + label := &ast.Identifier{ast.Node{}, $2.Value} + $$ = &ast.StmtGoto{ast.Node{}, label} // save position - label.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + label.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(label, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Label, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(label, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Label, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1418,30 +1411,29 @@ unticked_statement: catch_statement: /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CATCH '(' fully_qualified_class_name T_VARIABLE ')' '{' inner_statement_list '}' additional_catches { - identifier := node.NewIdentifier(strings.TrimLeftFunc($4.Value, isDollar)) - variable := expr.NewVariable(identifier) - catchNode := stmt.NewCatch([]node.Node{$3}, variable, $7) - $$ = append([]node.Node{catchNode}, $9...) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + catchNode := &ast.StmtCatch{ast.Node{}, []ast.Vertex{$3}, variable, $7} + $$ = append([]ast.Vertex{catchNode}, $9...) // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - catchNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + catchNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating(catchNode, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(catchNode, freefloating.Catch, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $4.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(catchNode, freefloating.Var, $5.FreeFloating) - yylex.(*Parser).setFreeFloating(catchNode, freefloating.Cond, $6.FreeFloating) - yylex.(*Parser).setFreeFloating(catchNode, freefloating.Stmts, $8.FreeFloating) + yylex.(*Parser).setFreeFloating(catchNode, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Catch, $2.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Var, $5.Tokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Cond, $6.Tokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Stmts, $8.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1450,21 +1442,21 @@ catch_statement: finally_statement: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_FINALLY '{' inner_statement_list '}' { - $$ = stmt.NewFinally($3) + $$ = &ast.StmtFinally{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Finally, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Finally, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1473,13 +1465,13 @@ finally_statement: additional_catches: non_empty_additional_catches { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1488,13 +1480,13 @@ additional_catches: non_empty_additional_catches: additional_catch { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_additional_catches additional_catch { - $$ = append($1, $2) + $$ = append($1, $2) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1503,23 +1495,22 @@ non_empty_additional_catches: additional_catch: T_CATCH '(' fully_qualified_class_name T_VARIABLE ')' '{' inner_statement_list '}' { - identifier := node.NewIdentifier(strings.TrimLeftFunc($4.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = stmt.NewCatch([]node.Node{$3}, variable, $7) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.StmtCatch{ast.Node{}, []ast.Vertex{$3}, variable, $7} // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Catch, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $4.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $8.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Catch, $2.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1528,7 +1519,7 @@ additional_catch: unset_variables: unset_variable { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1537,7 +1528,7 @@ unset_variables: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1546,7 +1537,7 @@ unset_variables: unset_variable: variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1555,7 +1546,7 @@ unset_variable: function_declaration_statement: unticked_function_declaration_statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1564,7 +1555,7 @@ function_declaration_statement: class_declaration_statement: unticked_class_declaration_statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1595,25 +1586,25 @@ is_variadic: unticked_function_declaration_statement: function is_reference T_STRING '(' parameter_list ')' '{' inner_statement_list '}' { - name := node.NewIdentifier($3.Value) - $$ = stmt.NewFunction(name, $2 != nil, $5, nil, $8, "") + name := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtFunction{ast.Node{}, $2 != nil, name, $5, nil, $8} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) if $2 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) } else { - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) } - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ParamList, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Params, $7.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $9.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParamList, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Params, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1622,15 +1613,15 @@ unticked_function_declaration_statement: unticked_class_declaration_statement: class_entry_type T_STRING extends_from implements_list '{' class_statement_list '}' { - name := node.NewIdentifier($2.Value) + name := &ast.Identifier{ast.Node{}, $2.Value} switch n := $1.(type) { - case *stmt.Class : + case *ast.StmtClass : n.ClassName = name n.Stmts = $6 n.Extends = $3 n.Implements = $4 - case *stmt.Trait : + case *ast.StmtTrait : // TODO: is it possible that trait extend or implement n.TraitName = name n.Stmts = $6 @@ -1638,30 +1629,30 @@ unticked_class_declaration_statement: $$ = $1 // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $7)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $7) // save comments - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $7.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | interface_entry T_STRING interface_extends_list '{' class_statement_list '}' { - name := node.NewIdentifier($2.Value) - $$ = stmt.NewInterface(name, $3, $5, "") + name := &ast.Identifier{ast.Node{}, $2.Value} + $$ = &ast.StmtInterface{ast.Node{}, name, $3, $5} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $6.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1671,55 +1662,55 @@ unticked_class_declaration_statement: class_entry_type: T_CLASS { - $$ = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") + $$ = &ast.StmtClass{ast.Node{}, nil, nil, nil, nil, nil, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ABSTRACT T_CLASS { - classModifier := node.NewIdentifier($1.Value) - $$ = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") + classModifier := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.StmtClass{ast.Node{}, nil, []ast.Vertex{classModifier}, nil, nil, nil, nil} // save position - classModifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + classModifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_TRAIT { - $$ = stmt.NewTrait(nil, nil, "") + $$ = &ast.StmtTrait{ast.Node{}, nil, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_FINAL T_CLASS { - classModifier := node.NewIdentifier($1.Value) - $$ = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") + classModifier := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.StmtClass{ast.Node{}, nil, []ast.Vertex{classModifier}, nil, nil, nil, nil} // save position - classModifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + classModifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1728,19 +1719,19 @@ class_entry_type: extends_from: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EXTENDS fully_qualified_class_name { - $$ = stmt.NewClassExtends($2); + $$ = &ast.StmtClassExtends{ast.Node{}, $2}; // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1756,19 +1747,19 @@ interface_entry: interface_extends_list: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EXTENDS interface_list { - $$ = stmt.NewInterfaceExtends($2); + $$ = &ast.StmtInterfaceExtends{ast.Node{}, $2}; // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1777,19 +1768,19 @@ interface_extends_list: implements_list: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_IMPLEMENTS interface_list { - $$ = stmt.NewClassImplements($2); + $$ = &ast.StmtClassImplements{ast.Node{}, $2}; // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1798,7 +1789,7 @@ implements_list: interface_list: fully_qualified_class_name { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1807,7 +1798,7 @@ interface_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1816,7 +1807,7 @@ interface_list: foreach_optional_arg: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1825,7 +1816,7 @@ foreach_optional_arg: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Key, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Key, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1834,33 +1825,33 @@ foreach_optional_arg: foreach_variable: variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '&' variable { - $$ = expr.NewReference($2) + $$ = &ast.ExprReference{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_LIST '(' assignment_list ')' { - $$ = expr.NewList($3) + $$ = &ast.ExprList{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.List, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.List, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1869,27 +1860,27 @@ foreach_variable: for_statement: statement { - $$ = stmt.NewFor(nil, nil, nil, $1) + $$ = &ast.StmtFor{ast.Node{}, nil, nil, nil, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDFOR ';' { - stmtList := stmt.NewStmtList($2) - $$ = stmt.NewAltFor(nil, nil, nil, stmtList) + stmtList := &ast.StmtStmtList{ast.Node{}, $2} + $$ = &ast.StmtAltFor{ast.Node{}, nil, nil, nil, stmtList} // save position - stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1898,27 +1889,27 @@ for_statement: foreach_statement: statement { - $$ = stmt.NewForeach(nil, nil, nil, $1) + $$ = &ast.StmtForeach{ast.Node{}, nil, nil, nil, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDFOREACH ';' { - stmtList := stmt.NewStmtList($2) - $$ = stmt.NewAltForeach(nil, nil, nil, stmtList) + stmtList := &ast.StmtStmtList{ast.Node{}, $2} + $$ = &ast.StmtAltForeach{ast.Node{}, nil, nil, nil, stmtList} // save position - stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1928,27 +1919,27 @@ foreach_statement: declare_statement: statement { - $$ = stmt.NewDeclare(nil, $1, false) + $$ = &ast.StmtDeclare{ast.Node{}, false, nil, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDDECLARE ';' { - stmtList := stmt.NewStmtList($2) - $$ = stmt.NewDeclare(nil, stmtList, true) + stmtList := &ast.StmtStmtList{ast.Node{}, $2} + $$ = &ast.StmtDeclare{ast.Node{}, true, nil, stmtList} // save position - stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1958,34 +1949,34 @@ declare_statement: declare_list: T_STRING '=' static_scalar { - name := node.NewIdentifier($1.Value) - constant := stmt.NewConstant(name, $3, "") - $$ = []node.Node{constant} + name := &ast.Identifier{ast.Node{}, $1.Value} + constant := &ast.StmtConstant{ast.Node{}, name, $3} + $$ = []ast.Vertex{constant} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | declare_list ',' T_STRING '=' static_scalar { - name := node.NewIdentifier($3.Value) - constant := stmt.NewConstant(name, $5, "") + name := &ast.Identifier{ast.Node{}, $3.Value} + constant := &ast.StmtConstant{ast.Node{}, name, $5} $$ = append($1, constant) // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1995,68 +1986,68 @@ declare_list: switch_case_list: '{' case_list '}' { - caseList := stmt.NewCaseList($2) - $$ = stmt.NewSwitch(nil, caseList) + caseList := &ast.StmtCaseList{ast.Node{}, $2} + $$ = &ast.StmtSwitch{ast.Node{}, nil, caseList} // save position - caseList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(caseList, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '{' ';' case_list '}' { - caseList := stmt.NewCaseList($3) - $$ = stmt.NewSwitch(nil, caseList) + caseList := &ast.StmtCaseList{ast.Node{}, $3} + $$ = &ast.StmtSwitch{ast.Node{}, nil, caseList} // save position - caseList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating(caseList, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListStart, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListStart, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' case_list T_ENDSWITCH ';' { - caseList := stmt.NewCaseList($2) - $$ = stmt.NewAltSwitch(nil, caseList) + caseList := &ast.StmtCaseList{ast.Node{}, $2} + $$ = &ast.StmtAltSwitch{ast.Node{}, nil, caseList} // save position - caseList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' ';' case_list T_ENDSWITCH ';' { - caseList := stmt.NewCaseList($3) - $$ = stmt.NewAltSwitch(nil, caseList) + caseList := &ast.StmtCaseList{ast.Node{}, $3} + $$ = &ast.StmtAltSwitch{ast.Node{}, nil, caseList} // save position - caseList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListStart, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListStart, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2066,37 +2057,37 @@ switch_case_list: case_list: /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | case_list T_CASE expr case_separator inner_statement_list { - _case := stmt.NewCase($3, $5) + _case := &ast.StmtCase{ast.Node{}, $3, $5} $$ = append($1, _case) // save position - _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) + _case.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5) // save comments - yylex.(*Parser).setFreeFloating(_case, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(_case, freefloating.Expr, $4.FreeFloating) - yylex.(*Parser).setFreeFloating(_case, freefloating.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating(_case, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_case, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating(_case, token.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | case_list T_DEFAULT case_separator inner_statement_list { - _default := stmt.NewDefault($4) + _default := &ast.StmtDefault{ast.Node{}, $4} $$ = append($1, _default) // save position - _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) + _default.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating(_default, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(_default, freefloating.Default, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(_default, freefloating.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating(_default, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_default, token.Default, $3.Tokens) + yylex.(*Parser).setFreeFloating(_default, token.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2118,27 +2109,27 @@ case_separator: while_statement: statement { - $$ = stmt.NewWhile(nil, $1) + $$ = &ast.StmtWhile{ast.Node{}, nil, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDWHILE ';' { - stmtList := stmt.NewStmtList($2) - $$ = stmt.NewAltWhile(nil, stmtList) + stmtList := &ast.StmtStmtList{ast.Node{}, $2} + $$ = &ast.StmtAltWhile{ast.Node{}, nil, stmtList} // save position - stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2149,25 +2140,25 @@ while_statement: elseif_list: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | elseif_list T_ELSEIF parenthesis_expr statement { - _elseIf := stmt.NewElseIf($3, $4) + _elseIf := &ast.StmtElseIf{ast.Node{}, $3, $4} $$ = append($1, _elseIf) // save position - _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) + _elseIf.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Start, $2.FreeFloating) - if len((*$3.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.ElseIf, (*$3.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$3.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$3.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) + if len($3.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.GetNode().Tokens[token.OpenParenthesisToken][:len($3.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($3.GetNode().Tokens, token.OpenParenthesisToken) } - if len((*$3.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Expr, (*$3.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$3.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$3.GetFreeFloating()), freefloating.CloseParenthesisToken) + if len($3.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(_elseIf, token.Expr, $3.GetNode().Tokens[token.CloseParenthesisToken][:len($3.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($3.GetNode().Tokens, token.CloseParenthesisToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2178,29 +2169,29 @@ elseif_list: new_elseif_list: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | new_elseif_list T_ELSEIF parenthesis_expr ':' inner_statement_list { - stmts := stmt.NewStmtList($5) - _elseIf := stmt.NewAltElseIf($3, stmts) + stmts := &ast.StmtStmtList{ast.Node{}, $5} + _elseIf := &ast.StmtAltElseIf{ast.Node{}, $3, stmts} $$ = append($1, _elseIf) // save position - stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($5)) - _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) + stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($5) + _elseIf.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5) // save comments - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Start, $2.FreeFloating) - if len((*$3.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.ElseIf, (*$3.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$3.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$3.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) + if len($3.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.GetNode().Tokens[token.OpenParenthesisToken][:len($3.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($3.GetNode().Tokens, token.OpenParenthesisToken) } - if len((*$3.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Expr, (*$3.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$3.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$3.GetFreeFloating()), freefloating.CloseParenthesisToken) + if len($3.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(_elseIf, token.Expr, $3.GetNode().Tokens[token.CloseParenthesisToken][:len($3.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($3.GetNode().Tokens, token.CloseParenthesisToken) } - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Cond, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(_elseIf, token.Cond, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2210,19 +2201,19 @@ new_elseif_list: else_single: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ELSE statement { - $$ = stmt.NewElse($2) + $$ = &ast.StmtElse{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2232,22 +2223,22 @@ else_single: new_else_single: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ELSE ':' inner_statement_list { - stmts := stmt.NewStmtList($3) - $$ = stmt.NewAltElse(stmts) + stmts := &ast.StmtStmtList{ast.Node{}, $3} + $$ = &ast.StmtAltElse{ast.Node{}, stmts} // save position - stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - + stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Else, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Else, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2257,13 +2248,13 @@ new_else_single: parameter_list: non_empty_parameter_list { - $$ = $1; + $$ = $1; yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2272,7 +2263,7 @@ parameter_list: non_empty_parameter_list: parameter { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2281,7 +2272,7 @@ non_empty_parameter_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2290,21 +2281,21 @@ non_empty_parameter_list: parameter: optional_class_type is_reference is_variadic T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($4.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = node.NewParameter($1, variable, nil, $2 != nil, $3 != nil) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.Parameter{ast.Node{}, $2 != nil, $3 != nil, $1, variable, nil} // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) if $1 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) } else if $2 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($2, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($2, $4) } else if $3 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4) } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) } // save comments @@ -2312,44 +2303,43 @@ parameter: yylex.(*Parser).MoveFreeFloating($1, $$) } if $2 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Tokens) } if $3 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) } - yylex.(*Parser).setFreeFloating($$, freefloating.Variadic, $4.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) // normalize if $3 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, (*$$.GetFreeFloating())[freefloating.Variadic]); delete((*$$.GetFreeFloating()), freefloating.Variadic) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $$.GetNode().Tokens[token.Variadic]); delete($$.GetNode().Tokens, token.Variadic) } if $2 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, (*$$.GetFreeFloating())[freefloating.Ampersand]); delete((*$$.GetFreeFloating()), freefloating.Ampersand) + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $$.GetNode().Tokens[token.Ampersand]); delete($$.GetNode().Tokens, token.Ampersand) } if $1 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Start, (*$$.GetFreeFloating())[freefloating.OptionalType]); delete((*$$.GetFreeFloating()), freefloating.OptionalType) + yylex.(*Parser).setFreeFloating($$, token.Start, $$.GetNode().Tokens[token.OptionalType]); delete($$.GetNode().Tokens, token.OptionalType) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | optional_class_type is_reference is_variadic T_VARIABLE '=' static_scalar { - identifier := node.NewIdentifier(strings.TrimLeftFunc($4.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = node.NewParameter($1, variable, $6, $2 != nil, $3 != nil) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.Parameter{ast.Node{}, $2 != nil, $3 != nil, $1, variable, $6} // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) if $1 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6) } else if $2 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6) } else if $3 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $6)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $6) } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6) } // save comments @@ -2357,24 +2347,23 @@ parameter: yylex.(*Parser).MoveFreeFloating($1, $$) } if $2 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Tokens) } if $3 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) } - yylex.(*Parser).setFreeFloating($$, freefloating.Variadic, $4.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $5.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) // normalize if $3 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, (*$$.GetFreeFloating())[freefloating.Variadic]); delete((*$$.GetFreeFloating()), freefloating.Variadic) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $$.GetNode().Tokens[token.Variadic]); delete($$.GetNode().Tokens, token.Variadic) } if $2 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, (*$$.GetFreeFloating())[freefloating.Ampersand]); delete((*$$.GetFreeFloating()), freefloating.Ampersand) + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $$.GetNode().Tokens[token.Ampersand]); delete($$.GetNode().Tokens, token.Ampersand) } if $1 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Start, (*$$.GetFreeFloating())[freefloating.OptionalType]); delete((*$$.GetFreeFloating()), freefloating.OptionalType) + yylex.(*Parser).setFreeFloating($$, token.Start, $$.GetNode().Tokens[token.OptionalType]); delete($$.GetNode().Tokens, token.OptionalType) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2385,37 +2374,37 @@ parameter: optional_class_type: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ARRAY { - $$ = node.NewIdentifier($1.Value) + $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CALLABLE { - $$ = node.NewIdentifier($1.Value) + $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | fully_qualified_class_name { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2425,42 +2414,42 @@ optional_class_type: function_call_parameter_list: '(' ')' { - $$ = node.NewArgumentList(nil) + $$ = &ast.ArgumentList{ast.Node{}, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '(' non_empty_function_call_parameter_list ')' { - $$ = node.NewArgumentList($2) + $$ = &ast.ArgumentList{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '(' yield_expr ')' { - arg := node.NewArgument($2, false, false) - $$ = node.NewArgumentList([]node.Node{arg}) + arg := &ast.Argument{ast.Node{}, false, false, $2} + $$ = &ast.ArgumentList{ast.Node{}, []ast.Vertex{arg}} // save position - arg.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + arg.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2470,7 +2459,7 @@ function_call_parameter_list: non_empty_function_call_parameter_list: function_call_parameter { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2479,7 +2468,7 @@ non_empty_function_call_parameter_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2488,10 +2477,10 @@ non_empty_function_call_parameter_list: function_call_parameter: expr_without_variable { - $$ = node.NewArgument($1, false, false) + $$ = &ast.Argument{ast.Node{}, false, false, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -2500,10 +2489,10 @@ function_call_parameter: } | variable { - $$ = node.NewArgument($1, false, false) + $$ = &ast.Argument{ast.Node{}, false, false, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -2512,25 +2501,25 @@ function_call_parameter: } | '&' w_variable { - $$ = node.NewArgument($2, false, true) + $$ = &ast.Argument{ast.Node{}, false, true, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ELLIPSIS expr { - $$ = node.NewArgument($2, true, false) + $$ = &ast.Argument{ast.Node{}, true, false, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2542,13 +2531,13 @@ global_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | global_var { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2558,44 +2547,43 @@ global_var_list: global_var: T_VARIABLE { - name := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - $$ = expr.NewVariable(name) + name := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + $$ = &ast.ExprVariable{ast.Node{}, name} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken($$) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '$' r_variable { - $$ = expr.NewVariable($2) + $$ = &ast.ExprVariable{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '$' '{' expr '}' { - $$ = expr.NewVariable($3) + $$ = &ast.ExprVariable{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($3, freefloating.Start, append($2.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($2), (*$3.GetFreeFloating())[freefloating.Start]...)...)) - yylex.(*Parser).setFreeFloating($3, freefloating.End, append((*$3.GetFreeFloating())[freefloating.End], append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2605,77 +2593,73 @@ global_var: static_var_list: static_var_list ',' T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($3.Value, isDollar)) - variable := expr.NewVariable(identifier) - staticVar := stmt.NewStaticVar(variable, nil) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($3.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + staticVar := &ast.StmtStaticVar{ast.Node{}, variable, nil} $$ = append($1, staticVar) - + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + staticVar.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(staticVar, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_var_list ',' T_VARIABLE '=' static_scalar { - identifier := node.NewIdentifier(strings.TrimLeftFunc($3.Value, isDollar)) - variable := expr.NewVariable(identifier) - staticVar := stmt.NewStaticVar(variable, $5) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($3.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + staticVar := &ast.StmtStaticVar{ast.Node{}, variable, $5} $$ = append($1, staticVar) - + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + staticVar.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(staticVar, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(staticVar, freefloating.Var, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Var, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - staticVar := stmt.NewStaticVar(variable, nil) - $$ = []node.Node{staticVar} - + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + staticVar := &ast.StmtStaticVar{ast.Node{}, variable, nil} + $$ = []ast.Vertex{staticVar} + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + staticVar.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(staticVar, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE '=' static_scalar { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - staticVar := stmt.NewStaticVar(variable, $3) - $$ = []node.Node{staticVar} - + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + staticVar := &ast.StmtStaticVar{ast.Node{}, variable, $3} + $$ = []ast.Vertex{staticVar} + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + staticVar.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(staticVar, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(staticVar, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2685,13 +2669,13 @@ static_var_list: class_statement_list: class_statement_list class_statement { - $$ = append($1, $2) + $$ = append($1, $2) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2701,15 +2685,15 @@ class_statement_list: class_statement: variable_modifiers class_variable_declaration ';' { - $$ = stmt.NewPropertyList($1, nil, $2) + $$ = &ast.StmtPropertyList{ast.Node{}, $1, nil, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, freefloating.PropertyList, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.PropertyList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2718,11 +2702,11 @@ class_statement: $$ = $1 // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.ConstList, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.ConstList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2734,32 +2718,32 @@ class_statement: } | method_modifiers function is_reference T_STRING '(' parameter_list ')' method_body { - name := node.NewIdentifier($4.Value) - $$ = stmt.NewClassMethod(name, $1, $3 != nil, $6, nil, $8, "") + name := &ast.Identifier{ast.Node{}, $4.Value} + $$ = &ast.StmtClassMethod{ast.Node{}, $3 != nil, name, $1, $6, nil, $8} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) if $1 == nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $8)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $8) } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListNodePosition($1, $8)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListNodePosition($1, $8) } // save comments if len($1) > 0 { yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $2.Tokens) } if $3 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) } - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $7.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $7.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2768,13 +2752,13 @@ class_statement: trait_use_statement: T_USE trait_list trait_adaptations { - $$ = stmt.NewTraitUse($2, $3) + $$ = &ast.StmtTraitUse{ast.Node{}, $2, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2783,7 +2767,7 @@ trait_use_statement: trait_list: fully_qualified_class_name { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2792,7 +2776,7 @@ trait_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2801,25 +2785,25 @@ trait_list: trait_adaptations: ';' { - $$ = stmt.NewNop() + $$ = &ast.StmtNop{ast.Node{}, } - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '{' trait_adaptation_list '}' { - $$ = stmt.NewTraitAdaptationList($2) + $$ = &ast.StmtTraitAdaptationList{ast.Node{}, $2} - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AdaptationList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2828,13 +2812,13 @@ trait_adaptations: trait_adaptation_list: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_trait_adaptation_list { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2843,13 +2827,13 @@ trait_adaptation_list: non_empty_trait_adaptation_list: trait_adaptation_statement { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_trait_adaptation_list trait_adaptation_statement { - $$ = append($1, $2) + $$ = append($1, $2) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2861,8 +2845,8 @@ trait_adaptation_statement: $$ = $1; // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.NameList, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.NameList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2871,8 +2855,8 @@ trait_adaptation_statement: $$ = $1; // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Alias, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Alias, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2881,14 +2865,14 @@ trait_adaptation_statement: trait_precedence: trait_method_reference_fully_qualified T_INSTEADOF trait_reference_list { - $$ = stmt.NewTraitUsePrecedence($1, $3) + $$ = &ast.StmtTraitUsePrecedence{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2897,7 +2881,7 @@ trait_precedence: trait_reference_list: fully_qualified_class_name { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2906,7 +2890,7 @@ trait_reference_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2915,21 +2899,21 @@ trait_reference_list: trait_method_reference: T_STRING { - name := node.NewIdentifier($1.Value) - $$ = stmt.NewTraitMethodRef(nil, name) + name := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.StmtTraitMethodRef{ast.Node{}, nil, name} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | trait_method_reference_fully_qualified { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2938,17 +2922,17 @@ trait_method_reference: trait_method_reference_fully_qualified: fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { - target := node.NewIdentifier($3.Value) - $$ = stmt.NewTraitMethodRef($1, target) + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtTraitMethodRef{ast.Node{}, $1, target} // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(target, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2957,30 +2941,30 @@ trait_method_reference_fully_qualified: trait_alias: trait_method_reference T_AS trait_modifiers T_STRING { - alias := node.NewIdentifier($4.Value) - $$ = stmt.NewTraitUseAlias($1, $3, alias) + alias := &ast.Identifier{ast.Node{}, $4.Value} + $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, $3, alias} // save position - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | trait_method_reference T_AS member_modifier { - $$ = stmt.NewTraitUseAlias($1, $3, nil) + $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, $3, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2989,42 +2973,42 @@ trait_alias: trait_modifiers: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | member_modifier { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; method_body: - ';' /* abstract method */ + ';' /* abstract method */ { - $$ = stmt.NewNop() + $$ = &ast.StmtNop{ast.Node{}, } // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '{' inner_statement_list '}' { - $$ = stmt.NewStmtList($2) + $$ = &ast.StmtStmtList{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3033,20 +3017,20 @@ method_body: variable_modifiers: non_empty_member_modifiers { - $$ = $1; + $$ = $1; yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VAR { - modifier := node.NewIdentifier($1.Value) - $$ = []node.Node{modifier} + modifier := &ast.Identifier{ast.Node{}, $1.Value} + $$ = []ast.Vertex{modifier} // save position - modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + modifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(modifier, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3055,13 +3039,13 @@ variable_modifiers: method_modifiers: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_member_modifiers { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3070,13 +3054,13 @@ method_modifiers: non_empty_member_modifiers: member_modifier { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_member_modifiers member_modifier { - $$ = append($1, $2) + $$ = append($1, $2) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3085,73 +3069,73 @@ non_empty_member_modifiers: member_modifier: T_PUBLIC { - $$ = node.NewIdentifier($1.Value) + $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_PROTECTED { - $$ = node.NewIdentifier($1.Value) + $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_PRIVATE { - $$ = node.NewIdentifier($1.Value) + $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_STATIC { - $$ = node.NewIdentifier($1.Value) + $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ABSTRACT { - $$ = node.NewIdentifier($1.Value) + $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_FINAL { - $$ = node.NewIdentifier($1.Value) + $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3160,77 +3144,73 @@ member_modifier: class_variable_declaration: class_variable_declaration ',' T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($3.Value, isDollar)) - variable := expr.NewVariable(identifier) - property := stmt.NewProperty(variable, nil, "") + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($3.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + property := &ast.StmtProperty{ast.Node{}, variable, nil} $$ = append($1, property) - + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + property.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(property, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(property, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_variable_declaration ',' T_VARIABLE '=' static_scalar { - identifier := node.NewIdentifier(strings.TrimLeftFunc($3.Value, isDollar)) - variable := expr.NewVariable(identifier) - property := stmt.NewProperty(variable, $5, "") + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($3.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + property := &ast.StmtProperty{ast.Node{}, variable, $5} $$ = append($1, property) - + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) - + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + property.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) + // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(property, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(property, freefloating.Var, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(property, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(property, token.Var, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - property := stmt.NewProperty(variable, nil, "") - $$ = []node.Node{property} - + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + property := &ast.StmtProperty{ast.Node{}, variable, nil} + $$ = []ast.Vertex{property} + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + property.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + // save comments - yylex.(*Parser).setFreeFloating(property, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(property, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE '=' static_scalar { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - property := stmt.NewProperty(variable, $3, "") - $$ = []node.Node{property} - + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + property := &ast.StmtProperty{ast.Node{}, variable, $3} + $$ = []ast.Vertex{property} + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + property.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating(property, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(property, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(property, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(property, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3239,40 +3219,40 @@ class_variable_declaration: class_constant_declaration: class_constant_declaration ',' T_STRING '=' static_scalar { - name := node.NewIdentifier($3.Value) - constant := stmt.NewConstant(name, $5, "") - constList := $1.(*stmt.ClassConstList) + name := &ast.Identifier{ast.Node{}, $3.Value} + constant := &ast.StmtConstant{ast.Node{}, name, $5} + constList := $1.(*ast.StmtClassConstList) lastConst := lastNode(constList.Consts) constList.Consts = append(constList.Consts, constant) $$ = $1 // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) - $1.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) + $1.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating(lastConst, freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(lastConst, token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CONST T_STRING '=' static_scalar { - name := node.NewIdentifier($2.Value) - constant := stmt.NewConstant(name, $4, "") - $$ = stmt.NewClassConstList(nil, []node.Node{constant}) + name := &ast.Identifier{ast.Node{}, $2.Value} + constant := &ast.StmtConstant{ast.Node{}, name, $4} + $$ = &ast.StmtClassConstList{ast.Node{}, nil, []ast.Vertex{constant}} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3284,13 +3264,13 @@ echo_expr_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3300,13 +3280,13 @@ echo_expr_list: for_expr: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_for_expr { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3318,13 +3298,13 @@ non_empty_for_expr: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3333,13 +3313,13 @@ non_empty_for_expr: chaining_method_or_property: chaining_method_or_property variable_property { - $$ = append($1, $2...) + $$ = append($1, $2...) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_property { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3348,29 +3328,29 @@ chaining_method_or_property: chaining_dereference: chaining_dereference '[' dim_offset ']' { - fetch := expr.NewArrayDimFetch(nil, $3) + fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, $3} $$ = append($1, fetch) - + // save position - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '[' dim_offset ']' { - fetch := expr.NewArrayDimFetch(nil, $2) - $$ = []node.Node{fetch} - + fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, $2} + $$ = []ast.Vertex{fetch} + // save position - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($2)) - + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($2) + // save comments - yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3379,19 +3359,19 @@ chaining_dereference: chaining_instance_call: chaining_dereference chaining_method_or_property { - $$ = append($1, $2...) + $$ = append($1, $2...) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | chaining_dereference { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | chaining_method_or_property { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3400,13 +3380,13 @@ chaining_instance_call: instance_call: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | chaining_instance_call { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3417,15 +3397,15 @@ new_expr: { if $3 != nil { - $$ = expr.NewNew($2, $3.(*node.ArgumentList)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + $$ = &ast.ExprNew{ast.Node{}, $2, $3.(*ast.ArgumentList)} + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) } else { - $$ = expr.NewNew($2, nil) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$ = &ast.ExprNew{ast.Node{}, $2, nil} + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) } // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3434,691 +3414,691 @@ new_expr: expr_without_variable: T_LIST '(' assignment_list ')' '=' expr { - listNode := expr.NewList($3) - $$ = assign.NewAssign(listNode, $6) + listNode := &ast.ExprList{ast.Node{}, $3} + $$ = &ast.ExprAssign{ast.Node{}, listNode, $6} // save position - listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) + listNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.List, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $5.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable '=' expr { - $$ = assign.NewAssign($1, $3) + $$ = &ast.ExprAssign{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable '=' '&' variable { - $$ = assign.NewReference($1, $4) + $$ = &ast.ExprAssignReference{ast.Node{}, $1, $4} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Equal, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable '=' '&' T_NEW class_name_reference ctor_arguments { - var _new *expr.New + var _new *ast.ExprNew if $6 != nil { - _new = expr.NewNew($5, $6.(*node.ArgumentList)) + _new = &ast.ExprNew{ast.Node{}, $5, $6.(*ast.ArgumentList)} } else { - _new = expr.NewNew($5, nil) + _new = &ast.ExprNew{ast.Node{}, $5, nil} } - $$ = assign.NewReference($1, _new) + $$ = &ast.ExprAssignReference{ast.Node{}, $1, _new} // save position if $6 != nil { - _new.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) + _new.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6) } else { - _new.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $5)) + _new.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $5) } - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, _new)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, _new) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Equal, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(_new, freefloating.Start, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Tokens) + yylex.(*Parser).setFreeFloating(_new, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CLONE expr { - $$ = expr.NewClone($2) + $$ = &ast.ExprClone{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_PLUS_EQUAL expr { - $$ = assign.NewPlus($1, $3) + $$ = &ast.ExprAssignPlus{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_MINUS_EQUAL expr { - $$ = assign.NewMinus($1, $3) + $$ = &ast.ExprAssignMinus{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_MUL_EQUAL expr { - $$ = assign.NewMul($1, $3) + $$ = &ast.ExprAssignMul{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_POW_EQUAL expr { - $$ = assign.NewPow($1, $3) + $$ = &ast.ExprAssignPow{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_DIV_EQUAL expr { - $$ = assign.NewDiv($1, $3) + $$ = &ast.ExprAssignDiv{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_CONCAT_EQUAL expr { - $$ = assign.NewConcat($1, $3) + $$ = &ast.ExprAssignConcat{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_MOD_EQUAL expr { - $$ = assign.NewMod($1, $3) + $$ = &ast.ExprAssignMod{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_AND_EQUAL expr { - $$ = assign.NewBitwiseAnd($1, $3) + $$ = &ast.ExprAssignBitwiseAnd{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_OR_EQUAL expr { - $$ = assign.NewBitwiseOr($1, $3) + $$ = &ast.ExprAssignBitwiseOr{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_XOR_EQUAL expr { - $$ = assign.NewBitwiseXor($1, $3) + $$ = &ast.ExprAssignBitwiseXor{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_SL_EQUAL expr { - $$ = assign.NewShiftLeft($1, $3) + $$ = &ast.ExprAssignShiftLeft{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_SR_EQUAL expr { - $$ = assign.NewShiftRight($1, $3) + $$ = &ast.ExprAssignShiftRight{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | rw_variable T_INC { - $$ = expr.NewPostInc($1) + $$ = &ast.ExprPostInc{ast.Node{}, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_INC rw_variable { - $$ = expr.NewPreInc($2) + $$ = &ast.ExprPreInc{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | rw_variable T_DEC { - $$ = expr.NewPostDec($1) + $$ = &ast.ExprPostDec{ast.Node{}, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DEC rw_variable { - $$ = expr.NewPreDec($2) + $$ = &ast.ExprPreDec{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_BOOLEAN_OR expr { - $$ = binary.NewBooleanOr($1, $3) + $$ = &ast.ExprBinaryBooleanOr{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_BOOLEAN_AND expr { - $$ = binary.NewBooleanAnd($1, $3) + $$ = &ast.ExprBinaryBooleanAnd{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_LOGICAL_OR expr { - $$ = binary.NewLogicalOr($1, $3) + $$ = &ast.ExprBinaryLogicalOr{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_LOGICAL_AND expr { - $$ = binary.NewLogicalAnd($1, $3) + $$ = &ast.ExprBinaryLogicalAnd{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_LOGICAL_XOR expr { - $$ = binary.NewLogicalXor($1, $3) + $$ = &ast.ExprBinaryLogicalXor{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '|' expr { - $$ = binary.NewBitwiseOr($1, $3) + $$ = &ast.ExprBinaryBitwiseOr{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '&' expr { - $$ = binary.NewBitwiseAnd($1, $3) + $$ = &ast.ExprBinaryBitwiseAnd{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '^' expr { - $$ = binary.NewBitwiseXor($1, $3) + $$ = &ast.ExprBinaryBitwiseXor{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '.' expr { - $$ = binary.NewConcat($1, $3) + $$ = &ast.ExprBinaryConcat{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '+' expr { - $$ = binary.NewPlus($1, $3) + $$ = &ast.ExprBinaryPlus{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '-' expr { - $$ = binary.NewMinus($1, $3) + $$ = &ast.ExprBinaryMinus{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '*' expr { - $$ = binary.NewMul($1, $3) + $$ = &ast.ExprBinaryMul{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_POW expr { - $$ = binary.NewPow($1, $3) + $$ = &ast.ExprBinaryPow{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '/' expr { - $$ = binary.NewDiv($1, $3) + $$ = &ast.ExprBinaryDiv{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '%' expr { - $$ = binary.NewMod($1, $3) + $$ = &ast.ExprBinaryMod{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_SL expr { - $$ = binary.NewShiftLeft($1, $3) + $$ = &ast.ExprBinaryShiftLeft{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_SR expr { - $$ = binary.NewShiftRight($1, $3) + $$ = &ast.ExprBinaryShiftRight{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '+' expr %prec T_INC { - $$ = expr.NewUnaryPlus($2) + $$ = &ast.ExprUnaryPlus{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '-' expr %prec T_INC { - $$ = expr.NewUnaryMinus($2) + $$ = &ast.ExprUnaryMinus{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '!' expr { - $$ = expr.NewBooleanNot($2) + $$ = &ast.ExprBooleanNot{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '~' expr { - $$ = expr.NewBitwiseNot($2) + $$ = &ast.ExprBitwiseNot{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_IDENTICAL expr { - $$ = binary.NewIdentical($1, $3) + $$ = &ast.ExprBinaryIdentical{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_NOT_IDENTICAL expr { - $$ = binary.NewNotIdentical($1, $3) + $$ = &ast.ExprBinaryNotIdentical{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_EQUAL expr { - $$ = binary.NewEqual($1, $3) + $$ = &ast.ExprBinaryEqual{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_NOT_EQUAL expr { - $$ = binary.NewNotEqual($1, $3) + $$ = &ast.ExprBinaryNotEqual{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '<' expr { - $$ = binary.NewSmaller($1, $3) + $$ = &ast.ExprBinarySmaller{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_SMALLER_OR_EQUAL expr { - $$ = binary.NewSmallerOrEqual($1, $3) + $$ = &ast.ExprBinarySmallerOrEqual{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '>' expr { - $$ = binary.NewGreater($1, $3) + $$ = &ast.ExprBinaryGreater{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_GREATER_OR_EQUAL expr { - $$ = binary.NewGreaterOrEqual($1, $3) + $$ = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_INSTANCEOF class_name_reference { - $$ = expr.NewInstanceOf($1, $3) + $$ = &ast.ExprInstanceOf{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | parenthesis_expr { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - yylex.(*Parser).setFreeFloating($1, freefloating.Start, append((*$1.GetFreeFloating())[freefloating.OpenParenthesisToken], (*$1.GetFreeFloating())[freefloating.Start]...)); delete((*$1.GetFreeFloating()), freefloating.OpenParenthesisToken) - yylex.(*Parser).setFreeFloating($1, freefloating.End, append((*$1.GetFreeFloating())[freefloating.End], (*$1.GetFreeFloating())[freefloating.CloseParenthesisToken]...)); delete((*$1.GetFreeFloating()), freefloating.CloseParenthesisToken) + yylex.(*Parser).setFreeFloating($1, token.Start, append($1.GetNode().Tokens[token.OpenParenthesisToken], $1.GetNode().Tokens[token.Start]...)); delete($1.GetNode().Tokens, token.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating($1, token.End, append($1.GetNode().Tokens[token.End], $1.GetNode().Tokens[token.CloseParenthesisToken]...)); delete($1.GetNode().Tokens, token.CloseParenthesisToken) } | new_expr { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4127,294 +4107,294 @@ expr_without_variable: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) for _, n := range($4) { switch nn := n.(type) { - case *expr.ArrayDimFetch: - nn.Variable = $$ + case *ast.ExprArrayDimFetch: + nn.Var = $$ $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) - - case *expr.PropertyFetch: - nn.Variable = $$ + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) + + case *ast.ExprPropertyFetch: + nn.Var = $$ $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) - - case *expr.MethodCall: - nn.Variable = $$ + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) + + case *ast.ExprMethodCall: + nn.Var = $$ $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, n)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, n) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '?' expr ':' expr { - $$ = expr.NewTernary($1, $3, $5) + $$ = &ast.ExprTernary{ast.Node{}, $1, $3, $5} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.True, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '?' ':' expr { - $$ = expr.NewTernary($1, nil, $4) + $$ = &ast.ExprTernary{ast.Node{}, $1, nil, $4} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.True, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | internal_functions_in_yacc { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_INT_CAST expr { - $$ = cast.NewInt($2) + $$ = &ast.ExprCastInt{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DOUBLE_CAST expr { - $$ = cast.NewDouble($2) + $$ = &ast.ExprCastDouble{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_STRING_CAST expr { - $$ = cast.NewString($2) + $$ = &ast.ExprCastString{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ARRAY_CAST expr { - $$ = cast.NewArray($2) + $$ = &ast.ExprCastArray{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_OBJECT_CAST expr { - $$ = cast.NewObject($2) + $$ = &ast.ExprCastObject{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_BOOL_CAST expr { - $$ = cast.NewBool($2) + $$ = &ast.ExprCastBool{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_UNSET_CAST expr { - $$ = cast.NewUnset($2) + $$ = &ast.ExprCastUnset{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EXIT exit_expr { - e := $2.(*expr.Exit) + e := $2.(*ast.ExprExit) $$ = $2 - if (strings.EqualFold($1.Value, "die")) { + if (bytes.EqualFold($1.Value, []byte("die"))) { e.Die = true } // save position - if $2.GetPosition() == nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + if $2.GetNode().Position == nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) } // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '@' expr { - $$ = expr.NewErrorSuppress($2) + $$ = &ast.ExprErrorSuppress{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | scalar { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | combined_scalar_offset { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | combined_scalar { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '`' backticks_expr '`' { - $$ = expr.NewShellExec($2) + $$ = &ast.ExprShellExec{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_PRINT expr { - $$ = expr.NewPrint($2) + $$ = &ast.ExprPrint{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_YIELD { - $$ = expr.NewYield(nil, nil) + $$ = &ast.ExprYield{ast.Node{}, nil, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { - $$ = expr.NewClosure($4, $6, nil, $8, false, $2 != nil, "") + $$ = &ast.ExprClosure{ast.Node{}, $2 != nil, false, $4, $6, nil, $8} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) if $2 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) } - yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVars, $7.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $9.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Tokens) // normalize if $6 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$$.GetFreeFloating())[freefloating.LexicalVars]); delete((*$$.GetFreeFloating()), freefloating.LexicalVars) + yylex.(*Parser).setFreeFloating($$, token.Params, $$.GetNode().Tokens[token.LexicalVars]); delete($$.GetNode().Tokens, token.LexicalVars) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_STATIC function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { - $$ = expr.NewClosure($5, $7, nil, $9, true, $3 != nil, "") + $$ = &ast.ExprClosure{ast.Node{}, $3 != nil, true, $5, $7, nil, $9} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $10)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $10) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Static, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Static, $2.Tokens) if $3 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) } - yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVars, $8.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $10.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $8.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $10.Tokens) // normalize if $7 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$$.GetFreeFloating())[freefloating.LexicalVars]); delete((*$$.GetFreeFloating()), freefloating.LexicalVars) + yylex.(*Parser).setFreeFloating($$, token.Params, $$.GetNode().Tokens[token.LexicalVars]); delete($$.GetNode().Tokens, token.LexicalVars) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4424,51 +4404,51 @@ expr_without_variable: yield_expr: T_YIELD expr_without_variable { - $$ = expr.NewYield(nil, $2) + $$ = &ast.ExprYield{ast.Node{}, nil, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_YIELD variable { - $$ = expr.NewYield(nil, $2) + $$ = &ast.ExprYield{ast.Node{}, nil, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_YIELD expr T_DOUBLE_ARROW expr_without_variable { - $$ = expr.NewYield($2, $4) + $$ = &ast.ExprYield{ast.Node{}, $2, $4} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_YIELD expr T_DOUBLE_ARROW variable { - $$ = expr.NewYield($2, $4) + $$ = &ast.ExprYield{ast.Node{}, $2, $4} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4477,59 +4457,59 @@ yield_expr: combined_scalar_offset: combined_scalar '[' dim_offset ']' { - $$ = expr.NewArrayDimFetch($1, $3) + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | combined_scalar_offset '[' dim_offset ']' { - $$ = expr.NewArrayDimFetch($1, $3) + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' { - str := scalar.NewString($1.Value) - $$ = expr.NewArrayDimFetch(str, $3) + str := &ast.ScalarString{ast.Node{}, $1.Value} + $$ = &ast.ExprArrayDimFetch{ast.Node{}, str, $3} // save position - str.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, $4)) + str.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | general_constant '[' dim_offset ']' { - $$ = expr.NewArrayDimFetch($1, $3) + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4538,28 +4518,28 @@ combined_scalar_offset: combined_scalar: T_ARRAY '(' array_pair_list ')' { - $$ = expr.NewArray($3) + $$ = &ast.ExprArray{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Array, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Array, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '[' array_pair_list ']' { - $$ = expr.NewShortArray($2) + $$ = &ast.ExprShortArray{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4575,21 +4555,21 @@ function: lexical_vars: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_USE '(' lexical_var_list ')' { - $$ = expr.NewClosureUse($3) + $$ = &ast.ExprClosureUse{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Use, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVarList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Use, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.LexicalVarList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4598,73 +4578,69 @@ lexical_vars: lexical_var_list: lexical_var_list ',' T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($3.Value, isDollar)) - variable := expr.NewVariable(identifier) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($3.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = append($1, variable) // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | lexical_var_list ',' '&' T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($4.Value, isDollar)) - variable := expr.NewVariable(identifier) - reference := expr.NewReference(variable) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + reference := &ast.ExprReference{ast.Node{}, variable} $$ = append($1, reference) // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(reference, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $4.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = []node.Node{variable} + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = []ast.Vertex{variable} // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(variable, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '&' T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($2.Value, isDollar)) - variable := expr.NewVariable(identifier) - reference := expr.NewReference(variable) - $$ = []node.Node{reference} - + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($2.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + reference := &ast.ExprReference{ast.Node{}, variable} + $$ = []ast.Vertex{reference} + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating(reference, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(reference, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4673,12 +4649,12 @@ lexical_var_list: function_call: namespace_name function_call_parameter_list { - name := name.NewName($1) - $$ = expr.NewFunctionCall(name, $2.(*node.ArgumentList)) - + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.ExprFunctionCall{ast.Node{}, name, $2.(*ast.ArgumentList)} + // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(name, $2)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition(name, $2) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -4687,91 +4663,91 @@ function_call: } | T_NAMESPACE T_NS_SEPARATOR namespace_name function_call_parameter_list { - funcName := name.NewRelative($3) - $$ = expr.NewFunctionCall(funcName, $4.(*node.ArgumentList)) - + funcName := &ast.NameRelative{ast.Node{}, $3} + $$ = &ast.ExprFunctionCall{ast.Node{}, funcName, $4.(*ast.ArgumentList)} + // save position - funcName.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $4)) + funcName.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(funcName, freefloating.Namespace, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(funcName, token.Namespace, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name function_call_parameter_list { - funcName := name.NewFullyQualified($2) - $$ = expr.NewFunctionCall(funcName, $3.(*node.ArgumentList)) - + funcName := &ast.NameFullyQualified{ast.Node{}, $2} + $$ = &ast.ExprFunctionCall{ast.Node{}, funcName, $3.(*ast.ArgumentList)} + // save position - funcName.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $3)) + funcName.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list { - $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) - + $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list { - $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) - + $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list { - $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) - + $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list { - $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) - + $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_without_objects function_call_parameter_list { - $$ = expr.NewFunctionCall($1, $2.(*node.ArgumentList)) - + $$ = &ast.ExprFunctionCall{ast.Node{}, $1, $2.(*ast.ArgumentList)} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4783,23 +4759,23 @@ function_call: class_name: T_STATIC { - $$ = node.NewIdentifier($1.Value) - + $$ = &ast.Identifier{ast.Node{}, $1.Value} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } - | namespace_name + | namespace_name { - $$ = name.NewName($1) - + $$ = &ast.NameName{ast.Node{}, $1} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -4807,26 +4783,26 @@ class_name: } | T_NAMESPACE T_NS_SEPARATOR namespace_name { - $$ = name.NewRelative($3) - + $$ = &ast.NameRelative{ast.Node{}, $3} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Namespace, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name { - $$ = name.NewFullyQualified($2) - + $$ = &ast.NameFullyQualified{ast.Node{}, $2} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4835,11 +4811,11 @@ class_name: fully_qualified_class_name: namespace_name { - $$ = name.NewName($1) - + $$ = &ast.NameName{ast.Node{}, $1} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -4847,26 +4823,26 @@ fully_qualified_class_name: } | T_NAMESPACE T_NS_SEPARATOR namespace_name { - $$ = name.NewRelative($3) - + $$ = &ast.NameRelative{ast.Node{}, $3} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Namespace, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name { - $$ = name.NewFullyQualified($2) - + $$ = &ast.NameFullyQualified{ast.Node{}, $2} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4875,13 +4851,13 @@ fully_qualified_class_name: class_name_reference: class_name { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | dynamic_class_name_reference { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4893,45 +4869,45 @@ dynamic_class_name_reference: $$ = $1 // save comments - yylex.(*Parser).setFreeFloating($3[0], freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($3[0], token.Var, $2.Tokens) for _, n := range($3) { switch nn := n.(type) { - case *expr.ArrayDimFetch: - nn.Variable = $$ - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + case *ast.ExprArrayDimFetch: + nn.Var = $$ + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) - - case *expr.PropertyFetch: - nn.Variable = $$ - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) + + case *ast.ExprPropertyFetch: + nn.Var = $$ + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } } for _, n := range($4) { switch nn := n.(type) { - case *expr.ArrayDimFetch: - nn.Variable = $$ - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + case *ast.ExprArrayDimFetch: + nn.Var = $$ + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) - - case *expr.PropertyFetch: - nn.Variable = $$ - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) + + case *ast.ExprPropertyFetch: + nn.Var = $$ + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } - | base_variable + | base_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4941,13 +4917,13 @@ dynamic_class_name_reference: dynamic_class_name_variable_properties: dynamic_class_name_variable_properties dynamic_class_name_variable_property { - $$ = append($1, $2...) + $$ = append($1, $2...) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4958,9 +4934,9 @@ dynamic_class_name_variable_property: T_OBJECT_OPERATOR object_property { $$ = $2 - + // save comments - yylex.(*Parser).setFreeFloating($2[0], freefloating.Var, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($2[0], token.Var, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4969,62 +4945,62 @@ dynamic_class_name_variable_property: exit_expr: /* empty */ { - $$ = expr.NewExit(nil); + $$ = &ast.ExprExit{ast.Node{}, false, nil}; yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '(' ')' { - $$ = expr.NewExit(nil); + $$ = &ast.ExprExit{ast.Node{}, false, nil}; // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Exit, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Exit, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | parenthesis_expr { - $$ = expr.NewExit($1); + $$ = &ast.ExprExit{ast.Node{}, false, $1}; // save position - if yylex.(*Parser).currentToken.Value == ")" { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yylex.(*Parser).currentToken)) + if bytes.Compare(yylex.(*Parser).currentToken.Value, []byte(")")) == 0 { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition(yylex.(*Parser).currentToken) } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Exit, (*$1.GetFreeFloating())[freefloating.OpenParenthesisToken]); delete((*$1.GetFreeFloating()), freefloating.OpenParenthesisToken) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$1.GetFreeFloating())[freefloating.CloseParenthesisToken]); delete((*$1.GetFreeFloating()), freefloating.CloseParenthesisToken) + yylex.(*Parser).setFreeFloating($$, token.Exit, $1.GetNode().Tokens[token.OpenParenthesisToken]); delete($1.GetNode().Tokens, token.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating($$, token.Expr, $1.GetNode().Tokens[token.CloseParenthesisToken]); delete($1.GetNode().Tokens, token.CloseParenthesisToken) } ; backticks_expr: /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ENCAPSED_AND_WHITESPACE { - part := scalar.NewEncapsedStringPart($1.Value) - $$ = []node.Node{part} + part := &ast.ScalarEncapsedStringPart{ast.Node{}, $1.Value} + $$ = []ast.Vertex{part} // save position - part.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + part.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | encaps_list { - $$ = $1; + $$ = $1; yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5033,13 +5009,13 @@ backticks_expr: ctor_arguments: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_call_parameter_list { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5048,147 +5024,147 @@ ctor_arguments: common_scalar: T_LNUMBER { - $$ = scalar.NewLnumber($1.Value) + $$ = &ast.ScalarLnumber{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DNUMBER { - $$ = scalar.NewDnumber($1.Value) + $$ = &ast.ScalarDnumber{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CONSTANT_ENCAPSED_STRING { - $$ = scalar.NewString($1.Value) + $$ = &ast.ScalarString{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_LINE { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_FILE { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DIR { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_TRAIT_C { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_METHOD_C { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_FUNC_C { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_C { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { - encapsed := scalar.NewEncapsedStringPart($2.Value) - $$ = scalar.NewHeredoc($1.Value, []node.Node{encapsed}) + encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, $2.Value} + $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, []ast.Vertex{encapsed}} // save position - encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_START_HEREDOC T_END_HEREDOC { - $$ = scalar.NewHeredoc($1.Value, nil) + $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5197,17 +5173,17 @@ common_scalar: static_class_constant: class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { - target := node.NewIdentifier($3.Value) - $$ = expr.NewClassConstFetch($1, target) - + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} + // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5216,7 +5192,7 @@ static_class_constant: static_scalar: static_scalar_value { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5225,24 +5201,24 @@ static_scalar: static_scalar_value: common_scalar { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_class_name_scalar { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name { - name := name.NewName($1) - $$ = expr.NewConstFetch(name) + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.ExprConstFetch{ast.Node{}, name} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(name) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -5251,81 +5227,81 @@ static_scalar_value: } | T_NAMESPACE T_NS_SEPARATOR namespace_name { - name := name.NewRelative($3) - $$ = expr.NewConstFetch(name) - + name := &ast.NameRelative{ast.Node{}, $3} + $$ = &ast.ExprConstFetch{ast.Node{}, name} + // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Namespace, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name { - name := name.NewFullyQualified($2) - $$ = expr.NewConstFetch(name) + name := &ast.NameFullyQualified{ast.Node{}, $2} + $$ = &ast.ExprConstFetch{ast.Node{}, name} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ARRAY '(' static_array_pair_list ')' { - $$ = expr.NewArray($3) + $$ = &ast.ExprArray{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Array, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Array, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '[' static_array_pair_list ']' { - $$ = expr.NewShortArray($2) + $$ = &ast.ExprShortArray{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_class_constant { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CLASS_C { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_operation { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5334,417 +5310,417 @@ static_scalar_value: static_operation: static_scalar_value '[' static_scalar_value ']' { - $$ = expr.NewArrayDimFetch($1, $3) + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '+' static_scalar_value { - $$ = binary.NewPlus($1, $3) + $$ = &ast.ExprBinaryPlus{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '-' static_scalar_value { - $$ = binary.NewMinus($1, $3) + $$ = &ast.ExprBinaryMinus{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '*' static_scalar_value { - $$ = binary.NewMul($1, $3) + $$ = &ast.ExprBinaryMul{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_POW static_scalar_value { - $$ = binary.NewPow($1, $3) + $$ = &ast.ExprBinaryPow{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '/' static_scalar_value { - $$ = binary.NewDiv($1, $3) + $$ = &ast.ExprBinaryDiv{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '%' static_scalar_value { - $$ = binary.NewMod($1, $3) + $$ = &ast.ExprBinaryMod{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '!' static_scalar_value { - $$ = expr.NewBooleanNot($2) + $$ = &ast.ExprBooleanNot{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '~' static_scalar_value { - $$ = expr.NewBitwiseNot($2) - + $$ = &ast.ExprBitwiseNot{ast.Node{}, $2} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '|' static_scalar_value { - $$ = binary.NewBitwiseOr($1, $3) + $$ = &ast.ExprBinaryBitwiseOr{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '&' static_scalar_value { - $$ = binary.NewBitwiseAnd($1, $3) + $$ = &ast.ExprBinaryBitwiseAnd{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '^' static_scalar_value { - $$ = binary.NewBitwiseXor($1, $3) + $$ = &ast.ExprBinaryBitwiseXor{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_SL static_scalar_value { - $$ = binary.NewShiftLeft($1, $3) + $$ = &ast.ExprBinaryShiftLeft{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_SR static_scalar_value { - $$ = binary.NewShiftRight($1, $3) + $$ = &ast.ExprBinaryShiftRight{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '.' static_scalar_value { - $$ = binary.NewConcat($1, $3) + $$ = &ast.ExprBinaryConcat{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_LOGICAL_XOR static_scalar_value { - $$ = binary.NewLogicalXor($1, $3) + $$ = &ast.ExprBinaryLogicalXor{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_LOGICAL_AND static_scalar_value { - $$ = binary.NewLogicalAnd($1, $3) + $$ = &ast.ExprBinaryLogicalAnd{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_LOGICAL_OR static_scalar_value { - $$ = binary.NewLogicalOr($1, $3) + $$ = &ast.ExprBinaryLogicalOr{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_BOOLEAN_AND static_scalar_value { - $$ = binary.NewBooleanAnd($1, $3) + $$ = &ast.ExprBinaryBooleanAnd{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_BOOLEAN_OR static_scalar_value { - $$ = binary.NewBooleanOr($1, $3) + $$ = &ast.ExprBinaryBooleanOr{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_IS_IDENTICAL static_scalar_value { - $$ = binary.NewIdentical($1, $3) + $$ = &ast.ExprBinaryIdentical{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_IS_NOT_IDENTICAL static_scalar_value { - $$ = binary.NewNotIdentical($1, $3) + $$ = &ast.ExprBinaryNotIdentical{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_IS_EQUAL static_scalar_value { - $$ = binary.NewEqual($1, $3) + $$ = &ast.ExprBinaryEqual{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_IS_NOT_EQUAL static_scalar_value { - $$ = binary.NewNotEqual($1, $3) + $$ = &ast.ExprBinaryNotEqual{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '<' static_scalar_value { - $$ = binary.NewSmaller($1, $3) + $$ = &ast.ExprBinarySmaller{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '>' static_scalar_value { - $$ = binary.NewGreater($1, $3) + $$ = &ast.ExprBinaryGreater{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_IS_SMALLER_OR_EQUAL static_scalar_value { - $$ = binary.NewSmallerOrEqual($1, $3) + $$ = &ast.ExprBinarySmallerOrEqual{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_IS_GREATER_OR_EQUAL static_scalar_value { - $$ = binary.NewGreaterOrEqual($1, $3) + $$ = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '?' ':' static_scalar_value { - $$ = expr.NewTernary($1, nil, $4) + $$ = &ast.ExprTernary{ast.Node{}, $1, nil, $4} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.True, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '?' static_scalar_value ':' static_scalar_value { - $$ = expr.NewTernary($1, $3, $5) + $$ = &ast.ExprTernary{ast.Node{}, $1, $3, $5} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.True, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '+' static_scalar_value { - $$ = expr.NewUnaryPlus($2) - + $$ = &ast.ExprUnaryPlus{ast.Node{}, $2} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '-' static_scalar_value { - $$ = expr.NewUnaryMinus($2) - + $$ = &ast.ExprUnaryMinus{ast.Node{}, $2} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5753,8 +5729,8 @@ static_operation: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5763,18 +5739,18 @@ static_operation: general_constant: class_constant { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name { - name := name.NewName($1) - $$ = expr.NewConstFetch(name) + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.ExprConstFetch{ast.Node{}, name} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(name) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -5783,30 +5759,30 @@ general_constant: } | T_NAMESPACE T_NS_SEPARATOR namespace_name { - name := name.NewRelative($3) - $$ = expr.NewConstFetch(name) - + name := &ast.NameRelative{ast.Node{}, $3} + $$ = &ast.ExprConstFetch{ast.Node{}, name} + // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) - + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(name) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(name, freefloating.Namespace, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Namespace, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name { - name := name.NewFullyQualified($2) - $$ = expr.NewConstFetch(name) - + name := &ast.NameFullyQualified{ast.Node{}, $2} + $$ = &ast.ExprConstFetch{ast.Node{}, name} + // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(name) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5815,69 +5791,69 @@ general_constant: scalar: T_STRING_VARNAME { - name := node.NewIdentifier($1.Value) - $$ = expr.NewVariable(name) - + name := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.ExprVariable{ast.Node{}, name} + // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | general_constant { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_name_scalar { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | common_scalar { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '"' encaps_list '"' { - $$ = scalar.NewEncapsed($2) + $$ = &ast.ScalarEncapsed{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_START_HEREDOC encaps_list T_END_HEREDOC { - $$ = scalar.NewHeredoc($1.Value, $2) + $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CLASS_C { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5886,7 +5862,7 @@ scalar: static_array_pair_list: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5896,7 +5872,7 @@ static_array_pair_list: // save comments if $2 != nil { - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5917,54 +5893,54 @@ 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 := &ast.ExprArrayItem{ast.Node{}, false, $3, $5} $$ = append($1, arrayItem) - + // save position - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) - + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5) + // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_static_array_pair_list ',' static_scalar_value { - arrayItem := expr.NewArrayItem(nil, $3, false) + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, $3} $$ = append($1, arrayItem) - + // save position - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) - + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) + // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_DOUBLE_ARROW static_scalar_value { - arrayItem := expr.NewArrayItem($1, $3, false) - $$ = []node.Node{arrayItem} + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, $1, $3} + $$ = []ast.Vertex{arrayItem} // save position - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value { - arrayItem := expr.NewArrayItem(nil, $1, false) - $$ = []node.Node{arrayItem} - + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, $1} + $$ = []ast.Vertex{arrayItem} + // save position - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) @@ -5976,13 +5952,13 @@ non_empty_static_array_pair_list: expr: r_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr_without_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5994,14 +5970,14 @@ parenthesis_expr: $$ = $2 // save comments - if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($2, freefloating.Start, append((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken], (*$2.GetFreeFloating())[freefloating.Start]...)) + if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($2, token.Start, append($2.GetNode().Tokens[token.OpenParenthesisToken], $2.GetNode().Tokens[token.Start]...)) } - if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($2, freefloating.End, append((*$2.GetFreeFloating())[freefloating.End], (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]...)) + if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($2, token.End, append($2.GetNode().Tokens[token.End], $2.GetNode().Tokens[token.CloseParenthesisToken]...)) } - yylex.(*Parser).setFreeFloating($2, freefloating.OpenParenthesisToken, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating($2, freefloating.CloseParenthesisToken, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($2, token.OpenParenthesisToken, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating($2, token.CloseParenthesisToken, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6010,14 +5986,14 @@ parenthesis_expr: $$ = $2 // save comments - if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($2, freefloating.Start, append((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken], (*$2.GetFreeFloating())[freefloating.Start]...)) + if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($2, token.Start, append($2.GetNode().Tokens[token.OpenParenthesisToken], $2.GetNode().Tokens[token.Start]...)) } - if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($2, freefloating.End, append((*$2.GetFreeFloating())[freefloating.End], (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]...)) + if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($2, token.End, append($2.GetNode().Tokens[token.End], $2.GetNode().Tokens[token.CloseParenthesisToken]...)) } - yylex.(*Parser).setFreeFloating($2, freefloating.OpenParenthesisToken, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating($2, freefloating.CloseParenthesisToken, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($2, token.OpenParenthesisToken, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating($2, token.CloseParenthesisToken, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6027,7 +6003,7 @@ parenthesis_expr: r_variable: variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6037,7 +6013,7 @@ r_variable: w_variable: variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6046,7 +6022,7 @@ w_variable: rw_variable: variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6058,54 +6034,54 @@ variable: $$ = $1 if $4 != nil { - $4[0].(*expr.MethodCall).Method = $3[len($3)-1].(*expr.PropertyFetch).Property + $4[0].(*ast.ExprMethodCall).Method = $3[len($3)-1].(*ast.ExprPropertyFetch).Property $3 = append($3[:len($3)-1], $4...) } // save comments - yylex.(*Parser).setFreeFloating($3[0], freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($3[0], token.Var, $2.Tokens) for _, n := range($3) { switch nn := n.(type) { - case *expr.ArrayDimFetch: - nn.Variable = $$ - nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + case *ast.ExprArrayDimFetch: + nn.Var = $$ + nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) - - case *expr.PropertyFetch: - nn.Variable = $$ - nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) + + case *ast.ExprPropertyFetch: + nn.Var = $$ + nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) - - case *expr.MethodCall: - nn.Variable = $$ - nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) + + case *ast.ExprMethodCall: + nn.Var = $$ + nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } } for _, n := range($5) { switch nn := n.(type) { - case *expr.ArrayDimFetch: - nn.Variable = $$ - nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + case *ast.ExprArrayDimFetch: + nn.Var = $$ + nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) - - case *expr.PropertyFetch: - nn.Variable = $$ - nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) + + case *ast.ExprPropertyFetch: + nn.Var = $$ + nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) - - case *expr.MethodCall: - nn.Variable = $$ - nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) + + case *ast.ExprMethodCall: + nn.Var = $$ + nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } } @@ -6113,7 +6089,7 @@ variable: } | base_variable_with_function_calls { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6122,13 +6098,13 @@ variable: variable_properties: variable_properties variable_property { - $$ = append($1, $2...) + $$ = append($1, $2...) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6139,14 +6115,14 @@ variable_property: T_OBJECT_OPERATOR object_property method_or_not { if $3 != nil { - $3[0].(*expr.MethodCall).Method = $2[len($2)-1].(*expr.PropertyFetch).Property + $3[0].(*ast.ExprMethodCall).Method = $2[len($2)-1].(*ast.ExprPropertyFetch).Property $2 = append($2[:len($2)-1], $3...) } $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($2[0], freefloating.Var, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($2[0], token.Var, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6155,29 +6131,29 @@ variable_property: array_method_dereference: array_method_dereference '[' dim_offset ']' { - fetch := expr.NewArrayDimFetch(nil, $3) + fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, $3} $$ = append($1, fetch) // save position - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | method '[' dim_offset ']' { - fetch := expr.NewArrayDimFetch(nil, $3) - $$ = []node.Node{$1, fetch} + fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, $3} + $$ = []ast.Vertex{$1, fetch} // save position - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6186,10 +6162,10 @@ array_method_dereference: method: function_call_parameter_list { - $$ = expr.NewMethodCall(nil, nil, $1.(*node.ArgumentList)) + $$ = &ast.ExprMethodCall{ast.Node{}, nil, nil, $1.(*ast.ArgumentList)} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6198,19 +6174,19 @@ method: method_or_not: method { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | array_method_dereference { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6219,16 +6195,16 @@ method_or_not: variable_without_objects: reference_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | simple_indirect_reference reference_variable { - $1.last.SetVarName($2) + $1.last.VarName = $2 for _, n := range($1.all) { - n.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(n, $2)) + n.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition(n, $2) } $$ = $1.all[0] @@ -6240,27 +6216,27 @@ variable_without_objects: static_member: class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { - $$ = expr.NewStaticPropertyFetch($1, $3) + $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { - $$ = expr.NewStaticPropertyFetch($1, $3) + $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6269,7 +6245,7 @@ static_member: variable_class_name: reference_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6278,29 +6254,29 @@ variable_class_name: array_function_dereference: array_function_dereference '[' dim_offset ']' { - $$ = expr.NewArrayDimFetch($1, $3) + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_call '[' dim_offset ']' { - $$ = expr.NewArrayDimFetch($1, $3) + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6309,19 +6285,19 @@ array_function_dereference: base_variable_with_function_calls: base_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | array_function_dereference { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_call { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6331,16 +6307,16 @@ base_variable_with_function_calls: base_variable: reference_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | simple_indirect_reference reference_variable { - $1.last.SetVarName($2) + $1.last.VarName = $2 for _, n := range($1.all) { - n.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(n, $2)) + n.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition(n, $2) } $$ = $1.all[0] @@ -6349,7 +6325,7 @@ base_variable: } | static_member { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6358,35 +6334,35 @@ base_variable: reference_variable: reference_variable '[' dim_offset ']' { - $$ = expr.NewArrayDimFetch($1, $3) + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | reference_variable '{' expr '}' { - $$ = expr.NewArrayDimFetch($1, $3) + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | compound_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6396,31 +6372,30 @@ reference_variable: compound_variable: T_VARIABLE { - name := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - $$ = expr.NewVariable(name) - + name := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + $$ = &ast.ExprVariable{ast.Node{}, name} + // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken($$) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '$' '{' expr '}' { - $$ = expr.NewVariable($3) - + $$ = &ast.ExprVariable{ast.Node{}, $3} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($3, freefloating.Start, append($2.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($2), (*$3.GetFreeFloating())[freefloating.Start]...)...)) - yylex.(*Parser).setFreeFloating($3, freefloating.End, append((*$3.GetFreeFloating())[freefloating.End], append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6429,13 +6404,13 @@ compound_variable: dim_offset: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6443,19 +6418,19 @@ dim_offset: object_property: - object_dim_list + object_dim_list { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_without_objects { - fetch := expr.NewPropertyFetch(nil, $1) - $$ = []node.Node{fetch} + fetch := &ast.ExprPropertyFetch{ast.Node{}, nil, $1} + $$ = []ast.Vertex{fetch} // save position - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6464,39 +6439,39 @@ object_property: object_dim_list: object_dim_list '[' dim_offset ']' { - fetch := expr.NewArrayDimFetch(nil, $3) + fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, $3} $$ = append($1, fetch) - + // save position - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | object_dim_list '{' expr '}' { - fetch := expr.NewArrayDimFetch(nil, $3) + fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, $3} $$ = append($1, fetch) - + // save position - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_name { - fetch := expr.NewPropertyFetch(nil, $1) - $$ = []node.Node{fetch} - + fetch := &ast.ExprPropertyFetch{ast.Node{}, nil, $1} + $$ = []ast.Vertex{fetch} + // save position - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6505,26 +6480,26 @@ object_dim_list: variable_name: T_STRING { - $$ = node.NewIdentifier($1.Value) - + $$ = &ast.Identifier{ast.Node{}, $1.Value} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '{' expr '}' { $$ = $2 - + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6533,33 +6508,33 @@ variable_name: simple_indirect_reference: '$' { - n := expr.NewVariable(nil) - $$ = simpleIndirectReference{[]*expr.Variable{n}, n} - + n := &ast.ExprVariable{ast.Node{}, nil} + $$ = simpleIndirectReference{[]*ast.ExprVariable{n}, n} + // save position - n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + n.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + // save comments - yylex.(*Parser).setFreeFloating(n, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(n, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating(n, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(n, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | simple_indirect_reference '$' { - n := expr.NewVariable(nil) + n := &ast.ExprVariable{ast.Node{}, nil} - $1.last.SetVarName(n) + $1.last.VarName = n $1.all = append($1.all, n) $1.last = n $$ = $1 - + // save position - n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - + n.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + // save comments - yylex.(*Parser).setFreeFloating(n, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(n, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating(n, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(n, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6569,22 +6544,22 @@ assignment_list: assignment_list ',' assignment_list_element { if len($1) == 0 { - $1 = []node.Node{expr.NewArrayItem(nil, nil, false)} + $1 = []ast.Vertex{&ast.ExprArrayItem{ast.Node{}, false, nil, nil}} } $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | assignment_list_element { - if $1.(*expr.ArrayItem).Key == nil && $1.(*expr.ArrayItem).Val == nil { - $$ = []node.Node{} + if $1.(*ast.ExprArrayItem).Key == nil && $1.(*ast.ExprArrayItem).Val == nil { + $$ = []ast.Vertex{} } else { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6595,10 +6570,10 @@ assignment_list: assignment_list_element: variable { - $$ = expr.NewArrayItem(nil, $1, false) - + $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, $1} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -6607,23 +6582,23 @@ assignment_list_element: } | T_LIST '(' assignment_list ')' { - listNode := expr.NewList($3) - $$ = expr.NewArrayItem(nil, listNode, false) - + listNode := &ast.ExprList{ast.Node{}, $3} + $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, listNode} + // save position - listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(listNode)) + listNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(listNode) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.List, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { - $$ = expr.NewArrayItem(nil, nil, false) + $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, nil} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6633,7 +6608,7 @@ assignment_list_element: array_pair_list: /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6642,12 +6617,12 @@ array_pair_list: $$ = $1 if $2 != nil { - $$ = append($1, expr.NewArrayItem(nil, nil, false)) + $$ = append($1, &ast.ExprArrayItem{ast.Node{}, false, nil, nil}) } // save comments if $2 != nil { - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6657,54 +6632,54 @@ 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 := &ast.ExprArrayItem{ast.Node{}, false, $3, $5} $$ = append($1, arrayItem) // save position - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) - + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5) + // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_array_pair_list ',' expr { - arrayItem := expr.NewArrayItem(nil, $3, false) + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, $3} $$ = append($1, arrayItem) - + // save position - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) - + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) + // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_DOUBLE_ARROW expr { - arrayItem := expr.NewArrayItem($1, $3, false) - $$ = []node.Node{arrayItem} + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, $1, $3} + $$ = []ast.Vertex{arrayItem} // save position - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr { - arrayItem := expr.NewArrayItem(nil, $1, false) - $$ = []node.Node{arrayItem} + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, $1} + $$ = []ast.Vertex{arrayItem} // save position - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) @@ -6713,67 +6688,67 @@ non_empty_array_pair_list: } | non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_variable { - reference := expr.NewReference($6) - arrayItem := expr.NewArrayItem($3, reference, false) + reference := &ast.ExprReference{ast.Node{}, $6} + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, $3, reference} $$ = append($1, arrayItem) - + // save position - reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($5, $6)) - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $6)) - + reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($5, $6) + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($3, $6) + // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $4.FreeFloating) - yylex.(*Parser).setFreeFloating(reference, freefloating.Start, $5.FreeFloating) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating(reference, token.Start, $5.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_array_pair_list ',' '&' w_variable { - reference := expr.NewReference($4) - arrayItem := expr.NewArrayItem(nil, reference, false) + reference := &ast.ExprReference{ast.Node{}, $4} + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, reference} $$ = append($1, arrayItem) - + // save position - reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) - + reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4) + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4) + // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_DOUBLE_ARROW '&' w_variable { - reference := expr.NewReference($4) - arrayItem := expr.NewArrayItem($1, reference, false) - $$ = []node.Node{arrayItem} - + reference := &ast.ExprReference{ast.Node{}, $4} + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, $1, reference} + $$ = []ast.Vertex{arrayItem} + // save position - reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4) + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(reference, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '&' w_variable { - reference := expr.NewReference($2) - arrayItem := expr.NewArrayItem(nil, reference, false) - $$ = []node.Node{arrayItem} - + reference := &ast.ExprReference{ast.Node{}, $2} + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, reference} + $$ = []ast.Vertex{arrayItem} + // save position - reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6782,39 +6757,39 @@ non_empty_array_pair_list: encaps_list: encaps_list encaps_var { - $$ = append($1, $2) + $$ = append($1, $2) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | encaps_list T_ENCAPSED_AND_WHITESPACE { - encapsed := scalar.NewEncapsedStringPart($2.Value) + encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, $2.Value} $$ = append($1, encapsed) // save position - encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) // save comments - yylex.(*Parser).setFreeFloating(encapsed, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | encaps_var { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ENCAPSED_AND_WHITESPACE encaps_var { - encapsed := scalar.NewEncapsedStringPart($1.Value) - $$ = []node.Node{encapsed, $2} + encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, $1.Value} + $$ = []ast.Vertex{encapsed, $2} // save position - encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(encapsed, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6823,105 +6798,102 @@ encaps_list: encaps_var: T_VARIABLE { - name := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - $$ = expr.NewVariable(name) + name := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + $$ = &ast.ExprVariable{ast.Node{}, name} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken($$) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE '[' encaps_var_offset ']' { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = expr.NewArrayDimFetch(variable, $3) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.ExprArrayDimFetch{ast.Node{}, variable, $3} // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE T_OBJECT_OPERATOR T_STRING { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - fetch := node.NewIdentifier($3.Value) - $$ = expr.NewPropertyFetch(variable, fetch) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + fetch := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.ExprPropertyFetch{ast.Node{}, variable, fetch} // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(fetch, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { - variable := expr.NewVariable($2) + variable := &ast.ExprVariable{ast.Node{}, $2} $$ = variable // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.End, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { - name := node.NewIdentifier($2.Value) - variable := expr.NewVariable(name) + name := &ast.Identifier{ast.Node{}, $2.Value} + variable := &ast.ExprVariable{ast.Node{}, name} $$ = variable // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.End, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { - identifier := node.NewIdentifier($2.Value) - variable := expr.NewVariable(identifier) - $$ = expr.NewArrayDimFetch(variable, $4) + identifier := &ast.Identifier{ast.Node{}, $2.Value} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.ExprArrayDimFetch{ast.Node{}, variable, $4} // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($5.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($5)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append($6.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($6)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($5.Tokens, yylex.(*Parser).GetFreeFloatingToken($5)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($6.Tokens, yylex.(*Parser).GetFreeFloatingToken($6)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6930,8 +6902,8 @@ encaps_var: $$ = $2; // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.End, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6940,45 +6912,44 @@ encaps_var: encaps_var_offset: T_STRING { - $$ = scalar.NewString($1.Value) + $$ = &ast.ScalarString{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NUM_STRING { // TODO: add option to handle 64 bit integer - if _, err := strconv.Atoi($1.Value); err == nil { - $$ = scalar.NewLnumber($1.Value) + if _, err := strconv.Atoi(string($1.Value)); err == nil { + $$ = &ast.ScalarLnumber{ast.Node{}, $1.Value} } else { - $$ = scalar.NewString($1.Value) + $$ = &ast.ScalarString{ast.Node{}, $1.Value} } // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - $$ = expr.NewVariable(identifier) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + $$ = &ast.ExprVariable{ast.Node{}, identifier} // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken($$) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6987,105 +6958,105 @@ encaps_var_offset: internal_functions_in_yacc: T_ISSET '(' isset_variables ')' { - $$ = expr.NewIsset($3) - + $$ = &ast.ExprIsset{ast.Node{}, $3} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Isset, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Isset, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EMPTY '(' variable ')' { - $$ = expr.NewEmpty($3) + $$ = &ast.ExprEmpty{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Empty, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EMPTY '(' expr ')' { - $$ = expr.NewEmpty($3) + $$ = &ast.ExprEmpty{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Empty, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_INCLUDE expr { - $$ = expr.NewInclude($2) + $$ = &ast.ExprInclude{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_INCLUDE_ONCE expr { - $$ = expr.NewIncludeOnce($2) + $$ = &ast.ExprIncludeOnce{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EVAL '(' expr ')' { - $$ = expr.NewEval($3) + $$ = &ast.ExprEval{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Eval, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Eval, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_REQUIRE expr { - $$ = expr.NewRequire($2) + $$ = &ast.ExprRequire{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_REQUIRE_ONCE expr { - $$ = expr.NewRequireOnce($2) + $$ = &ast.ExprRequireOnce{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7094,7 +7065,7 @@ internal_functions_in_yacc: isset_variables: isset_variable { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7103,7 +7074,7 @@ isset_variables: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7112,13 +7083,13 @@ isset_variables: isset_variable: variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr_without_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7127,33 +7098,33 @@ isset_variable: class_constant: class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { - target := node.NewIdentifier($3.Value) - $$ = expr.NewClassConstFetch($1, target) + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { - target := node.NewIdentifier($3.Value) - $$ = expr.NewClassConstFetch($1, target) + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7162,17 +7133,17 @@ class_constant: static_class_name_scalar: class_name T_PAAMAYIM_NEKUDOTAYIM T_CLASS { - target := node.NewIdentifier($3.Value) - $$ = expr.NewClassConstFetch($1, target) + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7181,17 +7152,17 @@ static_class_name_scalar: class_name_scalar: class_name T_PAAMAYIM_NEKUDOTAYIM T_CLASS { - target := node.NewIdentifier($3.Value) - $$ = expr.NewClassConstFetch($1, target) + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7200,6 +7171,6 @@ class_name_scalar: %% type simpleIndirectReference struct { - all []*expr.Variable - last *expr.Variable + all []*ast.ExprVariable + last *ast.ExprVariable } diff --git a/internal/php5/php5_bench_test.go b/internal/php5/php5_bench_test.go index 1cdd5aa..2c7d11c 100644 --- a/internal/php5/php5_bench_test.go +++ b/internal/php5/php5_bench_test.go @@ -3,7 +3,7 @@ package php5_test import ( "testing" - "github.com/z7zmey/php-parser/php5" + "github.com/z7zmey/php-parser/internal/php5" ) func BenchmarkPhp5(b *testing.B) { diff --git a/internal/php5/php5_test.go b/internal/php5/php5_test.go index 3cbb727..295e0b0 100644 --- a/internal/php5/php5_test.go +++ b/internal/php5/php5_test.go @@ -1,21 +1,13 @@ package php5_test import ( + "gotest.tools/assert" "testing" - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/errors" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/node/expr/assign" - "github.com/z7zmey/php-parser/node/expr/binary" - "github.com/z7zmey/php-parser/node/expr/cast" - "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/php5" - "github.com/z7zmey/php-parser/position" + "github.com/z7zmey/php-parser/internal/php5" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/errors" + "github.com/z7zmey/php-parser/pkg/position" ) func TestPhp5(t *testing.T) { @@ -402,106 +394,130 @@ func TestPhp5(t *testing.T) { parsing process must be terminated ` - expected := &node.Root{ - Position: &position.Position{ - StartLine: 2, - EndLine: 379, - StartPos: 5, - EndPos: 6944, + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 379, + StartPos: 5, + EndPos: 6944, + }, }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 5, - EndPos: 20, - }, - Expr: &expr.FunctionCall{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 2, StartPos: 5, - EndPos: 19, + EndPos: 20, }, - Function: &name.Name{ + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 2, StartPos: 5, - EndPos: 8, + EndPos: 19, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 5, - EndPos: 8, + }, + Function: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 8, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 8, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 8, - EndPos: 19, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 8, + EndPos: 19, + }, }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 11, - }, - IsReference: false, - Variadic: false, - Expr: &expr.Variable{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 2, StartPos: 9, EndPos: 11, }, - VarName: &node.Identifier{ + }, + IsReference: false, + Variadic: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 2, StartPos: 9, EndPos: 11, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 9, + EndPos: 11, + }, + }, + Value: []byte("a"), }, }, }, - &node.Argument{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 13, - EndPos: 18, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 16, + StartPos: 13, EndPos: 18, }, - VarName: &node.Identifier{ + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 2, StartPos: 16, EndPos: 18, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 16, + EndPos: 18, + }, + }, + Value: []byte("b"), }, }, }, @@ -509,96 +525,118 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 23, - EndPos: 39, - }, - Expr: &expr.FunctionCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, StartPos: 23, - EndPos: 38, + EndPos: 39, }, - Function: &expr.Variable{ + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, StartPos: 23, - EndPos: 27, + EndPos: 38, }, - VarName: &node.Identifier{ + }, + Function: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, StartPos: 23, EndPos: 27, }, - Value: "foo", }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 27, - EndPos: 38, - }, - Arguments: []node.Node{ - &node.Argument{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 28, - EndPos: 30, + StartPos: 23, + EndPos: 27, }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ + }, + Value: []byte("foo"), + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 27, + EndPos: 38, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, StartPos: 28, EndPos: 30, }, - VarName: &node.Identifier{ + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, StartPos: 28, EndPos: 30, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 28, + EndPos: 30, + }, + }, + Value: []byte("a"), }, }, }, - &node.Argument{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 32, - EndPos: 37, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 35, + StartPos: 32, EndPos: 37, }, - VarName: &node.Identifier{ + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, StartPos: 35, EndPos: 37, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 35, + EndPos: 37, + }, + }, + Value: []byte("b"), }, }, }, @@ -606,105 +644,129 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 42, - EndPos: 63, - }, - Expr: &expr.MethodCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, StartPos: 42, - EndPos: 62, + EndPos: 63, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprMethodCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, StartPos: 42, - EndPos: 46, + EndPos: 62, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, StartPos: 42, EndPos: 46, }, - Value: "foo", }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 48, - EndPos: 51, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 51, - EndPos: 62, - }, - Arguments: []node.Node{ - &node.Argument{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 52, - EndPos: 54, + StartPos: 42, + EndPos: 46, }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ + }, + Value: []byte("foo"), + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 48, + EndPos: 51, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 51, + EndPos: 62, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, StartPos: 52, EndPos: 54, }, - VarName: &node.Identifier{ + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, StartPos: 52, EndPos: 54, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 52, + EndPos: 54, + }, + }, + Value: []byte("a"), }, }, }, - &node.Argument{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 56, - EndPos: 61, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 59, + StartPos: 56, EndPos: 61, }, - VarName: &node.Identifier{ + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, StartPos: 59, EndPos: 61, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 59, + EndPos: 61, + }, + }, + Value: []byte("b"), }, }, }, @@ -712,107 +774,131 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 66, - EndPos: 86, - }, - Expr: &expr.StaticCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 5, EndLine: 5, StartPos: 66, - EndPos: 85, + EndPos: 86, }, - Class: &name.Name{ + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 5, EndLine: 5, StartPos: 66, - EndPos: 69, + EndPos: 85, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 66, - EndPos: 69, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 66, + EndPos: 69, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 66, + EndPos: 69, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 71, - EndPos: 74, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 71, + EndPos: 74, + }, }, - Value: "bar", + Value: []byte("bar"), }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 74, - EndPos: 85, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 74, + EndPos: 85, + }, }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 75, - EndPos: 77, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 5, EndLine: 5, StartPos: 75, EndPos: 77, }, - VarName: &node.Identifier{ + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 5, EndLine: 5, StartPos: 75, EndPos: 77, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 75, + EndPos: 77, + }, + }, + Value: []byte("a"), }, }, }, - &node.Argument{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 79, - EndPos: 84, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 82, + StartPos: 79, EndPos: 84, }, - VarName: &node.Identifier{ + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 5, EndLine: 5, StartPos: 82, EndPos: 84, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 82, + EndPos: 84, + }, + }, + Value: []byte("b"), }, }, }, @@ -820,105 +906,129 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 89, - EndPos: 110, - }, - Expr: &expr.StaticCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, StartPos: 89, - EndPos: 109, + EndPos: 110, }, - Class: &expr.Variable{ + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, StartPos: 89, - EndPos: 93, + EndPos: 109, }, - VarName: &node.Identifier{ + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, StartPos: 89, EndPos: 93, }, - Value: "foo", }, - }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 95, - EndPos: 98, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 98, - EndPos: 109, - }, - Arguments: []node.Node{ - &node.Argument{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 99, - EndPos: 101, + StartPos: 89, + EndPos: 93, }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ + }, + Value: []byte("foo"), + }, + }, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 95, + EndPos: 98, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 98, + EndPos: 109, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, StartPos: 99, EndPos: 101, }, - VarName: &node.Identifier{ + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, StartPos: 99, EndPos: 101, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 99, + EndPos: 101, + }, + }, + Value: []byte("a"), }, }, }, - &node.Argument{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 103, - EndPos: 108, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 106, + StartPos: 103, EndPos: 108, }, - VarName: &node.Identifier{ + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, StartPos: 106, EndPos: 108, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 106, + EndPos: 108, + }, + }, + Value: []byte("b"), }, }, }, @@ -926,98 +1036,120 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 113, - EndPos: 132, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 7, EndLine: 7, StartPos: 113, - EndPos: 131, + EndPos: 132, }, - Class: &name.Name{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 117, - EndPos: 120, + StartPos: 113, + EndPos: 131, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 117, - EndPos: 120, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 117, + EndPos: 120, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 117, + EndPos: 120, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 120, - EndPos: 131, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 120, + EndPos: 131, + }, }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 121, - EndPos: 123, - }, - IsReference: false, - Variadic: false, - Expr: &expr.Variable{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 7, EndLine: 7, StartPos: 121, EndPos: 123, }, - VarName: &node.Identifier{ + }, + IsReference: false, + Variadic: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 7, EndLine: 7, StartPos: 121, EndPos: 123, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 123, + }, + }, + Value: []byte("a"), }, }, }, - &node.Argument{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 125, - EndPos: 130, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 128, + StartPos: 125, EndPos: 130, }, - VarName: &node.Identifier{ + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 7, EndLine: 7, StartPos: 128, EndPos: 130, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 128, + EndPos: 130, + }, + }, + Value: []byte("b"), }, }, }, @@ -1025,4643 +1157,5639 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 136, - EndPos: 180, - }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ + &ast.StmtFunction{ + Node: ast.Node{ Position: &position.Position{ StartLine: 9, EndLine: 9, - StartPos: 145, - EndPos: 148, + StartPos: 136, + EndPos: 180, }, - Value: "foo", }, - Params: []node.Node{ - &node.Parameter{ + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 9, EndLine: 9, - StartPos: 149, - EndPos: 162, + StartPos: 145, + EndPos: 148, }, - ByRef: false, - Variadic: false, - VariableType: &name.Name{ + }, + Value: []byte("foo"), + }, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 9, EndLine: 9, StartPos: 149, - EndPos: 152, + EndPos: 162, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 149, - EndPos: 152, + }, + ByRef: false, + Variadic: false, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 149, + EndPos: 152, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 149, + EndPos: 152, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 153, - EndPos: 157, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 9, EndLine: 9, StartPos: 153, EndPos: 157, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 153, + EndPos: 157, + }, + }, + Value: []byte("bar"), }, }, - DefaultValue: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 158, - EndPos: 162, - }, - Constant: &name.Name{ + DefaultValue: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 9, EndLine: 9, StartPos: 158, EndPos: 162, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 158, - EndPos: 162, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 158, + EndPos: 162, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 158, + EndPos: 162, + }, }, - Value: "null", + Value: []byte("null"), }, }, }, }, }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 164, - EndPos: 176, - }, - ByRef: true, - Variadic: true, - VariableType: &name.Name{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 9, EndLine: 9, StartPos: 164, - EndPos: 167, + EndPos: 176, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 164, - EndPos: 167, + }, + ByRef: true, + Variadic: true, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 164, + EndPos: 167, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 164, + EndPos: 167, + }, }, - Value: "baz", + Value: []byte("baz"), }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 172, - EndPos: 176, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 9, EndLine: 9, StartPos: 172, EndPos: 176, }, - Value: "baz", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 172, + EndPos: 176, + }, + }, + Value: []byte("baz"), }, }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 183, - EndPos: 246, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, - StartPos: 189, - EndPos: 192, + StartPos: 183, + EndPos: 246, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.ClassMethod{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, - StartPos: 194, - EndPos: 245, + StartPos: 189, + EndPos: 192, }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, - StartPos: 210, - EndPos: 213, + StartPos: 194, + EndPos: 245, }, - Value: "foo", }, - Modifiers: []node.Node{ - &node.Identifier{ + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, - StartPos: 194, - EndPos: 200, + StartPos: 210, + EndPos: 213, }, - Value: "public", + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 194, + EndPos: 200, + }, + }, + Value: []byte("public"), }, }, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 214, - EndPos: 227, - }, - ByRef: false, - Variadic: false, - VariableType: &name.Name{ + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, StartPos: 214, - EndPos: 217, + EndPos: 227, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 214, - EndPos: 217, + }, + ByRef: false, + Variadic: false, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 214, + EndPos: 217, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 214, + EndPos: 217, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 218, - EndPos: 222, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, StartPos: 218, EndPos: 222, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 218, + EndPos: 222, + }, + }, + Value: []byte("bar"), }, }, - DefaultValue: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 223, - EndPos: 227, - }, - Constant: &name.Name{ + DefaultValue: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, StartPos: 223, EndPos: 227, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 223, - EndPos: 227, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 223, + EndPos: 227, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 223, + EndPos: 227, + }, }, - Value: "null", + Value: []byte("null"), }, }, }, }, }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 229, - EndPos: 241, - }, - ByRef: true, - Variadic: true, - VariableType: &name.Name{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, StartPos: 229, - EndPos: 232, + EndPos: 241, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 229, - EndPos: 232, + }, + ByRef: true, + Variadic: true, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 229, + EndPos: 232, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 229, + EndPos: 232, + }, }, - Value: "baz", + Value: []byte("baz"), }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 237, - EndPos: 241, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, StartPos: 237, EndPos: 241, }, - Value: "baz", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 237, + EndPos: 241, + }, + }, + Value: []byte("baz"), }, }, }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 243, - EndPos: 245, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 243, + EndPos: 245, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 249, - EndPos: 290, - }, - Expr: &expr.Closure{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 11, EndLine: 11, StartPos: 249, - EndPos: 289, + EndPos: 290, }, - ReturnsRef: false, - Static: false, - PhpDocComment: "", - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 258, - EndPos: 271, - }, - ByRef: false, - Variadic: false, - VariableType: &name.Name{ + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 249, + EndPos: 289, + }, + }, + ReturnsRef: false, + Static: false, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 11, EndLine: 11, StartPos: 258, - EndPos: 261, + EndPos: 271, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 258, - EndPos: 261, + }, + ByRef: false, + Variadic: false, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 258, + EndPos: 261, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 258, + EndPos: 261, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 262, - EndPos: 266, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 11, EndLine: 11, StartPos: 262, EndPos: 266, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 262, + EndPos: 266, + }, + }, + Value: []byte("bar"), }, }, - DefaultValue: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 267, - EndPos: 271, - }, - Constant: &name.Name{ + DefaultValue: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 11, EndLine: 11, StartPos: 267, EndPos: 271, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 267, - EndPos: 271, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 267, + EndPos: 271, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 267, + EndPos: 271, + }, }, - Value: "null", + Value: []byte("null"), }, }, }, }, }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 273, - EndPos: 285, - }, - ByRef: true, - Variadic: true, - VariableType: &name.Name{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 11, EndLine: 11, StartPos: 273, - EndPos: 276, + EndPos: 285, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 273, - EndPos: 276, + }, + ByRef: true, + Variadic: true, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 273, + EndPos: 276, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 273, + EndPos: 276, + }, }, - Value: "baz", + Value: []byte("baz"), }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 281, - EndPos: 285, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 11, EndLine: 11, StartPos: 281, EndPos: 285, }, - Value: "baz", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 281, + EndPos: 285, + }, + }, + Value: []byte("baz"), }, }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 293, - EndPos: 341, - }, - Expr: &expr.Closure{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 12, EndLine: 12, StartPos: 293, - EndPos: 340, + EndPos: 341, }, - ReturnsRef: false, - Static: true, - PhpDocComment: "", - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 309, - EndPos: 322, - }, - ByRef: false, - Variadic: false, - VariableType: &name.Name{ + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 293, + EndPos: 340, + }, + }, + ReturnsRef: false, + Static: true, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 12, EndLine: 12, StartPos: 309, - EndPos: 312, + EndPos: 322, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 309, - EndPos: 312, + }, + ByRef: false, + Variadic: false, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 309, + EndPos: 312, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 309, + EndPos: 312, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 313, - EndPos: 317, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 12, EndLine: 12, StartPos: 313, EndPos: 317, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 313, + EndPos: 317, + }, + }, + Value: []byte("bar"), }, }, - DefaultValue: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 318, - EndPos: 322, - }, - Constant: &name.Name{ + DefaultValue: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 12, EndLine: 12, StartPos: 318, EndPos: 322, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 318, - EndPos: 322, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 318, + EndPos: 322, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 318, + EndPos: 322, + }, }, - Value: "null", + Value: []byte("null"), }, }, }, }, }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 324, - EndPos: 336, - }, - ByRef: true, - Variadic: true, - VariableType: &name.Name{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 12, EndLine: 12, StartPos: 324, - EndPos: 327, + EndPos: 336, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 324, - EndPos: 327, + }, + ByRef: true, + Variadic: true, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 324, + EndPos: 327, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 324, + EndPos: 327, + }, }, - Value: "baz", + Value: []byte("baz"), }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 332, - EndPos: 336, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 12, EndLine: 12, StartPos: 332, EndPos: 336, }, - Value: "baz", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 332, + EndPos: 336, + }, + }, + Value: []byte("baz"), }, }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 345, - EndPos: 365, - }, - Expr: &scalar.Lnumber{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 14, EndLine: 14, StartPos: 345, - EndPos: 364, + EndPos: 365, }, - Value: "1234567890123456789", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 345, + EndPos: 364, + }, + }, + Value: []byte("1234567890123456789"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 368, - EndPos: 389, - }, - Expr: &scalar.Dnumber{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 15, EndLine: 15, StartPos: 368, - EndPos: 388, + EndPos: 389, }, - Value: "12345678901234567890", + }, + Expr: &ast.ScalarDnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 368, + EndPos: 388, + }, + }, + Value: []byte("12345678901234567890"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 392, - EndPos: 395, - }, - Expr: &scalar.Dnumber{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 16, EndLine: 16, StartPos: 392, - EndPos: 394, + EndPos: 395, }, - Value: "0.", + }, + Expr: &ast.ScalarDnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 392, + EndPos: 394, + }, + }, + Value: []byte("0."), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 17, - EndLine: 17, - StartPos: 398, - EndPos: 465, - }, - Expr: &scalar.Lnumber{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 17, EndLine: 17, StartPos: 398, - EndPos: 464, + EndPos: 465, }, - Value: "0b0111111111111111111111111111111111111111111111111111111111111111", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 398, + EndPos: 464, + }, + }, + Value: []byte("0b0111111111111111111111111111111111111111111111111111111111111111"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 468, - EndPos: 535, - }, - Expr: &scalar.Dnumber{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 18, EndLine: 18, StartPos: 468, - EndPos: 534, + EndPos: 535, }, - Value: "0b1111111111111111111111111111111111111111111111111111111111111111", + }, + Expr: &ast.ScalarDnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 468, + EndPos: 534, + }, + }, + Value: []byte("0b1111111111111111111111111111111111111111111111111111111111111111"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 538, - EndPos: 559, - }, - Expr: &scalar.Lnumber{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 19, EndLine: 19, StartPos: 538, - EndPos: 558, + EndPos: 559, }, - Value: "0x007111111111111111", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 538, + EndPos: 558, + }, + }, + Value: []byte("0x007111111111111111"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 562, - EndPos: 581, - }, - Expr: &scalar.Dnumber{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 20, EndLine: 20, StartPos: 562, - EndPos: 580, + EndPos: 581, }, - Value: "0x8111111111111111", + }, + Expr: &ast.ScalarDnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 562, + EndPos: 580, + }, + }, + Value: []byte("0x8111111111111111"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 584, - EndPos: 594, - }, - Expr: &scalar.MagicConstant{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 21, EndLine: 21, StartPos: 584, - EndPos: 593, + EndPos: 594, }, - Value: "__CLASS__", + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 584, + EndPos: 593, + }, + }, + Value: []byte("__CLASS__"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 22, - EndLine: 22, - StartPos: 597, - EndPos: 605, - }, - Expr: &scalar.MagicConstant{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 22, EndLine: 22, StartPos: 597, - EndPos: 604, + EndPos: 605, }, - Value: "__DIR__", + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 22, + EndLine: 22, + StartPos: 597, + EndPos: 604, + }, + }, + Value: []byte("__DIR__"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 23, - EndLine: 23, - StartPos: 608, - EndPos: 617, - }, - Expr: &scalar.MagicConstant{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 23, EndLine: 23, StartPos: 608, - EndPos: 616, + EndPos: 617, }, - Value: "__FILE__", + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 23, + EndLine: 23, + StartPos: 608, + EndPos: 616, + }, + }, + Value: []byte("__FILE__"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 24, - EndLine: 24, - StartPos: 620, - EndPos: 633, - }, - Expr: &scalar.MagicConstant{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 24, EndLine: 24, StartPos: 620, - EndPos: 632, + EndPos: 633, }, - Value: "__FUNCTION__", + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 620, + EndPos: 632, + }, + }, + Value: []byte("__FUNCTION__"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 25, - EndLine: 25, - StartPos: 636, - EndPos: 645, - }, - Expr: &scalar.MagicConstant{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 25, EndLine: 25, StartPos: 636, - EndPos: 644, + EndPos: 645, }, - Value: "__LINE__", + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 636, + EndPos: 644, + }, + }, + Value: []byte("__LINE__"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 26, - EndLine: 26, - StartPos: 648, - EndPos: 662, - }, - Expr: &scalar.MagicConstant{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 26, EndLine: 26, StartPos: 648, - EndPos: 661, + EndPos: 662, }, - Value: "__NAMESPACE__", + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 26, + EndLine: 26, + StartPos: 648, + EndPos: 661, + }, + }, + Value: []byte("__NAMESPACE__"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 27, - EndLine: 27, - StartPos: 665, - EndPos: 676, - }, - Expr: &scalar.MagicConstant{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 27, EndLine: 27, StartPos: 665, - EndPos: 675, + EndPos: 676, }, - Value: "__METHOD__", + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 27, + EndLine: 27, + StartPos: 665, + EndPos: 675, + }, + }, + Value: []byte("__METHOD__"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 28, - EndLine: 28, - StartPos: 679, - EndPos: 689, - }, - Expr: &scalar.MagicConstant{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 28, EndLine: 28, StartPos: 679, - EndPos: 688, + EndPos: 689, }, - Value: "__TRAIT__", + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 679, + EndPos: 688, + }, + }, + Value: []byte("__TRAIT__"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 30, - EndLine: 30, - StartPos: 693, - EndPos: 705, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 30, EndLine: 30, StartPos: 693, - EndPos: 704, + EndPos: 705, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 30, - EndLine: 30, - StartPos: 694, - EndPos: 699, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 30, + EndLine: 30, + StartPos: 693, + EndPos: 704, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 30, - EndLine: 30, - StartPos: 699, - EndPos: 703, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 30, + EndLine: 30, + StartPos: 694, + EndPos: 699, + }, }, - VarName: &node.Identifier{ + Value: []byte("test "), + }, + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 30, EndLine: 30, StartPos: 699, EndPos: 703, }, - Value: "var", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 30, + EndLine: 30, + StartPos: 699, + EndPos: 703, + }, + }, + Value: []byte("var"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 708, - EndPos: 723, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 31, EndLine: 31, StartPos: 708, - EndPos: 722, + EndPos: 723, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 709, - EndPos: 714, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 708, + EndPos: 722, }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 714, - EndPos: 721, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 709, + EndPos: 714, + }, }, - Variable: &expr.Variable{ + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 31, EndLine: 31, StartPos: 714, - EndPos: 718, + EndPos: 721, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 31, EndLine: 31, StartPos: 714, EndPos: 718, }, - Value: "var", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 714, + EndPos: 718, + }, + }, + Value: []byte("var"), }, }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 719, - EndPos: 720, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 719, + EndPos: 720, + }, }, - Value: "1", + Value: []byte("1"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 726, - EndPos: 780, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 32, EndLine: 32, StartPos: 726, - EndPos: 779, + EndPos: 780, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 727, - EndPos: 732, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 726, + EndPos: 779, }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 732, - EndPos: 778, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 727, + EndPos: 732, + }, }, - Variable: &expr.Variable{ + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 32, EndLine: 32, StartPos: 732, - EndPos: 736, + EndPos: 778, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 32, EndLine: 32, StartPos: 732, EndPos: 736, }, - Value: "var", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 732, + EndPos: 736, + }, + }, + Value: []byte("var"), }, }, - Dim: &scalar.String{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 737, - EndPos: 777, + Dim: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 737, + EndPos: 777, + }, }, - Value: "1234567890123456789012345678901234567890", + Value: []byte("1234567890123456789012345678901234567890"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 783, - EndPos: 800, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 33, EndLine: 33, StartPos: 783, - EndPos: 799, + EndPos: 800, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 784, - EndPos: 789, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 783, + EndPos: 799, }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 789, - EndPos: 798, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 784, + EndPos: 789, + }, }, - Variable: &expr.Variable{ + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 33, EndLine: 33, StartPos: 789, - EndPos: 793, + EndPos: 798, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 33, EndLine: 33, StartPos: 789, EndPos: 793, }, - Value: "var", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 789, + EndPos: 793, + }, + }, + Value: []byte("var"), }, }, - Dim: &scalar.String{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 794, - EndPos: 797, + Dim: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 794, + EndPos: 797, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 803, - EndPos: 821, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 34, EndLine: 34, StartPos: 803, - EndPos: 820, + EndPos: 821, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 804, - EndPos: 809, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 803, + EndPos: 820, }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 809, - EndPos: 819, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 804, + EndPos: 809, + }, }, - Variable: &expr.Variable{ + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 34, EndLine: 34, StartPos: 809, - EndPos: 813, + EndPos: 819, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 34, EndLine: 34, StartPos: 809, EndPos: 813, }, - Value: "var", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 809, + EndPos: 813, + }, + }, + Value: []byte("var"), }, }, - Dim: &expr.Variable{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 814, - EndPos: 818, - }, - VarName: &node.Identifier{ + Dim: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 34, EndLine: 34, StartPos: 814, EndPos: 818, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 814, + EndPos: 818, + }, + }, + Value: []byte("bar"), }, }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 824, - EndPos: 836, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 35, EndLine: 35, StartPos: 824, - EndPos: 835, + EndPos: 836, }, - Parts: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 825, - EndPos: 829, - }, - VarName: &node.Identifier{ + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 824, + EndPos: 835, + }, + }, + Parts: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 35, EndLine: 35, StartPos: 825, EndPos: 829, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 825, + EndPos: 829, + }, + }, + Value: []byte("foo"), }, }, - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 829, - EndPos: 830, + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 829, + EndPos: 830, + }, }, - Value: " ", + Value: []byte(" "), }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 830, - EndPos: 834, - }, - VarName: &node.Identifier{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 35, EndLine: 35, StartPos: 830, EndPos: 834, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 830, + EndPos: 834, + }, + }, + Value: []byte("bar"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 839, - EndPos: 858, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 36, EndLine: 36, StartPos: 839, - EndPos: 857, + EndPos: 858, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 840, - EndPos: 845, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 839, + EndPos: 857, }, - &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 845, - EndPos: 854, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 840, + EndPos: 845, + }, }, - Variable: &expr.Variable{ + Value: []byte("test "), + }, + &ast.ExprPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 36, EndLine: 36, StartPos: 845, - EndPos: 849, + EndPos: 854, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 36, EndLine: 36, StartPos: 845, EndPos: 849, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 845, + EndPos: 849, + }, + }, + Value: []byte("foo"), }, }, - Property: &node.Identifier{ + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 851, + EndPos: 854, + }, + }, + Value: []byte("bar"), + }, + }, + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ Position: &position.Position{ StartLine: 36, EndLine: 36, - StartPos: 851, - EndPos: 854, + StartPos: 854, + EndPos: 856, }, - Value: "bar", }, - }, - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 854, - EndPos: 856, - }, - Value: "()", + Value: []byte("()"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 37, - EndLine: 37, - StartPos: 861, - EndPos: 875, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 37, EndLine: 37, StartPos: 861, - EndPos: 874, + EndPos: 875, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 37, - EndLine: 37, - StartPos: 862, - EndPos: 867, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 37, + EndLine: 37, + StartPos: 861, + EndPos: 874, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 37, - EndLine: 37, - StartPos: 867, - EndPos: 873, - }, - VarName: &node.Identifier{ + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ Position: &position.Position{ StartLine: 37, EndLine: 37, - StartPos: 869, - EndPos: 872, + StartPos: 862, + EndPos: 867, }, - Value: "foo", + }, + Value: []byte("test "), + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 37, + EndLine: 37, + StartPos: 867, + EndPos: 873, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 37, + EndLine: 37, + StartPos: 869, + EndPos: 872, + }, + }, + Value: []byte("foo"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 38, - EndLine: 38, - StartPos: 878, - EndPos: 895, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 38, EndLine: 38, StartPos: 878, - EndPos: 894, + EndPos: 895, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 38, - EndLine: 38, - StartPos: 879, - EndPos: 884, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 38, + EndLine: 38, + StartPos: 878, + EndPos: 894, }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 38, - EndLine: 38, - StartPos: 884, - EndPos: 893, - }, - Variable: &expr.Variable{ + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ Position: &position.Position{ StartLine: 38, EndLine: 38, - StartPos: 886, - EndPos: 889, + StartPos: 879, + EndPos: 884, }, - VarName: &node.Identifier{ + }, + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 38, + EndLine: 38, + StartPos: 884, + EndPos: 893, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 38, EndLine: 38, StartPos: 886, EndPos: 889, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 38, + EndLine: 38, + StartPos: 886, + EndPos: 889, + }, + }, + Value: []byte("foo"), }, }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 38, - EndLine: 38, - StartPos: 890, - EndPos: 891, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 38, + EndLine: 38, + StartPos: 890, + EndPos: 891, + }, }, - Value: "0", + Value: []byte("0"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 898, - EndPos: 919, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 39, EndLine: 39, StartPos: 898, - EndPos: 918, + EndPos: 919, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 899, - EndPos: 904, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 898, + EndPos: 918, }, - &expr.MethodCall{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 905, - EndPos: 916, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 899, + EndPos: 904, + }, }, - Variable: &expr.Variable{ + Value: []byte("test "), + }, + &ast.ExprMethodCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 39, EndLine: 39, StartPos: 905, - EndPos: 909, + EndPos: 916, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 39, EndLine: 39, StartPos: 905, EndPos: 909, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 905, + EndPos: 909, + }, + }, + Value: []byte("foo"), }, }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 911, - EndPos: 914, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 911, + EndPos: 914, + }, }, - Value: "bar", + Value: []byte("bar"), }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 914, - EndPos: 916, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 914, + EndPos: 916, + }, }, }, }, }, }, }, - &stmt.AltIf{ - Position: &position.Position{ - StartLine: 41, - EndLine: 42, - StartPos: 923, - EndPos: 941, - }, - Cond: &expr.Variable{ + &ast.StmtAltIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 927, - EndPos: 929, + EndLine: 42, + StartPos: 923, + EndPos: 941, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 41, EndLine: 41, StartPos: 927, EndPos: 929, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 927, + EndPos: 929, + }, + }, + Value: []byte("a"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.AltIf{ - Position: &position.Position{ - StartLine: 43, - EndLine: 45, - StartPos: 944, - EndPos: 977, - }, - Cond: &expr.Variable{ + &ast.StmtAltIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 948, - EndPos: 950, + EndLine: 45, + StartPos: 944, + EndPos: 977, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 43, EndLine: 43, StartPos: 948, EndPos: 950, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 948, + EndPos: 950, + }, + }, + Value: []byte("a"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.AltElseIf{ + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ Position: &position.Position{ - StartLine: 44, + StartLine: -1, EndLine: -1, - StartPos: 956, + StartPos: -1, EndPos: -1, }, - Cond: &expr.Variable{ + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtAltElseIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 964, - EndPos: 966, + EndLine: -1, + StartPos: 956, + EndPos: -1, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 44, EndLine: 44, StartPos: 964, EndPos: 966, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 964, + EndPos: 966, + }, + }, + Value: []byte("b"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, }, }, - &stmt.AltIf{ - Position: &position.Position{ - StartLine: 46, - EndLine: 48, - StartPos: 980, - EndPos: 1006, - }, - Cond: &expr.Variable{ + &ast.StmtAltIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 984, - EndPos: 986, + EndLine: 48, + StartPos: 980, + EndPos: 1006, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 46, EndLine: 46, StartPos: 984, EndPos: 986, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 984, + EndPos: 986, + }, + }, + Value: []byte("a"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - Else: &stmt.AltElse{ - Position: &position.Position{ - StartLine: 47, - EndLine: -1, - StartPos: 992, - EndPos: -1, - }, - Stmt: &stmt.StmtList{ + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ Position: &position.Position{ StartLine: -1, EndLine: -1, StartPos: -1, EndPos: -1, }, - Stmts: []node.Node{}, + }, + Stmts: []ast.Vertex{}, + }, + Else: &ast.StmtAltElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: -1, + StartPos: 992, + EndPos: -1, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, }, }, }, - &stmt.AltIf{ - Position: &position.Position{ - StartLine: 49, - EndLine: 53, - StartPos: 1009, - EndPos: 1065, - }, - Cond: &expr.Variable{ + &ast.StmtAltIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1013, - EndPos: 1015, + EndLine: 53, + StartPos: 1009, + EndPos: 1065, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 49, EndLine: 49, StartPos: 1013, EndPos: 1015, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1013, + EndPos: 1015, + }, + }, + Value: []byte("a"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.AltElseIf{ - Position: &position.Position{ - StartLine: 50, - EndLine: -1, - StartPos: 1021, - EndPos: -1, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1029, - EndPos: 1031, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1029, - EndPos: 1031, - }, - Value: "b", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.AltElseIf{ - Position: &position.Position{ - StartLine: 51, - EndLine: -1, - StartPos: 1036, - EndPos: -1, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1044, - EndPos: 1046, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1044, - EndPos: 1046, - }, - Value: "c", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - }, - Else: &stmt.AltElse{ - Position: &position.Position{ - StartLine: 52, - EndLine: -1, - StartPos: 1051, - EndPos: -1, - }, - Stmt: &stmt.StmtList{ + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ Position: &position.Position{ StartLine: -1, EndLine: -1, StartPos: -1, EndPos: -1, }, - Stmts: []node.Node{}, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtAltElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: -1, + StartPos: 1021, + EndPos: -1, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1029, + EndPos: 1031, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1029, + EndPos: 1031, + }, + }, + Value: []byte("b"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtAltElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: -1, + StartPos: 1036, + EndPos: -1, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1044, + EndPos: 1046, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1044, + EndPos: 1046, + }, + }, + Value: []byte("c"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + Else: &ast.StmtAltElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 52, + EndLine: -1, + StartPos: 1051, + EndPos: -1, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, }, }, }, - &stmt.While{ - Position: &position.Position{ - StartLine: 55, - EndLine: 55, - StartPos: 1069, - EndPos: 1089, - }, - Cond: &scalar.Lnumber{ + &ast.StmtWhile{ + Node: ast.Node{ Position: &position.Position{ StartLine: 55, EndLine: 55, - StartPos: 1076, - EndPos: 1077, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 55, - EndLine: 55, - StartPos: 1079, + StartPos: 1069, EndPos: 1089, }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 55, - EndLine: 55, - StartPos: 1081, - EndPos: 1087, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 55, + EndLine: 55, + StartPos: 1076, + EndPos: 1077, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 55, + EndLine: 55, + StartPos: 1079, + EndPos: 1089, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 55, + EndLine: 55, + StartPos: 1081, + EndPos: 1087, + }, }, }, }, }, }, - &stmt.While{ - Position: &position.Position{ - StartLine: 56, - EndLine: 56, - StartPos: 1092, - EndPos: 1114, - }, - Cond: &scalar.Lnumber{ + &ast.StmtWhile{ + Node: ast.Node{ Position: &position.Position{ StartLine: 56, EndLine: 56, - StartPos: 1099, - EndPos: 1100, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 56, - EndLine: 56, - StartPos: 1102, + StartPos: 1092, EndPos: 1114, }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 56, - EndLine: 56, - StartPos: 1104, - EndPos: 1112, - }, - Expr: &scalar.Lnumber{ + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 56, + EndLine: 56, + StartPos: 1099, + EndPos: 1100, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 56, + EndLine: 56, + StartPos: 1102, + EndPos: 1114, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ Position: &position.Position{ StartLine: 56, EndLine: 56, - StartPos: 1110, - EndPos: 1111, + StartPos: 1104, + EndPos: 1112, }, - Value: "2", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 56, + EndLine: 56, + StartPos: 1110, + EndPos: 1111, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.AltWhile{ - Position: &position.Position{ - StartLine: 57, - EndLine: 57, - StartPos: 1117, - EndPos: 1148, - }, - Cond: &scalar.Lnumber{ + &ast.StmtAltWhile{ + Node: ast.Node{ Position: &position.Position{ StartLine: 57, EndLine: 57, - StartPos: 1124, - EndPos: 1125, + StartPos: 1117, + EndPos: 1148, }, - Value: "1", }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 57, - EndLine: 57, - StartPos: 1129, - EndPos: 1138, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 57, + EndLine: 57, + StartPos: 1124, + EndPos: 1125, + }, }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 57, - EndLine: 57, - StartPos: 1129, - EndPos: 1138, - }, - Expr: &scalar.Lnumber{ + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 57, + EndLine: 57, + StartPos: 1129, + EndPos: 1138, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ Position: &position.Position{ StartLine: 57, EndLine: 57, - StartPos: 1135, - EndPos: 1136, + StartPos: 1129, + EndPos: 1138, }, - Value: "3", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 57, + EndLine: 57, + StartPos: 1135, + EndPos: 1136, + }, + }, + Value: []byte("3"), }, }, }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1151, - EndPos: 1187, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 58, EndLine: 58, - StartPos: 1157, - EndPos: 1160, + StartPos: 1151, + EndPos: 1187, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.ClassConstList{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 58, EndLine: 58, - StartPos: 1162, - EndPos: 1185, + StartPos: 1157, + EndPos: 1160, }, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1168, - EndPos: 1175, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassConstList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1162, + EndPos: 1185, + }, + }, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ Position: &position.Position{ StartLine: 58, EndLine: 58, StartPos: 1168, - EndPos: 1171, - }, - Value: "FOO", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1174, EndPos: 1175, }, - Value: "1", + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1168, + EndPos: 1171, + }, + }, + Value: []byte("FOO"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1174, + EndPos: 1175, + }, + }, + Value: []byte("1"), }, }, - &stmt.Constant{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1177, - EndPos: 1184, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ + &ast.StmtConstant{ + Node: ast.Node{ Position: &position.Position{ StartLine: 58, EndLine: 58, StartPos: 1177, - EndPos: 1180, - }, - Value: "BAR", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1183, EndPos: 1184, }, - Value: "2", + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1177, + EndPos: 1180, + }, + }, + Value: []byte("BAR"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1183, + EndPos: 1184, + }, + }, + Value: []byte("2"), }, }, }, }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 59, - EndLine: 59, - StartPos: 1190, - EndPos: 1220, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 59, EndLine: 59, - StartPos: 1196, - EndPos: 1199, + StartPos: 1190, + EndPos: 1220, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.ClassMethod{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 59, EndLine: 59, - StartPos: 1201, - EndPos: 1218, + StartPos: 1196, + EndPos: 1199, }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 59, EndLine: 59, - StartPos: 1210, - EndPos: 1213, - }, - Value: "bar", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 59, - EndLine: 59, - StartPos: 1216, + StartPos: 1201, EndPos: 1218, }, - Stmts: []node.Node{}, + }, + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 59, + EndLine: 59, + StartPos: 1210, + EndPos: 1213, + }, + }, + Value: []byte("bar"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 59, + EndLine: 59, + StartPos: 1216, + EndPos: 1218, + }, + }, + Stmts: []ast.Vertex{}, }, }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 60, - EndLine: 60, - StartPos: 1223, - EndPos: 1268, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 60, EndLine: 60, - StartPos: 1229, - EndPos: 1232, + StartPos: 1223, + EndPos: 1268, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.ClassMethod{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 60, EndLine: 60, - StartPos: 1234, - EndPos: 1266, + StartPos: 1229, + EndPos: 1232, }, - ReturnsRef: true, - PhpDocComment: "", - MethodName: &node.Identifier{ + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 60, EndLine: 60, - StartPos: 1258, - EndPos: 1261, - }, - Value: "bar", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 60, - EndLine: 60, - StartPos: 1234, - EndPos: 1240, - }, - Value: "public", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 60, - EndLine: 60, - StartPos: 1241, - EndPos: 1247, - }, - Value: "static", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 60, - EndLine: 60, - StartPos: 1264, + StartPos: 1234, EndPos: 1266, }, - Stmts: []node.Node{}, + }, + ReturnsRef: true, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 60, + EndLine: 60, + StartPos: 1258, + EndPos: 1261, + }, + }, + Value: []byte("bar"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 60, + EndLine: 60, + StartPos: 1234, + EndPos: 1240, + }, + }, + Value: []byte("public"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 60, + EndLine: 60, + StartPos: 1241, + EndPos: 1247, + }, + }, + Value: []byte("static"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 60, + EndLine: 60, + StartPos: 1264, + EndPos: 1266, + }, + }, + Stmts: []ast.Vertex{}, }, }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1271, - EndPos: 1343, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 61, EndLine: 61, - StartPos: 1277, - EndPos: 1280, + StartPos: 1271, + EndPos: 1343, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.ClassMethod{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 61, EndLine: 61, - StartPos: 1282, - EndPos: 1313, + StartPos: 1277, + EndPos: 1280, }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 61, EndLine: 61, - StartPos: 1305, - EndPos: 1308, - }, - Value: "bar", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1282, - EndPos: 1287, - }, - Value: "final", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1288, - EndPos: 1295, - }, - Value: "private", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1311, + StartPos: 1282, EndPos: 1313, }, - Stmts: []node.Node{}, }, - }, - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1314, - EndPos: 1341, - }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1333, - EndPos: 1336, - }, - Value: "baz", - }, - Modifiers: []node.Node{ - &node.Identifier{ + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 61, EndLine: 61, - StartPos: 1314, - EndPos: 1323, + StartPos: 1305, + EndPos: 1308, }, - Value: "protected", + }, + Value: []byte("bar"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1282, + EndPos: 1287, + }, + }, + Value: []byte("final"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1288, + EndPos: 1295, + }, + }, + Value: []byte("private"), }, }, - Stmt: &stmt.StmtList{ + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1311, + EndPos: 1313, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtClassMethod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 61, EndLine: 61, - StartPos: 1339, + StartPos: 1314, EndPos: 1341, }, - Stmts: []node.Node{}, + }, + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1333, + EndPos: 1336, + }, + }, + Value: []byte("baz"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1314, + EndPos: 1323, + }, + }, + Value: []byte("protected"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1339, + EndPos: 1341, + }, + }, + Stmts: []ast.Vertex{}, }, }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1346, - EndPos: 1399, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 62, EndLine: 62, - StartPos: 1361, - EndPos: 1364, + StartPos: 1346, + EndPos: 1399, }, - Value: "foo", }, - Modifiers: []node.Node{ - &node.Identifier{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 62, EndLine: 62, - StartPos: 1346, - EndPos: 1354, + StartPos: 1361, + EndPos: 1364, }, - Value: "abstract", + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1346, + EndPos: 1354, + }, + }, + Value: []byte("abstract"), }, }, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1366, - EndPos: 1397, - }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 62, EndLine: 62, - StartPos: 1391, - EndPos: 1394, - }, - Value: "bar", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1366, - EndPos: 1374, - }, - Value: "abstract", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1375, - EndPos: 1381, - }, - Value: "public", - }, - }, - Stmt: &stmt.Nop{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1396, + StartPos: 1366, EndPos: 1397, }, }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1402, - EndPos: 1433, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1414, - EndPos: 1417, - }, - Value: "foo", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1402, - EndPos: 1407, - }, - Value: "final", - }, - }, - Extends: &stmt.ClassExtends{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1418, - EndPos: 1429, - }, - ClassName: &name.Name{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1426, - EndPos: 1429, - }, - Parts: []node.Node{ - &name.NamePart{ + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1426, - EndPos: 1429, + StartLine: 62, + EndLine: 62, + StartPos: 1391, + EndPos: 1394, + }, + }, + Value: []byte("bar"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1366, + EndPos: 1374, + }, + }, + Value: []byte("abstract"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1375, + EndPos: 1381, + }, + }, + Value: []byte("public"), + }, + }, + Stmt: &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1396, + EndPos: 1397, }, - Value: "bar", }, }, }, }, - Stmts: []node.Node{}, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 64, - EndLine: 64, - StartPos: 1436, - EndPos: 1470, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1402, + EndPos: 1433, + }, }, - PhpDocComment: "", - ClassName: &node.Identifier{ + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1414, + EndPos: 1417, + }, + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1402, + EndPos: 1407, + }, + }, + Value: []byte("final"), + }, + }, + Extends: &ast.StmtClassExtends{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1418, + EndPos: 1429, + }, + }, + ClassName: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1426, + EndPos: 1429, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1426, + EndPos: 1429, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 64, EndLine: 64, - StartPos: 1448, - EndPos: 1451, + StartPos: 1436, + EndPos: 1470, }, - Value: "foo", }, - Modifiers: []node.Node{ - &node.Identifier{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 64, EndLine: 64, - StartPos: 1436, - EndPos: 1441, + StartPos: 1448, + EndPos: 1451, }, - Value: "final", }, + Value: []byte("foo"), }, - Implements: &stmt.ClassImplements{ - Position: &position.Position{ - StartLine: 64, - EndLine: 64, - StartPos: 1452, - EndPos: 1466, - }, - InterfaceNames: []node.Node{ - &name.Name{ + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 64, EndLine: 64, - StartPos: 1463, - EndPos: 1466, + StartPos: 1436, + EndPos: 1441, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 64, - EndLine: 64, - StartPos: 1463, - EndPos: 1466, + }, + Value: []byte("final"), + }, + }, + Implements: &ast.StmtClassImplements{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 64, + EndLine: 64, + StartPos: 1452, + EndPos: 1466, + }, + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 64, + EndLine: 64, + StartPos: 1463, + EndPos: 1466, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 64, + EndLine: 64, + StartPos: 1463, + EndPos: 1466, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1473, - EndPos: 1512, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 65, EndLine: 65, - StartPos: 1485, - EndPos: 1488, + StartPos: 1473, + EndPos: 1512, }, - Value: "foo", }, - Modifiers: []node.Node{ - &node.Identifier{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 65, EndLine: 65, - StartPos: 1473, - EndPos: 1478, + StartPos: 1485, + EndPos: 1488, }, - Value: "final", }, + Value: []byte("foo"), }, - Implements: &stmt.ClassImplements{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1489, - EndPos: 1508, - }, - InterfaceNames: []node.Node{ - &name.Name{ + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 65, EndLine: 65, - StartPos: 1500, - EndPos: 1503, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1500, - EndPos: 1503, - }, - Value: "bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1505, - EndPos: 1508, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1505, - EndPos: 1508, - }, - Value: "baz", - }, + StartPos: 1473, + EndPos: 1478, }, }, + Value: []byte("final"), }, }, - Stmts: []node.Node{}, - }, - &stmt.ConstList{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1516, - EndPos: 1539, - }, - Consts: []node.Node{ - &stmt.Constant{ + Implements: &ast.StmtClassImplements{ + Node: ast.Node{ Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1522, - EndPos: 1529, + StartLine: 65, + EndLine: 65, + StartPos: 1489, + EndPos: 1508, }, - PhpDocComment: "", - ConstantName: &node.Identifier{ + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 65, + EndLine: 65, + StartPos: 1500, + EndPos: 1503, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 65, + EndLine: 65, + StartPos: 1500, + EndPos: 1503, + }, + }, + Value: []byte("bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 65, + EndLine: 65, + StartPos: 1505, + EndPos: 1508, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 65, + EndLine: 65, + StartPos: 1505, + EndPos: 1508, + }, + }, + Value: []byte("baz"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtConstList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1516, + EndPos: 1539, + }, + }, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ Position: &position.Position{ StartLine: 67, EndLine: 67, StartPos: 1522, - EndPos: 1525, - }, - Value: "FOO", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1528, EndPos: 1529, }, - Value: "1", + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1522, + EndPos: 1525, + }, + }, + Value: []byte("FOO"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1528, + EndPos: 1529, + }, + }, + Value: []byte("1"), }, }, - &stmt.Constant{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1531, - EndPos: 1538, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ + &ast.StmtConstant{ + Node: ast.Node{ Position: &position.Position{ StartLine: 67, EndLine: 67, StartPos: 1531, - EndPos: 1534, - }, - Value: "BAR", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1537, EndPos: 1538, }, - Value: "2", + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1531, + EndPos: 1534, + }, + }, + Value: []byte("BAR"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1537, + EndPos: 1538, + }, + }, + Value: []byte("2"), }, }, }, }, - &stmt.While{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1542, - EndPos: 1565, - }, - Cond: &scalar.Lnumber{ + &ast.StmtWhile{ + Node: ast.Node{ Position: &position.Position{ StartLine: 68, EndLine: 68, - StartPos: 1549, - EndPos: 1550, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1552, + StartPos: 1542, EndPos: 1565, }, - Stmts: []node.Node{ - &stmt.Continue{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1554, - EndPos: 1563, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1549, + EndPos: 1550, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1552, + EndPos: 1565, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtContinue{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1554, + EndPos: 1563, + }, }, }, }, }, }, - &stmt.While{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1568, - EndPos: 1593, - }, - Cond: &scalar.Lnumber{ + &ast.StmtWhile{ + Node: ast.Node{ Position: &position.Position{ StartLine: 69, EndLine: 69, - StartPos: 1575, - EndPos: 1576, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1578, + StartPos: 1568, EndPos: 1593, }, - Stmts: []node.Node{ - &stmt.Continue{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1580, - EndPos: 1591, - }, - Expr: &scalar.Lnumber{ + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1575, + EndPos: 1576, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1578, + EndPos: 1593, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtContinue{ + Node: ast.Node{ Position: &position.Position{ StartLine: 69, EndLine: 69, - StartPos: 1589, - EndPos: 1590, + StartPos: 1580, + EndPos: 1591, }, - Value: "2", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1589, + EndPos: 1590, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.While{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1596, - EndPos: 1622, - }, - Cond: &scalar.Lnumber{ + &ast.StmtWhile{ + Node: ast.Node{ Position: &position.Position{ StartLine: 70, EndLine: 70, - StartPos: 1603, - EndPos: 1604, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1606, + StartPos: 1596, EndPos: 1622, }, - Stmts: []node.Node{ - &stmt.Continue{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1608, - EndPos: 1620, - }, - Expr: &scalar.Lnumber{ + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1603, + EndPos: 1604, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1606, + EndPos: 1622, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtContinue{ + Node: ast.Node{ Position: &position.Position{ StartLine: 70, EndLine: 70, - StartPos: 1617, - EndPos: 1618, + StartPos: 1608, + EndPos: 1620, }, - Value: "3", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1617, + EndPos: 1618, + }, + }, + Value: []byte("3"), }, }, }, }, }, - &stmt.Declare{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1625, - EndPos: 1642, + &ast.StmtDeclare{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1625, + EndPos: 1642, + }, }, Alt: false, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1633, - EndPos: 1640, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ Position: &position.Position{ StartLine: 71, EndLine: 71, StartPos: 1633, - EndPos: 1638, - }, - Value: "ticks", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1639, EndPos: 1640, }, - Value: "1", + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1633, + EndPos: 1638, + }, + }, + Value: []byte("ticks"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1639, + EndPos: 1640, + }, + }, + Value: []byte("1"), }, }, }, - Stmt: &stmt.Nop{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1641, - EndPos: 1642, + Stmt: &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1641, + EndPos: 1642, + }, }, }, }, - &stmt.Declare{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1645, - EndPos: 1680, + &ast.StmtDeclare{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1645, + EndPos: 1680, + }, }, Alt: false, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1653, - EndPos: 1660, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ Position: &position.Position{ StartLine: 72, EndLine: 72, StartPos: 1653, - EndPos: 1658, - }, - Value: "ticks", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1659, EndPos: 1660, }, - Value: "1", + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1653, + EndPos: 1658, + }, + }, + Value: []byte("ticks"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1659, + EndPos: 1660, + }, + }, + Value: []byte("1"), }, }, - &stmt.Constant{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1662, - EndPos: 1676, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ + &ast.StmtConstant{ + Node: ast.Node{ Position: &position.Position{ StartLine: 72, EndLine: 72, StartPos: 1662, - EndPos: 1674, - }, - Value: "strict_types", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1675, EndPos: 1676, }, - Value: "1", + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1662, + EndPos: 1674, + }, + }, + Value: []byte("strict_types"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1675, + EndPos: 1676, + }, + }, + Value: []byte("1"), }, }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1678, - EndPos: 1680, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1678, + EndPos: 1680, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Declare{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1683, - EndPos: 1712, + &ast.StmtDeclare{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1683, + EndPos: 1712, + }, }, Alt: true, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1691, - EndPos: 1698, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ Position: &position.Position{ StartLine: 73, EndLine: 73, StartPos: 1691, - EndPos: 1696, - }, - Value: "ticks", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1697, EndPos: 1698, }, - Value: "1", + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1691, + EndPos: 1696, + }, + }, + Value: []byte("ticks"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1697, + EndPos: 1698, + }, + }, + Value: []byte("1"), }, }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Do{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1715, - EndPos: 1730, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1718, - EndPos: 1720, - }, - Stmts: []node.Node{}, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1727, - EndPos: 1728, - }, - Value: "1", - }, - }, - &stmt.Echo{ - Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1733, - EndPos: 1744, - }, - Exprs: []node.Node{ - &expr.Variable{ + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1738, - EndPos: 1740, + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, }, - VarName: &node.Identifier{ + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtDo{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1715, + EndPos: 1730, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1718, + EndPos: 1720, + }, + }, + Stmts: []ast.Vertex{}, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1727, + EndPos: 1728, + }, + }, + Value: []byte("1"), + }, + }, + &ast.StmtEcho{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1733, + EndPos: 1744, + }, + }, + Exprs: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 75, EndLine: 75, StartPos: 1738, EndPos: 1740, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1738, + EndPos: 1740, + }, + }, + Value: []byte("a"), }, }, - &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1742, - EndPos: 1743, + &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1742, + EndPos: 1743, + }, }, - Value: "1", + Value: []byte("1"), }, }, }, - &stmt.Echo{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1747, - EndPos: 1756, + &ast.StmtEcho{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1747, + EndPos: 1756, + }, }, - Exprs: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1752, - EndPos: 1754, - }, - VarName: &node.Identifier{ + Exprs: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 76, EndLine: 76, StartPos: 1752, EndPos: 1754, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1752, + EndPos: 1754, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.For{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1759, - EndPos: 1794, + &ast.StmtFor{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1759, + EndPos: 1794, + }, }, - Init: []node.Node{ - &assign.Assign{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1763, - EndPos: 1769, - }, - Variable: &expr.Variable{ + Init: []ast.Vertex{ + &ast.ExprAssign{ + Node: ast.Node{ Position: &position.Position{ StartLine: 77, EndLine: 77, StartPos: 1763, - EndPos: 1765, + EndPos: 1769, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 77, EndLine: 77, StartPos: 1763, EndPos: 1765, }, - Value: "i", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1763, + EndPos: 1765, + }, + }, + Value: []byte("i"), }, }, - Expression: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1768, - EndPos: 1769, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1768, + EndPos: 1769, + }, }, - Value: "0", + Value: []byte("0"), }, }, }, - Cond: []node.Node{ - &binary.Smaller{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1771, - EndPos: 1778, - }, - Left: &expr.Variable{ + Cond: []ast.Vertex{ + &ast.ExprBinarySmaller{ + Node: ast.Node{ Position: &position.Position{ StartLine: 77, EndLine: 77, StartPos: 1771, - EndPos: 1773, + EndPos: 1778, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 77, EndLine: 77, StartPos: 1771, EndPos: 1773, }, - Value: "i", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1771, + EndPos: 1773, + }, + }, + Value: []byte("i"), }, }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1776, - EndPos: 1778, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1776, + EndPos: 1778, + }, }, - Value: "10", + Value: []byte("10"), }, }, }, - Loop: []node.Node{ - &expr.PostInc{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1780, - EndPos: 1784, - }, - Variable: &expr.Variable{ + Loop: []ast.Vertex{ + &ast.ExprPostInc{ + Node: ast.Node{ Position: &position.Position{ StartLine: 77, EndLine: 77, StartPos: 1780, - EndPos: 1782, + EndPos: 1784, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 77, EndLine: 77, StartPos: 1780, EndPos: 1782, }, - Value: "i", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1780, + EndPos: 1782, + }, + }, + Value: []byte("i"), }, }, }, - &expr.PostInc{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1786, - EndPos: 1790, - }, - Variable: &expr.Variable{ + &ast.ExprPostInc{ + Node: ast.Node{ Position: &position.Position{ StartLine: 77, EndLine: 77, StartPos: 1786, - EndPos: 1788, + EndPos: 1790, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 77, EndLine: 77, StartPos: 1786, EndPos: 1788, }, - Value: "i", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1786, + EndPos: 1788, + }, + }, + Value: []byte("i"), }, }, }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1792, - EndPos: 1794, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1792, + EndPos: 1794, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.AltFor{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1797, - EndPos: 1827, + &ast.StmtAltFor{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1797, + EndPos: 1827, + }, }, - Cond: []node.Node{ - &binary.Smaller{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1803, - EndPos: 1810, - }, - Left: &expr.Variable{ + Cond: []ast.Vertex{ + &ast.ExprBinarySmaller{ + Node: ast.Node{ Position: &position.Position{ StartLine: 78, EndLine: 78, StartPos: 1803, - EndPos: 1805, + EndPos: 1810, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 78, EndLine: 78, StartPos: 1803, EndPos: 1805, }, - Value: "i", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1803, + EndPos: 1805, + }, + }, + Value: []byte("i"), }, }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1808, - EndPos: 1810, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1808, + EndPos: 1810, + }, }, - Value: "10", + Value: []byte("10"), }, }, }, - Loop: []node.Node{ - &expr.PostInc{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1812, - EndPos: 1816, - }, - Variable: &expr.Variable{ + Loop: []ast.Vertex{ + &ast.ExprPostInc{ + Node: ast.Node{ Position: &position.Position{ StartLine: 78, EndLine: 78, StartPos: 1812, - EndPos: 1814, + EndPos: 1816, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 78, EndLine: 78, StartPos: 1812, EndPos: 1814, }, - Value: "i", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1812, + EndPos: 1814, + }, + }, + Value: []byte("i"), }, }, }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1830, - EndPos: 1851, - }, - Expr: &expr.Variable{ + &ast.StmtForeach{ + Node: ast.Node{ Position: &position.Position{ StartLine: 79, EndLine: 79, - StartPos: 1839, - EndPos: 1841, + StartPos: 1830, + EndPos: 1851, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 79, EndLine: 79, StartPos: 1839, EndPos: 1841, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1839, + EndPos: 1841, + }, + }, + Value: []byte("a"), }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1845, - EndPos: 1847, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 79, EndLine: 79, StartPos: 1845, EndPos: 1847, }, - Value: "v", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1845, + EndPos: 1847, + }, + }, + Value: []byte("v"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1849, - EndPos: 1851, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1849, + EndPos: 1851, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 80, - EndLine: 80, - StartPos: 1854, - EndPos: 1875, - }, - Expr: &expr.ShortArray{ + &ast.StmtForeach{ + Node: ast.Node{ Position: &position.Position{ StartLine: 80, EndLine: 80, - StartPos: 1863, - EndPos: 1865, + StartPos: 1854, + EndPos: 1875, }, - Items: []node.Node{}, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 80, - EndLine: 80, - StartPos: 1869, - EndPos: 1871, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 80, + EndLine: 80, + StartPos: 1863, + EndPos: 1865, + }, }, - VarName: &node.Identifier{ + Items: []ast.Vertex{}, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 80, EndLine: 80, StartPos: 1869, EndPos: 1871, }, - Value: "v", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 80, + EndLine: 80, + StartPos: 1869, + EndPos: 1871, + }, + }, + Value: []byte("v"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 80, - EndLine: 80, - StartPos: 1873, - EndPos: 1875, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 80, + EndLine: 80, + StartPos: 1873, + EndPos: 1875, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.AltForeach{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1878, - EndPos: 1910, - }, - Expr: &expr.Variable{ + &ast.StmtAltForeach{ + Node: ast.Node{ Position: &position.Position{ StartLine: 81, EndLine: 81, - StartPos: 1887, - EndPos: 1889, + StartPos: 1878, + EndPos: 1910, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 81, EndLine: 81, StartPos: 1887, EndPos: 1889, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1887, + EndPos: 1889, + }, + }, + Value: []byte("a"), }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1893, - EndPos: 1895, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 81, EndLine: 81, StartPos: 1893, EndPos: 1895, }, - Value: "v", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1893, + EndPos: 1895, + }, + }, + Value: []byte("v"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1913, - EndPos: 1940, - }, - Expr: &expr.Variable{ + &ast.StmtForeach{ + Node: ast.Node{ Position: &position.Position{ StartLine: 82, EndLine: 82, - StartPos: 1922, - EndPos: 1924, + StartPos: 1913, + EndPos: 1940, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 82, EndLine: 82, StartPos: 1922, EndPos: 1924, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1922, + EndPos: 1924, + }, + }, + Value: []byte("a"), }, }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1928, - EndPos: 1930, - }, - VarName: &node.Identifier{ + Key: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 82, EndLine: 82, StartPos: 1928, EndPos: 1930, }, - Value: "k", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1928, + EndPos: 1930, + }, + }, + Value: []byte("k"), }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1934, - EndPos: 1936, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 82, EndLine: 82, StartPos: 1934, EndPos: 1936, }, - Value: "v", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1934, + EndPos: 1936, + }, + }, + Value: []byte("v"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1938, - EndPos: 1940, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1938, + EndPos: 1940, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1943, - EndPos: 1970, - }, - Expr: &expr.ShortArray{ + &ast.StmtForeach{ + Node: ast.Node{ Position: &position.Position{ StartLine: 83, EndLine: 83, - StartPos: 1952, - EndPos: 1954, + StartPos: 1943, + EndPos: 1970, }, - Items: []node.Node{}, }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1958, - EndPos: 1960, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1952, + EndPos: 1954, + }, }, - VarName: &node.Identifier{ + Items: []ast.Vertex{}, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 83, EndLine: 83, StartPos: 1958, EndPos: 1960, }, - Value: "k", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1958, + EndPos: 1960, + }, + }, + Value: []byte("k"), }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1964, - EndPos: 1966, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 83, EndLine: 83, StartPos: 1964, EndPos: 1966, }, - Value: "v", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1964, + EndPos: 1966, + }, + }, + Value: []byte("v"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1968, - EndPos: 1970, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1968, + EndPos: 1970, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1973, - EndPos: 2001, - }, - Expr: &expr.Variable{ + &ast.StmtForeach{ + Node: ast.Node{ Position: &position.Position{ StartLine: 84, EndLine: 84, - StartPos: 1982, - EndPos: 1984, + StartPos: 1973, + EndPos: 2001, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 84, EndLine: 84, StartPos: 1982, EndPos: 1984, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1982, + EndPos: 1984, + }, + }, + Value: []byte("a"), }, }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1988, - EndPos: 1990, - }, - VarName: &node.Identifier{ + Key: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 84, EndLine: 84, StartPos: 1988, EndPos: 1990, }, - Value: "k", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1988, + EndPos: 1990, + }, + }, + Value: []byte("k"), }, }, - Variable: &expr.Reference{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1994, - EndPos: 1997, - }, - Variable: &expr.Variable{ + Var: &ast.ExprReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 84, EndLine: 84, - StartPos: 1995, + StartPos: 1994, EndPos: 1997, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 84, EndLine: 84, StartPos: 1995, EndPos: 1997, }, - Value: "v", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1995, + EndPos: 1997, + }, + }, + Value: []byte("v"), }, }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1999, - EndPos: 2001, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1999, + EndPos: 2001, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 2004, - EndPos: 2037, - }, - Expr: &expr.Variable{ + &ast.StmtForeach{ + Node: ast.Node{ Position: &position.Position{ StartLine: 85, EndLine: 85, - StartPos: 2013, - EndPos: 2015, + StartPos: 2004, + EndPos: 2037, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 85, EndLine: 85, StartPos: 2013, EndPos: 2015, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2013, + EndPos: 2015, + }, + }, + Value: []byte("a"), }, }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 2019, - EndPos: 2021, - }, - VarName: &node.Identifier{ + Key: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 85, EndLine: 85, StartPos: 2019, EndPos: 2021, }, - Value: "k", }, - }, - Variable: &expr.List{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 2025, - EndPos: 2033, - }, - Items: []node.Node{ - &expr.ArrayItem{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 85, EndLine: 85, - StartPos: 2030, - EndPos: 2032, + StartPos: 2019, + EndPos: 2021, }, - Val: &expr.Variable{ + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2025, + EndPos: 2033, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 85, EndLine: 85, StartPos: 2030, EndPos: 2032, }, - VarName: &node.Identifier{ + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 85, EndLine: 85, StartPos: 2030, EndPos: 2032, }, - Value: "v", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2030, + EndPos: 2032, + }, + }, + Value: []byte("v"), }, }, }, }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 2035, - EndPos: 2037, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2035, + EndPos: 2037, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 2040, - EndPos: 2057, - }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ + &ast.StmtFunction{ + Node: ast.Node{ Position: &position.Position{ StartLine: 86, EndLine: 86, - StartPos: 2049, - EndPos: 2052, + StartPos: 2040, + EndPos: 2057, }, - Value: "foo", }, - Stmts: []node.Node{}, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 2049, + EndPos: 2052, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{}, }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 88, - EndLine: 92, - StartPos: 2061, - EndPos: 2132, - }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ + &ast.StmtFunction{ + Node: ast.Node{ Position: &position.Position{ StartLine: 88, - EndLine: 88, - StartPos: 2070, - EndPos: 2073, + EndLine: 92, + StartPos: 2061, + EndPos: 2132, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.Function{ + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ - StartLine: 89, - EndLine: 89, - StartPos: 2081, - EndPos: 2098, + StartLine: 88, + EndLine: 88, + StartPos: 2070, + EndPos: 2073, }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtFunction{ + Node: ast.Node{ Position: &position.Position{ StartLine: 89, EndLine: 89, - StartPos: 2090, - EndPos: 2093, + StartPos: 2081, + EndPos: 2098, }, - Value: "bar", }, - Stmts: []node.Node{}, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 89, + EndLine: 89, + StartPos: 2090, + EndPos: 2093, + }, + }, + Value: []byte("bar"), + }, + Stmts: []ast.Vertex{}, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 90, - EndLine: 90, - StartPos: 2102, - EndPos: 2114, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 90, EndLine: 90, - StartPos: 2108, - EndPos: 2111, + StartPos: 2102, + EndPos: 2114, }, - Value: "Baz", }, - Stmts: []node.Node{}, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 90, + EndLine: 90, + StartPos: 2108, + EndPos: 2111, + }, + }, + Value: []byte("Baz"), + }, + Stmts: []ast.Vertex{}, }, - &stmt.Return{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2118, - EndPos: 2128, - }, - Expr: &expr.Variable{ + &ast.StmtReturn{ + Node: ast.Node{ Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2125, - EndPos: 2127, + StartPos: 2118, + EndPos: 2128, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 91, EndLine: 91, StartPos: 2125, EndPos: 2127, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2125, + EndPos: 2127, + }, + }, + Value: []byte("a"), }, }, }, }, }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2138, - EndPos: 2183, - }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ + &ast.StmtFunction{ + Node: ast.Node{ Position: &position.Position{ StartLine: 94, EndLine: 94, - StartPos: 2147, - EndPos: 2150, + StartPos: 2138, + EndPos: 2183, }, - Value: "foo", }, - Params: []node.Node{ - &node.Parameter{ + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 94, EndLine: 94, - StartPos: 2151, - EndPos: 2159, + StartPos: 2147, + EndPos: 2150, }, - Variadic: false, - ByRef: false, - VariableType: &node.Identifier{ + }, + Value: []byte("foo"), + }, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 94, EndLine: 94, StartPos: 2151, - EndPos: 2156, - }, - Value: "array", - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2157, EndPos: 2159, }, - VarName: &node.Identifier{ + }, + Variadic: false, + ByRef: false, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2151, + EndPos: 2156, + }, + }, + Value: []byte("array"), + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 94, EndLine: 94, StartPos: 2157, EndPos: 2159, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2157, + EndPos: 2159, + }, + }, + Value: []byte("a"), }, }, }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2161, - EndPos: 2172, - }, - ByRef: false, - Variadic: false, - VariableType: &node.Identifier{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 94, EndLine: 94, StartPos: 2161, - EndPos: 2169, - }, - Value: "callable", - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2170, EndPos: 2172, }, - VarName: &node.Identifier{ + }, + ByRef: false, + Variadic: false, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2161, + EndPos: 2169, + }, + }, + Value: []byte("callable"), + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 94, EndLine: 94, StartPos: 2170, EndPos: 2172, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2170, + EndPos: 2172, + }, + }, + Value: []byte("b"), }, }, }, }, - Stmts: []node.Node{ - &stmt.Return{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2175, - EndPos: 2182, + Stmts: []ast.Vertex{ + &ast.StmtReturn{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2175, + EndPos: 2182, + }, }, }, }, }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2186, - EndPos: 2213, - }, - ReturnsRef: true, - PhpDocComment: "", - FunctionName: &node.Identifier{ + &ast.StmtFunction{ + Node: ast.Node{ Position: &position.Position{ StartLine: 95, EndLine: 95, - StartPos: 2196, - EndPos: 2199, + StartPos: 2186, + EndPos: 2213, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.Return{ + ReturnsRef: true, + FunctionName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 95, EndLine: 95, - StartPos: 2203, - EndPos: 2212, + StartPos: 2196, + EndPos: 2199, }, - Expr: &scalar.Lnumber{ + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtReturn{ + Node: ast.Node{ Position: &position.Position{ StartLine: 95, EndLine: 95, - StartPos: 2210, - EndPos: 2211, + StartPos: 2203, + EndPos: 2212, }, - Value: "1", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2210, + EndPos: 2211, + }, + }, + Value: []byte("1"), }, }, }, }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2216, - EndPos: 2234, - }, - ReturnsRef: true, - PhpDocComment: "", - FunctionName: &node.Identifier{ + &ast.StmtFunction{ + Node: ast.Node{ Position: &position.Position{ StartLine: 96, EndLine: 96, - StartPos: 2226, - EndPos: 2229, + StartPos: 2216, + EndPos: 2234, }, - Value: "foo", }, - Stmts: []node.Node{}, - }, - &stmt.Global{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2237, - EndPos: 2266, - }, - Vars: []node.Node{ - &expr.Variable{ + ReturnsRef: true, + FunctionName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2244, - EndPos: 2246, + StartLine: 96, + EndLine: 96, + StartPos: 2226, + EndPos: 2229, }, - VarName: &node.Identifier{ + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtGlobal{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2237, + EndPos: 2266, + }, + }, + Vars: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 97, EndLine: 97, StartPos: 2244, EndPos: 2246, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2244, + EndPos: 2246, + }, + }, + Value: []byte("a"), }, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2248, - EndPos: 2250, - }, - VarName: &node.Identifier{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 97, EndLine: 97, StartPos: 2248, EndPos: 2250, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2248, + EndPos: 2250, + }, + }, + Value: []byte("b"), }, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2252, - EndPos: 2255, - }, - VarName: &expr.Variable{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 97, EndLine: 97, - StartPos: 2253, + StartPos: 2252, EndPos: 2255, }, - VarName: &node.Identifier{ + }, + VarName: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 97, EndLine: 97, StartPos: 2253, EndPos: 2255, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2253, + EndPos: 2255, + }, + }, + Value: []byte("c"), }, }, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2257, - EndPos: 2265, - }, - VarName: &expr.FunctionCall{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 97, EndLine: 97, - StartPos: 2259, - EndPos: 2264, + StartPos: 2257, + EndPos: 2265, }, - Function: &name.Name{ + }, + VarName: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 97, EndLine: 97, StartPos: 2259, - EndPos: 2262, + EndPos: 2264, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2259, - EndPos: 2262, + }, + Function: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2259, + EndPos: 2262, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2259, + EndPos: 2262, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2262, - EndPos: 2264, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2262, + EndPos: 2264, + }, }, }, }, }, }, }, - &stmt.Label{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2269, - EndPos: 2271, - }, - LabelName: &node.Identifier{ + &ast.StmtLabel{ + Node: ast.Node{ Position: &position.Position{ StartLine: 98, EndLine: 98, StartPos: 2269, - EndPos: 2270, + EndPos: 2271, }, - Value: "a", + }, + LabelName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2269, + EndPos: 2270, + }, + }, + Value: []byte("a"), }, }, - &stmt.Goto{ - Position: &position.Position{ - StartLine: 99, - EndLine: 99, - StartPos: 2275, - EndPos: 2282, - }, - Label: &node.Identifier{ + &ast.StmtGoto{ + Node: ast.Node{ Position: &position.Position{ StartLine: 99, EndLine: 99, - StartPos: 2280, - EndPos: 2281, + StartPos: 2275, + EndPos: 2282, }, - Value: "a", + }, + Label: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 99, + EndLine: 99, + StartPos: 2280, + EndPos: 2281, + }, + }, + Value: []byte("a"), }, }, - &stmt.If{ - Position: &position.Position{ - StartLine: 100, - EndLine: 100, - StartPos: 2285, - EndPos: 2295, - }, - Cond: &expr.Variable{ + &ast.StmtIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 100, EndLine: 100, - StartPos: 2289, - EndPos: 2291, + StartPos: 2285, + EndPos: 2295, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 100, EndLine: 100, StartPos: 2289, EndPos: 2291, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 100, + EndLine: 100, + StartPos: 2289, + EndPos: 2291, + }, + }, + Value: []byte("a"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 100, - EndLine: 100, - StartPos: 2293, - EndPos: 2295, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 100, + EndLine: 100, + StartPos: 2293, + EndPos: 2295, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.If{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2298, - EndPos: 2323, - }, - Cond: &expr.Variable{ + &ast.StmtIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 101, EndLine: 101, - StartPos: 2302, - EndPos: 2304, + StartPos: 2298, + EndPos: 2323, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 101, EndLine: 101, StartPos: 2302, EndPos: 2304, }, - Value: "a", }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2306, - EndPos: 2308, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2309, - EndPos: 2323, - }, - Cond: &expr.Variable{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 101, EndLine: 101, - StartPos: 2317, - EndPos: 2319, + StartPos: 2302, + EndPos: 2304, }, - VarName: &node.Identifier{ + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2306, + EndPos: 2308, + }, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2309, + EndPos: 2323, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 101, EndLine: 101, StartPos: 2317, EndPos: 2319, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2317, + EndPos: 2319, + }, + }, + Value: []byte("b"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2321, - EndPos: 2323, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2321, + EndPos: 2323, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, }, }, - &stmt.If{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2326, - EndPos: 2344, - }, - Cond: &expr.Variable{ + &ast.StmtIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 102, EndLine: 102, - StartPos: 2330, - EndPos: 2332, + StartPos: 2326, + EndPos: 2344, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 102, EndLine: 102, StartPos: 2330, EndPos: 2332, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2330, + EndPos: 2332, + }, + }, + Value: []byte("a"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2334, - EndPos: 2336, - }, - Stmts: []node.Node{}, - }, - Else: &stmt.Else{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2337, - EndPos: 2344, - }, - Stmt: &stmt.StmtList{ + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ Position: &position.Position{ StartLine: 102, EndLine: 102, - StartPos: 2342, + StartPos: 2334, + EndPos: 2336, + }, + }, + Stmts: []ast.Vertex{}, + }, + Else: &ast.StmtElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2337, EndPos: 2344, }, - Stmts: []node.Node{}, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2342, + EndPos: 2344, + }, + }, + Stmts: []ast.Vertex{}, }, }, }, - &stmt.If{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2347, - EndPos: 2395, - }, - Cond: &expr.Variable{ + &ast.StmtIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 103, EndLine: 103, - StartPos: 2351, - EndPos: 2353, + StartPos: 2347, + EndPos: 2395, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 103, EndLine: 103, StartPos: 2351, EndPos: 2353, }, - Value: "a", }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2355, - EndPos: 2357, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2358, - EndPos: 2372, - }, - Cond: &expr.Variable{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 103, EndLine: 103, - StartPos: 2366, - EndPos: 2368, + StartPos: 2351, + EndPos: 2353, }, - VarName: &node.Identifier{ + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2355, + EndPos: 2357, + }, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2358, + EndPos: 2372, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 103, EndLine: 103, StartPos: 2366, EndPos: 2368, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2366, + EndPos: 2368, + }, + }, + Value: []byte("b"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2370, - EndPos: 2372, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2370, + EndPos: 2372, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.ElseIf{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2373, - EndPos: 2387, - }, - Cond: &expr.Variable{ + &ast.StmtElseIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 103, EndLine: 103, - StartPos: 2381, - EndPos: 2383, + StartPos: 2373, + EndPos: 2387, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 103, EndLine: 103, StartPos: 2381, EndPos: 2383, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2381, + EndPos: 2383, + }, + }, + Value: []byte("c"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2385, - EndPos: 2387, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2385, + EndPos: 2387, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, }, - Else: &stmt.Else{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2388, - EndPos: 2395, - }, - Stmt: &stmt.StmtList{ + Else: &ast.StmtElse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 103, EndLine: 103, - StartPos: 2393, + StartPos: 2388, EndPos: 2395, }, - Stmts: []node.Node{}, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2393, + EndPos: 2395, + }, + }, + Stmts: []ast.Vertex{}, }, }, }, - &stmt.If{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2398, - EndPos: 2447, - }, - Cond: &expr.Variable{ + &ast.StmtIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 104, EndLine: 104, - StartPos: 2402, - EndPos: 2404, + StartPos: 2398, + EndPos: 2447, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 104, EndLine: 104, StartPos: 2402, EndPos: 2404, }, - Value: "a", }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2406, - EndPos: 2408, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2409, - EndPos: 2423, - }, - Cond: &expr.Variable{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 104, EndLine: 104, - StartPos: 2417, - EndPos: 2419, + StartPos: 2402, + EndPos: 2404, }, - VarName: &node.Identifier{ + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2406, + EndPos: 2408, + }, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2409, + EndPos: 2423, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 104, EndLine: 104, StartPos: 2417, EndPos: 2419, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2417, + EndPos: 2419, + }, + }, + Value: []byte("b"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2421, - EndPos: 2423, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2421, + EndPos: 2423, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, }, - Else: &stmt.Else{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2424, - EndPos: 2447, - }, - Stmt: &stmt.If{ + Else: &ast.StmtElse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 104, EndLine: 104, - StartPos: 2429, + StartPos: 2424, EndPos: 2447, }, - Cond: &expr.Variable{ + }, + Stmt: &ast.StmtIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 104, EndLine: 104, - StartPos: 2433, - EndPos: 2435, + StartPos: 2429, + EndPos: 2447, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 104, EndLine: 104, StartPos: 2433, EndPos: 2435, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2433, + EndPos: 2435, + }, + }, + Value: []byte("c"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2437, - EndPos: 2439, - }, - Stmts: []node.Node{}, - }, - Else: &stmt.Else{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2440, - EndPos: 2447, - }, - Stmt: &stmt.StmtList{ + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ Position: &position.Position{ StartLine: 104, EndLine: 104, - StartPos: 2445, + StartPos: 2437, + EndPos: 2439, + }, + }, + Stmts: []ast.Vertex{}, + }, + Else: &ast.StmtElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2440, EndPos: 2447, }, - Stmts: []node.Node{}, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2445, + EndPos: 2447, + }, + }, + Stmts: []ast.Vertex{}, }, }, }, }, }, - &stmt.Nop{ - Position: &position.Position{ - StartLine: 105, - EndLine: 105, - StartPos: 2450, - EndPos: 2452, + &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2450, + EndPos: 2452, + }, }, }, - &stmt.InlineHtml{ - Position: &position.Position{ - StartLine: 105, - EndLine: 105, - StartPos: 2452, - EndPos: 2465, + &ast.StmtInlineHtml{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2452, + EndPos: 2465, + }, }, - Value: "
", + Value: []byte("
"), }, - &stmt.Interface{ - Position: &position.Position{ - StartLine: 106, - EndLine: 106, - StartPos: 2470, - EndPos: 2486, - }, - PhpDocComment: "", - InterfaceName: &node.Identifier{ + &ast.StmtInterface{ + Node: ast.Node{ Position: &position.Position{ StartLine: 106, EndLine: 106, - StartPos: 2480, - EndPos: 2483, + StartPos: 2470, + EndPos: 2486, }, - Value: "Foo", }, - Stmts: []node.Node{}, + InterfaceName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2480, + EndPos: 2483, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{}, }, - &stmt.Interface{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2489, - EndPos: 2517, - }, - PhpDocComment: "", - InterfaceName: &node.Identifier{ + &ast.StmtInterface{ + Node: ast.Node{ Position: &position.Position{ StartLine: 107, EndLine: 107, - StartPos: 2499, - EndPos: 2502, + StartPos: 2489, + EndPos: 2517, }, - Value: "Foo", }, - Extends: &stmt.InterfaceExtends{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2503, - EndPos: 2514, + InterfaceName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2499, + EndPos: 2502, + }, }, - InterfaceNames: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2511, - EndPos: 2514, + Value: []byte("Foo"), + }, + Extends: &ast.StmtInterfaceExtends{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2503, + EndPos: 2514, + }, + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2511, + EndPos: 2514, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2511, - EndPos: 2514, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2511, + EndPos: 2514, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Interface{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2520, - EndPos: 2553, - }, - PhpDocComment: "", - InterfaceName: &node.Identifier{ + &ast.StmtInterface{ + Node: ast.Node{ Position: &position.Position{ StartLine: 108, EndLine: 108, - StartPos: 2530, - EndPos: 2533, + StartPos: 2520, + EndPos: 2553, }, - Value: "Foo", }, - Extends: &stmt.InterfaceExtends{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2534, - EndPos: 2550, + InterfaceName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2530, + EndPos: 2533, + }, }, - InterfaceNames: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2542, - EndPos: 2545, + Value: []byte("Foo"), + }, + Extends: &ast.StmtInterfaceExtends{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2534, + EndPos: 2550, + }, + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2542, + EndPos: 2545, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2542, - EndPos: 2545, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2542, + EndPos: 2545, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, - &name.Name{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2547, - EndPos: 2550, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2547, + EndPos: 2550, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2547, - EndPos: 2550, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2547, + EndPos: 2550, + }, }, - Value: "Baz", + Value: []byte("Baz"), }, }, }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Namespace{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2556, - EndPos: 2570, - }, - NamespaceName: &name.Name{ + &ast.StmtNamespace{ + Node: ast.Node{ Position: &position.Position{ StartLine: 109, EndLine: 109, - StartPos: 2566, - EndPos: 2569, + StartPos: 2556, + EndPos: 2570, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2566, - EndPos: 2569, + }, + NamespaceName: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2566, + EndPos: 2569, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2566, + EndPos: 2569, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, - &stmt.Namespace{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2573, - EndPos: 2593, - }, - NamespaceName: &name.Name{ + &ast.StmtNamespace{ + Node: ast.Node{ Position: &position.Position{ StartLine: 110, EndLine: 110, - StartPos: 2583, - EndPos: 2590, + StartPos: 2573, + EndPos: 2593, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2583, - EndPos: 2586, - }, - Value: "Foo", + }, + NamespaceName: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2583, + EndPos: 2590, }, - &name.NamePart{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2587, - EndPos: 2590, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2583, + EndPos: 2586, + }, }, - Value: "Bar", + Value: []byte("Foo"), + }, + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2587, + EndPos: 2590, + }, + }, + Value: []byte("Bar"), }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Namespace{ - Position: &position.Position{ - StartLine: 111, - EndLine: 111, - StartPos: 2596, - EndPos: 2608, + &ast.StmtNamespace{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2596, + EndPos: 2608, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2611, - EndPos: 2630, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 112, EndLine: 112, - StartPos: 2617, - EndPos: 2620, + StartPos: 2611, + EndPos: 2630, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.PropertyList{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 112, EndLine: 112, - StartPos: 2622, - EndPos: 2629, + StartPos: 2617, + EndPos: 2620, }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2622, - EndPos: 2625, - }, - Value: "var", + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtPropertyList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 112, + EndLine: 112, + StartPos: 2622, + EndPos: 2629, }, }, - Properties: []node.Node{ - &stmt.Property{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2626, - EndPos: 2628, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 112, + EndLine: 112, + StartPos: 2622, + EndPos: 2625, + }, }, - PhpDocComment: "", - Variable: &expr.Variable{ + Value: []byte("var"), + }, + }, + Properties: []ast.Vertex{ + &ast.StmtProperty{ + Node: ast.Node{ Position: &position.Position{ StartLine: 112, EndLine: 112, StartPos: 2626, EndPos: 2628, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 112, EndLine: 112, StartPos: 2626, EndPos: 2628, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 112, + EndLine: 112, + StartPos: 2626, + EndPos: 2628, + }, + }, + Value: []byte("a"), }, }, }, @@ -5669,221 +6797,263 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2633, - EndPos: 2670, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 113, EndLine: 113, - StartPos: 2639, - EndPos: 2642, + StartPos: 2633, + EndPos: 2670, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.PropertyList{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 113, EndLine: 113, - StartPos: 2644, - EndPos: 2669, + StartPos: 2639, + EndPos: 2642, }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2644, - EndPos: 2650, - }, - Value: "public", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2651, - EndPos: 2657, - }, - Value: "static", + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtPropertyList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2644, + EndPos: 2669, }, }, - Properties: []node.Node{ - &stmt.Property{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2658, - EndPos: 2660, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2644, + EndPos: 2650, + }, }, - PhpDocComment: "", - Variable: &expr.Variable{ + Value: []byte("public"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2651, + EndPos: 2657, + }, + }, + Value: []byte("static"), + }, + }, + Properties: []ast.Vertex{ + &ast.StmtProperty{ + Node: ast.Node{ Position: &position.Position{ StartLine: 113, EndLine: 113, StartPos: 2658, EndPos: 2660, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 113, EndLine: 113, StartPos: 2658, EndPos: 2660, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2658, + EndPos: 2660, + }, + }, + Value: []byte("a"), }, }, }, - &stmt.Property{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2662, - EndPos: 2668, - }, - PhpDocComment: "", - Variable: &expr.Variable{ + &ast.StmtProperty{ + Node: ast.Node{ Position: &position.Position{ StartLine: 113, EndLine: 113, StartPos: 2662, - EndPos: 2664, + EndPos: 2668, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 113, EndLine: 113, StartPos: 2662, EndPos: 2664, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2662, + EndPos: 2664, + }, + }, + Value: []byte("b"), }, }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2667, - EndPos: 2668, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2667, + EndPos: 2668, + }, }, - Value: "1", + Value: []byte("1"), }, }, }, }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2673, - EndPos: 2710, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 114, EndLine: 114, - StartPos: 2679, - EndPos: 2682, + StartPos: 2673, + EndPos: 2710, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.PropertyList{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 114, EndLine: 114, - StartPos: 2684, - EndPos: 2709, + StartPos: 2679, + EndPos: 2682, }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2684, - EndPos: 2690, - }, - Value: "public", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2691, - EndPos: 2697, - }, - Value: "static", + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtPropertyList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2684, + EndPos: 2709, }, }, - Properties: []node.Node{ - &stmt.Property{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2698, - EndPos: 2704, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2684, + EndPos: 2690, + }, }, - PhpDocComment: "", - Variable: &expr.Variable{ + Value: []byte("public"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2691, + EndPos: 2697, + }, + }, + Value: []byte("static"), + }, + }, + Properties: []ast.Vertex{ + &ast.StmtProperty{ + Node: ast.Node{ Position: &position.Position{ StartLine: 114, EndLine: 114, StartPos: 2698, - EndPos: 2700, + EndPos: 2704, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 114, EndLine: 114, StartPos: 2698, EndPos: 2700, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2698, + EndPos: 2700, + }, + }, + Value: []byte("a"), }, }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2703, - EndPos: 2704, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2703, + EndPos: 2704, + }, }, - Value: "1", + Value: []byte("1"), }, }, - &stmt.Property{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2706, - EndPos: 2708, - }, - PhpDocComment: "", - Variable: &expr.Variable{ + &ast.StmtProperty{ + Node: ast.Node{ Position: &position.Position{ StartLine: 114, EndLine: 114, StartPos: 2706, EndPos: 2708, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 114, EndLine: 114, StartPos: 2706, EndPos: 2708, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2706, + EndPos: 2708, + }, + }, + Value: []byte("b"), }, }, }, @@ -5891,353 +7061,433 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2713, - EndPos: 2731, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2713, + EndPos: 2731, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2720, - EndPos: 2722, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 115, EndLine: 115, StartPos: 2720, EndPos: 2722, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 115, EndLine: 115, StartPos: 2720, EndPos: 2722, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2720, + EndPos: 2722, + }, + }, + Value: []byte("a"), }, }, }, - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2724, - EndPos: 2730, - }, - Variable: &expr.Variable{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 115, EndLine: 115, StartPos: 2724, - EndPos: 2726, + EndPos: 2730, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 115, EndLine: 115, StartPos: 2724, EndPos: 2726, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2724, + EndPos: 2726, + }, + }, + Value: []byte("b"), }, }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2729, - EndPos: 2730, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2729, + EndPos: 2730, + }, }, - Value: "1", + Value: []byte("1"), }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2734, - EndPos: 2752, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2734, + EndPos: 2752, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2741, - EndPos: 2747, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 116, EndLine: 116, StartPos: 2741, - EndPos: 2743, + EndPos: 2747, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 116, EndLine: 116, StartPos: 2741, EndPos: 2743, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2741, + EndPos: 2743, + }, + }, + Value: []byte("a"), }, }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2746, - EndPos: 2747, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2746, + EndPos: 2747, + }, }, - Value: "1", + Value: []byte("1"), }, }, - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2749, - EndPos: 2751, - }, - Variable: &expr.Variable{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 116, EndLine: 116, StartPos: 2749, EndPos: 2751, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 116, EndLine: 116, StartPos: 2749, EndPos: 2751, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2749, + EndPos: 2751, + }, + }, + Value: []byte("b"), }, }, }, }, }, - &stmt.AltSwitch{ - Position: &position.Position{ - StartLine: 118, - EndLine: 122, - StartPos: 2756, - EndPos: 2815, - }, - Cond: &scalar.Lnumber{ + &ast.StmtAltSwitch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2764, - EndPos: 2765, + EndLine: 122, + StartPos: 2756, + EndPos: 2815, }, - Value: "1", }, - CaseList: &stmt.CaseList{ - Position: &position.Position{ - StartLine: 119, - EndLine: -1, - StartPos: 2772, - EndPos: -1, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2764, + EndPos: 2765, + }, }, - Cases: []node.Node{ - &stmt.Case{ - Position: &position.Position{ - StartLine: 119, - EndLine: -1, - StartPos: 2772, - EndPos: -1, - }, - Cond: &scalar.Lnumber{ + Value: []byte("1"), + }, + CaseList: &ast.StmtCaseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: -1, + StartPos: 2772, + EndPos: -1, + }, + }, + Cases: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2777, - EndPos: 2778, + EndLine: -1, + StartPos: 2772, + EndPos: -1, }, - Value: "1", }, - Stmts: []node.Node{}, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2777, + EndPos: 2778, + }, + }, + Value: []byte("1"), + }, + Stmts: []ast.Vertex{}, }, - &stmt.Default{ - Position: &position.Position{ - StartLine: 120, - EndLine: -1, - StartPos: 2783, - EndPos: -1, + &ast.StmtDefault{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: -1, + StartPos: 2783, + EndPos: -1, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Case{ - Position: &position.Position{ - StartLine: 121, - EndLine: -1, - StartPos: 2795, - EndPos: -1, - }, - Cond: &scalar.Lnumber{ + &ast.StmtCase{ + Node: ast.Node{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2800, - EndPos: 2801, + EndLine: -1, + StartPos: 2795, + EndPos: -1, }, - Value: "2", }, - Stmts: []node.Node{}, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 121, + EndLine: 121, + StartPos: 2800, + EndPos: 2801, + }, + }, + Value: []byte("2"), + }, + Stmts: []ast.Vertex{}, }, }, }, }, - &stmt.AltSwitch{ - Position: &position.Position{ - StartLine: 124, - EndLine: 127, - StartPos: 2819, - EndPos: 2867, - }, - Cond: &scalar.Lnumber{ + &ast.StmtAltSwitch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 124, - EndLine: 124, - StartPos: 2827, - EndPos: 2828, + EndLine: 127, + StartPos: 2819, + EndPos: 2867, }, - Value: "1", }, - CaseList: &stmt.CaseList{ - Position: &position.Position{ - StartLine: 125, - EndLine: -1, - StartPos: 2836, - EndPos: -1, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 124, + EndLine: 124, + StartPos: 2827, + EndPos: 2828, + }, }, - Cases: []node.Node{ - &stmt.Case{ - Position: &position.Position{ - StartLine: 125, - EndLine: -1, - StartPos: 2836, - EndPos: -1, - }, - Cond: &scalar.Lnumber{ + Value: []byte("1"), + }, + CaseList: &ast.StmtCaseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 125, + EndLine: -1, + StartPos: 2836, + EndPos: -1, + }, + }, + Cases: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ Position: &position.Position{ StartLine: 125, - EndLine: 125, - StartPos: 2841, - EndPos: 2842, + EndLine: -1, + StartPos: 2836, + EndPos: -1, }, - Value: "1", }, - Stmts: []node.Node{}, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 125, + EndLine: 125, + StartPos: 2841, + EndPos: 2842, + }, + }, + Value: []byte("1"), + }, + Stmts: []ast.Vertex{}, }, - &stmt.Case{ - Position: &position.Position{ - StartLine: 126, - EndLine: -1, - StartPos: 2847, - EndPos: -1, - }, - Cond: &scalar.Lnumber{ + &ast.StmtCase{ + Node: ast.Node{ Position: &position.Position{ StartLine: 126, - EndLine: 126, - StartPos: 2852, - EndPos: 2853, + EndLine: -1, + StartPos: 2847, + EndPos: -1, }, - Value: "2", }, - Stmts: []node.Node{}, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 126, + EndLine: 126, + StartPos: 2852, + EndPos: 2853, + }, + }, + Value: []byte("2"), + }, + Stmts: []ast.Vertex{}, }, }, }, }, - &stmt.Switch{ - Position: &position.Position{ - StartLine: 129, - EndLine: 132, - StartPos: 2873, - EndPos: 2925, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 129, - EndLine: 129, - StartPos: 2881, - EndPos: 2882, - }, - Value: "1", - }, - CaseList: &stmt.CaseList{ + &ast.StmtSwitch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 129, EndLine: 132, - StartPos: 2884, + StartPos: 2873, EndPos: 2925, }, - Cases: []node.Node{ - &stmt.Case{ - Position: &position.Position{ - StartLine: 130, - EndLine: 130, - StartPos: 2889, - EndPos: 2903, - }, - Cond: &scalar.Lnumber{ + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 129, + EndLine: 129, + StartPos: 2881, + EndPos: 2882, + }, + }, + Value: []byte("1"), + }, + CaseList: &ast.StmtCaseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 129, + EndLine: 132, + StartPos: 2884, + EndPos: 2925, + }, + }, + Cases: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ Position: &position.Position{ StartLine: 130, EndLine: 130, - StartPos: 2894, - EndPos: 2895, + StartPos: 2889, + EndPos: 2903, }, - Value: "1", }, - Stmts: []node.Node{ - &stmt.Break{ + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 130, EndLine: 130, - StartPos: 2897, - EndPos: 2903, + StartPos: 2894, + EndPos: 2895, + }, + }, + Value: []byte("1"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 130, + EndLine: 130, + StartPos: 2897, + EndPos: 2903, + }, }, }, }, }, - &stmt.Case{ - Position: &position.Position{ - StartLine: 131, - EndLine: 131, - StartPos: 2907, - EndPos: 2921, - }, - Cond: &scalar.Lnumber{ + &ast.StmtCase{ + Node: ast.Node{ Position: &position.Position{ StartLine: 131, EndLine: 131, - StartPos: 2912, - EndPos: 2913, + StartPos: 2907, + EndPos: 2921, }, - Value: "2", }, - Stmts: []node.Node{ - &stmt.Break{ + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 131, EndLine: 131, - StartPos: 2915, - EndPos: 2921, + StartPos: 2912, + EndPos: 2913, + }, + }, + Value: []byte("2"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 131, + EndLine: 131, + StartPos: 2915, + EndPos: 2921, + }, }, }, }, @@ -6245,80 +7495,98 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Switch{ - Position: &position.Position{ - StartLine: 134, - EndLine: 137, - StartPos: 2931, - EndPos: 2984, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 134, - EndLine: 134, - StartPos: 2939, - EndPos: 2940, - }, - Value: "1", - }, - CaseList: &stmt.CaseList{ + &ast.StmtSwitch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 134, EndLine: 137, - StartPos: 2942, + StartPos: 2931, EndPos: 2984, }, - Cases: []node.Node{ - &stmt.Case{ - Position: &position.Position{ - StartLine: 135, - EndLine: 135, - StartPos: 2948, - EndPos: 2962, - }, - Cond: &scalar.Lnumber{ + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 134, + EndLine: 134, + StartPos: 2939, + EndPos: 2940, + }, + }, + Value: []byte("1"), + }, + CaseList: &ast.StmtCaseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 134, + EndLine: 137, + StartPos: 2942, + EndPos: 2984, + }, + }, + Cases: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ Position: &position.Position{ StartLine: 135, EndLine: 135, - StartPos: 2953, - EndPos: 2954, + StartPos: 2948, + EndPos: 2962, }, - Value: "1", }, - Stmts: []node.Node{ - &stmt.Break{ + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 135, EndLine: 135, - StartPos: 2956, - EndPos: 2962, + StartPos: 2953, + EndPos: 2954, + }, + }, + Value: []byte("1"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 135, + EndLine: 135, + StartPos: 2956, + EndPos: 2962, + }, }, }, }, }, - &stmt.Case{ - Position: &position.Position{ - StartLine: 136, - EndLine: 136, - StartPos: 2966, - EndPos: 2980, - }, - Cond: &scalar.Lnumber{ + &ast.StmtCase{ + Node: ast.Node{ Position: &position.Position{ StartLine: 136, EndLine: 136, - StartPos: 2971, - EndPos: 2972, + StartPos: 2966, + EndPos: 2980, }, - Value: "2", }, - Stmts: []node.Node{ - &stmt.Break{ + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 136, EndLine: 136, - StartPos: 2974, - EndPos: 2980, + StartPos: 2971, + EndPos: 2972, + }, + }, + Value: []byte("2"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 136, + EndLine: 136, + StartPos: 2974, + EndPos: 2980, + }, }, }, }, @@ -6326,288 +7594,346 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Throw{ - Position: &position.Position{ - StartLine: 138, - EndLine: 138, - StartPos: 2987, - EndPos: 2996, - }, - Expr: &expr.Variable{ + &ast.StmtThrow{ + Node: ast.Node{ Position: &position.Position{ StartLine: 138, EndLine: 138, - StartPos: 2993, - EndPos: 2995, + StartPos: 2987, + EndPos: 2996, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 138, EndLine: 138, StartPos: 2993, EndPos: 2995, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 138, + EndLine: 138, + StartPos: 2993, + EndPos: 2995, + }, + }, + Value: []byte("e"), }, }, }, - &stmt.Trait{ - Position: &position.Position{ - StartLine: 139, - EndLine: 139, - StartPos: 2999, - EndPos: 3011, - }, - PhpDocComment: "", - TraitName: &node.Identifier{ + &ast.StmtTrait{ + Node: ast.Node{ Position: &position.Position{ StartLine: 139, EndLine: 139, - StartPos: 3005, - EndPos: 3008, + StartPos: 2999, + EndPos: 3011, }, - Value: "Foo", }, - Stmts: []node.Node{}, + TraitName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 139, + EndLine: 139, + StartPos: 3005, + EndPos: 3008, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{}, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 3014, - EndPos: 3036, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 140, EndLine: 140, - StartPos: 3020, - EndPos: 3023, + StartPos: 3014, + EndPos: 3036, }, - Value: "Foo", }, - Stmts: []node.Node{ - &stmt.TraitUse{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 140, EndLine: 140, - StartPos: 3026, - EndPos: 3034, + StartPos: 3020, + EndPos: 3023, }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 3030, - EndPos: 3033, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 3030, - EndPos: 3033, - }, - Value: "Bar", - }, - }, - }, - }, - TraitAdaptationList: &stmt.Nop{ + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 140, EndLine: 140, - StartPos: 3033, + StartPos: 3026, EndPos: 3034, }, }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3030, + EndPos: 3033, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3030, + EndPos: 3033, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3033, + EndPos: 3034, + }, + }, + }, }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 3039, - EndPos: 3068, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 141, EndLine: 141, - StartPos: 3045, - EndPos: 3048, + StartPos: 3039, + EndPos: 3068, }, - Value: "Foo", }, - Stmts: []node.Node{ - &stmt.TraitUse{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 141, EndLine: 141, - StartPos: 3051, - EndPos: 3066, + StartPos: 3045, + EndPos: 3048, }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 3055, - EndPos: 3058, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 3055, - EndPos: 3058, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 3060, - EndPos: 3063, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 3060, - EndPos: 3063, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 141, EndLine: 141, - StartPos: 3064, + StartPos: 3051, EndPos: 3066, }, }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 141, + EndLine: 141, + StartPos: 3055, + EndPos: 3058, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 141, + EndLine: 141, + StartPos: 3055, + EndPos: 3058, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 141, + EndLine: 141, + StartPos: 3060, + EndPos: 3063, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 141, + EndLine: 141, + StartPos: 3060, + EndPos: 3063, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 141, + EndLine: 141, + StartPos: 3064, + EndPos: 3066, + }, + }, + }, }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 3071, - EndPos: 3116, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 142, EndLine: 142, - StartPos: 3077, - EndPos: 3080, + StartPos: 3071, + EndPos: 3116, }, - Value: "Foo", }, - Stmts: []node.Node{ - &stmt.TraitUse{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 142, EndLine: 142, - StartPos: 3083, - EndPos: 3114, + StartPos: 3077, + EndPos: 3080, }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 3087, - EndPos: 3090, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 3087, - EndPos: 3090, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 3092, - EndPos: 3095, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 3092, - EndPos: 3095, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 142, EndLine: 142, - StartPos: 3096, + StartPos: 3083, EndPos: 3114, }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ Position: &position.Position{ StartLine: 142, EndLine: 142, - StartPos: 3098, - EndPos: 3111, + StartPos: 3087, + EndPos: 3090, }, - Ref: &stmt.TraitMethodRef{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3087, + EndPos: 3090, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3092, + EndPos: 3095, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3092, + EndPos: 3095, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3096, + EndPos: 3114, + }, + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Node: ast.Node{ Position: &position.Position{ StartLine: 142, EndLine: 142, StartPos: 3098, - EndPos: 3101, + EndPos: 3111, }, - Method: &node.Identifier{ + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ Position: &position.Position{ StartLine: 142, EndLine: 142, StartPos: 3098, EndPos: 3101, }, - Value: "one", + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3098, + EndPos: 3101, + }, + }, + Value: []byte("one"), }, }, - Modifier: &node.Identifier{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 3105, - EndPos: 3111, + Modifier: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3105, + EndPos: 3111, + }, }, - Value: "public", + Value: []byte("public"), }, }, }, @@ -6615,120 +7941,145 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3119, - EndPos: 3168, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 143, EndLine: 143, - StartPos: 3125, - EndPos: 3128, + StartPos: 3119, + EndPos: 3168, }, - Value: "Foo", }, - Stmts: []node.Node{ - &stmt.TraitUse{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 143, EndLine: 143, - StartPos: 3131, - EndPos: 3166, + StartPos: 3125, + EndPos: 3128, }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3135, - EndPos: 3138, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3135, - EndPos: 3138, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3140, - EndPos: 3143, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3140, - EndPos: 3143, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 143, EndLine: 143, - StartPos: 3144, + StartPos: 3131, EndPos: 3166, }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ Position: &position.Position{ StartLine: 143, EndLine: 143, - StartPos: 3146, - EndPos: 3163, + StartPos: 3135, + EndPos: 3138, }, - Ref: &stmt.TraitMethodRef{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3135, + EndPos: 3138, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3140, + EndPos: 3143, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3140, + EndPos: 3143, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3144, + EndPos: 3166, + }, + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Node: ast.Node{ Position: &position.Position{ StartLine: 143, EndLine: 143, StartPos: 3146, - EndPos: 3149, + EndPos: 3163, }, - Method: &node.Identifier{ + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ Position: &position.Position{ StartLine: 143, EndLine: 143, StartPos: 3146, EndPos: 3149, }, - Value: "one", + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3146, + EndPos: 3149, + }, + }, + Value: []byte("one"), }, }, - Modifier: &node.Identifier{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3153, - EndPos: 3159, + Modifier: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3153, + EndPos: 3159, + }, }, - Value: "public", + Value: []byte("public"), }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3160, - EndPos: 3163, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3160, + EndPos: 3163, + }, }, - Value: "two", + Value: []byte("two"), }, }, }, @@ -6736,214 +8087,259 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3171, - EndPos: 3248, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, - StartPos: 3177, - EndPos: 3180, + StartPos: 3171, + EndPos: 3248, }, - Value: "Foo", }, - Stmts: []node.Node{ - &stmt.TraitUse{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, - StartPos: 3183, - EndPos: 3246, + StartPos: 3177, + EndPos: 3180, }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3187, - EndPos: 3190, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3187, - EndPos: 3190, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3192, - EndPos: 3195, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3192, - EndPos: 3195, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, - StartPos: 3196, + StartPos: 3183, EndPos: 3246, }, - Adaptations: []node.Node{ - &stmt.TraitUsePrecedence{ + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, - StartPos: 3198, - EndPos: 3226, + StartPos: 3187, + EndPos: 3190, }, - Ref: &stmt.TraitMethodRef{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3187, + EndPos: 3190, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3192, + EndPos: 3195, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3192, + EndPos: 3195, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3196, + EndPos: 3246, + }, + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUsePrecedence{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, StartPos: 3198, - EndPos: 3206, + EndPos: 3226, }, - Trait: &name.Name{ + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, StartPos: 3198, - EndPos: 3201, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3198, - EndPos: 3201, - }, - Value: "Bar", - }, - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3203, EndPos: 3206, }, - Value: "one", }, - }, - Insteadof: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3217, - EndPos: 3220, + Trait: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3198, + EndPos: 3201, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3217, - EndPos: 3220, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3198, + EndPos: 3201, + }, }, - Value: "Baz", + Value: []byte("Bar"), }, }, }, - &name.Name{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3222, - EndPos: 3226, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3203, + EndPos: 3206, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3222, - EndPos: 3226, + Value: []byte("one"), + }, + }, + Insteadof: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3217, + EndPos: 3220, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3217, + EndPos: 3220, + }, }, - Value: "Quux", + Value: []byte("Baz"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3222, + EndPos: 3226, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3222, + EndPos: 3226, + }, + }, + Value: []byte("Quux"), }, }, }, }, }, - &stmt.TraitUseAlias{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3228, - EndPos: 3243, - }, - Ref: &stmt.TraitMethodRef{ + &ast.StmtTraitUseAlias{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, StartPos: 3228, - EndPos: 3236, + EndPos: 3243, }, - Trait: &name.Name{ + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, StartPos: 3228, - EndPos: 3231, + EndPos: 3236, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3228, - EndPos: 3231, + }, + Trait: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3228, + EndPos: 3231, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3228, + EndPos: 3231, + }, }, - Value: "Baz", + Value: []byte("Baz"), }, }, }, - Method: &node.Identifier{ + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3233, + EndPos: 3236, + }, + }, + Value: []byte("one"), + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, - StartPos: 3233, - EndPos: 3236, + StartPos: 3240, + EndPos: 3243, }, - Value: "one", }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3240, - EndPos: 3243, - }, - Value: "two", + Value: []byte("two"), }, }, }, @@ -6951,1311 +8347,1599 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 146, - EndLine: -1, - StartPos: 3252, - EndPos: -1, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 146, + EndLine: -1, + StartPos: 3252, + EndPos: -1, + }, }, - Stmts: []node.Node{}, - Catches: []node.Node{}, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{}, }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3261, - EndPos: 3291, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3261, + EndPos: 3291, + }, }, - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3268, - EndPos: 3291, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3268, + EndPos: 3291, + }, }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3275, - EndPos: 3284, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3275, + EndPos: 3284, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3275, - EndPos: 3284, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3275, + EndPos: 3284, + }, }, - Value: "Exception", + Value: []byte("Exception"), }, }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3285, - EndPos: 3287, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 147, EndLine: 147, StartPos: 3285, EndPos: 3287, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3285, + EndPos: 3287, + }, + }, + Value: []byte("e"), }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3294, - EndPos: 3355, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3294, + EndPos: 3355, + }, }, - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3301, - EndPos: 3324, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3301, + EndPos: 3324, + }, }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3308, - EndPos: 3317, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3308, + EndPos: 3317, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3308, - EndPos: 3317, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3308, + EndPos: 3317, + }, }, - Value: "Exception", + Value: []byte("Exception"), }, }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3318, - EndPos: 3320, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 148, EndLine: 148, StartPos: 3318, EndPos: 3320, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3318, + EndPos: 3320, + }, + }, + Value: []byte("e"), }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Catch{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3325, - EndPos: 3355, + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3325, + EndPos: 3355, + }, }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3332, - EndPos: 3348, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3332, + EndPos: 3348, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3332, - EndPos: 3348, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3332, + EndPos: 3348, + }, }, - Value: "RuntimeException", + Value: []byte("RuntimeException"), }, }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3349, - EndPos: 3351, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 148, EndLine: 148, StartPos: 3349, EndPos: 3351, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3349, + EndPos: 3351, + }, + }, + Value: []byte("e"), }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3358, - EndPos: 3462, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3358, + EndPos: 3462, + }, }, - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3365, - EndPos: 3388, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3365, + EndPos: 3388, + }, }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3372, - EndPos: 3381, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3372, + EndPos: 3381, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3372, - EndPos: 3381, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3372, + EndPos: 3381, + }, }, - Value: "Exception", + Value: []byte("Exception"), }, }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3382, - EndPos: 3384, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 149, EndLine: 149, StartPos: 3382, EndPos: 3384, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3382, + EndPos: 3384, + }, + }, + Value: []byte("e"), }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Catch{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3389, - EndPos: 3420, + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3389, + EndPos: 3420, + }, }, - Types: []node.Node{ - &name.FullyQualified{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3396, - EndPos: 3413, + Types: []ast.Vertex{ + &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3396, + EndPos: 3413, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3397, - EndPos: 3413, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3397, + EndPos: 3413, + }, }, - Value: "RuntimeException", + Value: []byte("RuntimeException"), }, }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3414, - EndPos: 3416, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 149, EndLine: 149, StartPos: 3414, EndPos: 3416, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3414, + EndPos: 3416, + }, + }, + Value: []byte("e"), }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Catch{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3421, - EndPos: 3462, + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3421, + EndPos: 3462, + }, }, - Types: []node.Node{ - &name.Relative{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3428, - EndPos: 3455, + Types: []ast.Vertex{ + &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3428, + EndPos: 3455, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3438, - EndPos: 3455, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3438, + EndPos: 3455, + }, }, - Value: "AdditionException", + Value: []byte("AdditionException"), }, }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3456, - EndPos: 3458, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 149, EndLine: 149, StartPos: 3456, EndPos: 3458, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3456, + EndPos: 3458, + }, + }, + Value: []byte("e"), }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3465, - EndPos: 3506, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3465, + EndPos: 3506, + }, }, - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3472, - EndPos: 3495, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3472, + EndPos: 3495, + }, }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3479, - EndPos: 3488, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3479, + EndPos: 3488, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3479, - EndPos: 3488, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3479, + EndPos: 3488, + }, }, - Value: "Exception", + Value: []byte("Exception"), }, }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3489, - EndPos: 3491, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 150, EndLine: 150, StartPos: 3489, EndPos: 3491, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3489, + EndPos: 3491, + }, + }, + Value: []byte("e"), }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - Finally: &stmt.Finally{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3496, - EndPos: 3506, + Finally: &ast.StmtFinally{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3496, + EndPos: 3506, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Unset{ - Position: &position.Position{ - StartLine: 152, - EndLine: 152, - StartPos: 3510, - EndPos: 3524, + &ast.StmtUnset{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3510, + EndPos: 3524, + }, }, - Vars: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 152, - EndLine: 152, - StartPos: 3516, - EndPos: 3518, - }, - VarName: &node.Identifier{ + Vars: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 152, EndLine: 152, StartPos: 3516, EndPos: 3518, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3516, + EndPos: 3518, + }, + }, + Value: []byte("a"), }, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 152, - EndLine: 152, - StartPos: 3520, - EndPos: 3522, - }, - VarName: &node.Identifier{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 152, EndLine: 152, StartPos: 3520, EndPos: 3522, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3520, + EndPos: 3522, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3528, - EndPos: 3536, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3528, + EndPos: 3536, + }, }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3532, - EndPos: 3535, - }, - Use: &name.Name{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 154, EndLine: 154, StartPos: 3532, EndPos: 3535, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3532, - EndPos: 3535, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3532, + EndPos: 3535, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3532, + EndPos: 3535, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3539, - EndPos: 3548, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3539, + EndPos: 3548, + }, }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3544, - EndPos: 3547, - }, - Use: &name.Name{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 155, EndLine: 155, StartPos: 3544, EndPos: 3547, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3544, - EndPos: 3547, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3544, + EndPos: 3547, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3544, + EndPos: 3547, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3551, - EndPos: 3567, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3551, + EndPos: 3567, + }, }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3556, - EndPos: 3566, - }, - Use: &name.Name{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 156, EndLine: 156, StartPos: 3556, - EndPos: 3559, + EndPos: 3566, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3556, - EndPos: 3559, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3556, + EndPos: 3559, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3556, + EndPos: 3559, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3563, - EndPos: 3566, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3563, + EndPos: 3566, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3570, - EndPos: 3583, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3570, + EndPos: 3583, + }, }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3574, - EndPos: 3577, - }, - Use: &name.Name{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 157, EndLine: 157, StartPos: 3574, EndPos: 3577, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3574, - EndPos: 3577, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3574, + EndPos: 3577, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3574, + EndPos: 3577, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3579, - EndPos: 3582, - }, - Use: &name.Name{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 157, EndLine: 157, StartPos: 3579, EndPos: 3582, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3579, - EndPos: 3582, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3579, + EndPos: 3582, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3579, + EndPos: 3582, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3586, - EndPos: 3606, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3586, + EndPos: 3606, + }, }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3590, - EndPos: 3593, - }, - Use: &name.Name{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 158, EndLine: 158, StartPos: 3590, EndPos: 3593, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3590, - EndPos: 3593, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3590, + EndPos: 3593, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3590, + EndPos: 3593, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3595, - EndPos: 3605, - }, - Use: &name.Name{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 158, EndLine: 158, StartPos: 3595, - EndPos: 3598, + EndPos: 3605, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3595, - EndPos: 3598, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3595, + EndPos: 3598, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3595, + EndPos: 3598, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3602, - EndPos: 3605, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3602, + EndPos: 3605, + }, }, - Value: "Baz", + Value: []byte("Baz"), }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3609, - EndPos: 3632, - }, - UseType: &node.Identifier{ + &ast.StmtUseList{ + Node: ast.Node{ Position: &position.Position{ StartLine: 159, EndLine: 159, - StartPos: 3613, - EndPos: 3621, + StartPos: 3609, + EndPos: 3632, }, - Value: "function", }, - Uses: []node.Node{ - &stmt.Use{ + UseType: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 159, EndLine: 159, - StartPos: 3622, - EndPos: 3625, + StartPos: 3613, + EndPos: 3621, }, - Use: &name.Name{ + }, + Value: []byte("function"), + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 159, EndLine: 159, StartPos: 3622, EndPos: 3625, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3622, - EndPos: 3625, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3622, + EndPos: 3625, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3622, + EndPos: 3625, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3628, - EndPos: 3631, - }, - Use: &name.Name{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 159, EndLine: 159, StartPos: 3628, EndPos: 3631, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3628, - EndPos: 3631, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3628, + EndPos: 3631, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3628, + EndPos: 3631, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3635, - EndPos: 3672, - }, - UseType: &node.Identifier{ + &ast.StmtUseList{ + Node: ast.Node{ Position: &position.Position{ StartLine: 160, EndLine: 160, - StartPos: 3639, - EndPos: 3647, + StartPos: 3635, + EndPos: 3672, }, - Value: "function", }, - Uses: []node.Node{ - &stmt.Use{ + UseType: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 160, EndLine: 160, - StartPos: 3648, - EndPos: 3658, + StartPos: 3639, + EndPos: 3647, }, - Use: &name.Name{ + }, + Value: []byte("function"), + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 160, EndLine: 160, StartPos: 3648, - EndPos: 3651, + EndPos: 3658, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3648, - EndPos: 3651, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3648, + EndPos: 3651, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3648, + EndPos: 3651, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3655, - EndPos: 3658, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3655, + EndPos: 3658, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3661, - EndPos: 3671, - }, - Use: &name.Name{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 160, EndLine: 160, StartPos: 3661, - EndPos: 3664, + EndPos: 3671, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3661, - EndPos: 3664, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3661, + EndPos: 3664, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3661, + EndPos: 3664, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3668, - EndPos: 3671, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3668, + EndPos: 3671, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3675, - EndPos: 3695, - }, - UseType: &node.Identifier{ + &ast.StmtUseList{ + Node: ast.Node{ Position: &position.Position{ StartLine: 161, EndLine: 161, - StartPos: 3679, - EndPos: 3684, + StartPos: 3675, + EndPos: 3695, }, - Value: "const", }, - Uses: []node.Node{ - &stmt.Use{ + UseType: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 161, EndLine: 161, - StartPos: 3685, - EndPos: 3688, + StartPos: 3679, + EndPos: 3684, }, - Use: &name.Name{ + }, + Value: []byte("const"), + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 161, EndLine: 161, StartPos: 3685, EndPos: 3688, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3685, - EndPos: 3688, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3685, + EndPos: 3688, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3685, + EndPos: 3688, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3691, - EndPos: 3694, - }, - Use: &name.Name{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 161, EndLine: 161, StartPos: 3691, EndPos: 3694, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3691, - EndPos: 3694, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3691, + EndPos: 3694, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3691, + EndPos: 3694, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3698, - EndPos: 3732, - }, - UseType: &node.Identifier{ + &ast.StmtUseList{ + Node: ast.Node{ Position: &position.Position{ StartLine: 162, EndLine: 162, - StartPos: 3702, - EndPos: 3707, + StartPos: 3698, + EndPos: 3732, }, - Value: "const", }, - Uses: []node.Node{ - &stmt.Use{ + UseType: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 162, EndLine: 162, - StartPos: 3708, - EndPos: 3718, + StartPos: 3702, + EndPos: 3707, }, - Use: &name.Name{ + }, + Value: []byte("const"), + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 162, EndLine: 162, StartPos: 3708, - EndPos: 3711, + EndPos: 3718, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3708, - EndPos: 3711, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3708, + EndPos: 3711, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3708, + EndPos: 3711, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3715, - EndPos: 3718, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3715, + EndPos: 3718, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3721, - EndPos: 3731, - }, - Use: &name.Name{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 162, EndLine: 162, StartPos: 3721, - EndPos: 3724, + EndPos: 3731, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3721, - EndPos: 3724, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3721, + EndPos: 3724, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3721, + EndPos: 3724, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3728, - EndPos: 3731, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3728, + EndPos: 3731, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3736, - EndPos: 3742, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 164, EndLine: 164, StartPos: 3736, - EndPos: 3741, + EndPos: 3742, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 164, EndLine: 164, StartPos: 3736, - EndPos: 3738, + EndPos: 3741, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 164, EndLine: 164, StartPos: 3736, EndPos: 3738, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3736, + EndPos: 3738, + }, + }, + Value: []byte("a"), }, }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3739, - EndPos: 3740, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3739, + EndPos: 3740, + }, }, - Value: "1", + Value: []byte("1"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3745, - EndPos: 3754, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 165, EndLine: 165, StartPos: 3745, - EndPos: 3753, + EndPos: 3754, }, - Variable: &expr.ArrayDimFetch{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 165, EndLine: 165, StartPos: 3745, - EndPos: 3750, + EndPos: 3753, }, - Variable: &expr.Variable{ + }, + Var: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 165, EndLine: 165, StartPos: 3745, - EndPos: 3747, + EndPos: 3750, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 165, EndLine: 165, StartPos: 3745, EndPos: 3747, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3745, + EndPos: 3747, + }, + }, + Value: []byte("a"), }, }, - Dim: &scalar.Lnumber{ + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3748, + EndPos: 3749, + }, + }, + Value: []byte("1"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 165, EndLine: 165, - StartPos: 3748, - EndPos: 3749, + StartPos: 3751, + EndPos: 3752, }, - Value: "1", }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3751, - EndPos: 3752, - }, - Value: "2", + Value: []byte("2"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3757, - EndPos: 3765, - }, - Expr: &expr.Array{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 166, EndLine: 166, StartPos: 3757, - EndPos: 3764, + EndPos: 3765, }, - Items: []node.Node{}, + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3757, + EndPos: 3764, + }, + }, + Items: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3768, - EndPos: 3777, - }, - Expr: &expr.Array{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 167, EndLine: 167, StartPos: 3768, - EndPos: 3776, + EndPos: 3777, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3774, - EndPos: 3775, - }, - Val: &scalar.Lnumber{ + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3768, + EndPos: 3776, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 167, EndLine: 167, StartPos: 3774, EndPos: 3775, }, - Value: "1", + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3774, + EndPos: 3775, + }, + }, + Value: []byte("1"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3780, - EndPos: 3798, - }, - Expr: &expr.Array{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 168, EndLine: 168, StartPos: 3780, - EndPos: 3797, + EndPos: 3798, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3786, - EndPos: 3790, - }, - Key: &scalar.Lnumber{ + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3780, + EndPos: 3797, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 168, EndLine: 168, StartPos: 3786, - EndPos: 3787, - }, - Value: "1", - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3789, EndPos: 3790, }, - Value: "1", + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3786, + EndPos: 3787, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3789, + EndPos: 3790, + }, + }, + Value: []byte("1"), }, }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3792, - EndPos: 3795, - }, - Val: &expr.Reference{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 168, EndLine: 168, StartPos: 3792, EndPos: 3795, }, - Variable: &expr.Variable{ + }, + Val: &ast.ExprReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 168, EndLine: 168, - StartPos: 3793, + StartPos: 3792, EndPos: 3795, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 168, EndLine: 168, StartPos: 3793, EndPos: 3795, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3793, + EndPos: 3795, + }, + }, + Value: []byte("b"), }, }, }, }, - &expr.ArrayItem{}, + &ast.ExprArrayItem{}, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3801, - EndPos: 3816, - }, - Expr: &expr.Array{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 169, EndLine: 169, StartPos: 3801, - EndPos: 3815, + EndPos: 3816, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3807, - EndPos: 3814, - }, - Key: &scalar.Lnumber{ + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3801, + EndPos: 3815, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 169, EndLine: 169, StartPos: 3807, - EndPos: 3808, - }, - Value: "3", - }, - Val: &expr.Reference{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3811, EndPos: 3814, }, - Variable: &expr.Variable{ + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 169, EndLine: 169, - StartPos: 3812, + StartPos: 3807, + EndPos: 3808, + }, + }, + Value: []byte("3"), + }, + Val: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3811, EndPos: 3814, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 169, EndLine: 169, StartPos: 3812, EndPos: 3814, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3812, + EndPos: 3814, + }, + }, + Value: []byte("b"), }, }, }, @@ -8263,135 +9947,167 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3819, - EndPos: 3848, - }, - Expr: &expr.Array{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, StartPos: 3819, - EndPos: 3847, + EndPos: 3848, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3825, - EndPos: 3828, - }, - Val: &expr.Reference{ + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3819, + EndPos: 3847, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, StartPos: 3825, EndPos: 3828, }, - Variable: &expr.Variable{ + }, + Val: &ast.ExprReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, - StartPos: 3826, + StartPos: 3825, EndPos: 3828, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, StartPos: 3826, EndPos: 3828, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3826, + EndPos: 3828, + }, + }, + Value: []byte("b"), }, }, }, }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3830, - EndPos: 3834, - }, - Key: &scalar.Lnumber{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, StartPos: 3830, - EndPos: 3831, - }, - Value: "1", - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3833, EndPos: 3834, }, - Value: "1", + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3830, + EndPos: 3831, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3833, + EndPos: 3834, + }, + }, + Value: []byte("1"), }, }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3836, - EndPos: 3837, - }, - Val: &scalar.Lnumber{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, StartPos: 3836, EndPos: 3837, }, - Value: "1", + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3836, + EndPos: 3837, + }, + }, + Value: []byte("1"), }, }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3839, - EndPos: 3846, - }, - Key: &scalar.Lnumber{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, StartPos: 3839, - EndPos: 3840, - }, - Value: "3", - }, - Val: &expr.Reference{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3843, EndPos: 3846, }, - Variable: &expr.Variable{ + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, - StartPos: 3844, + StartPos: 3839, + EndPos: 3840, + }, + }, + Value: []byte("3"), + }, + Val: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3843, EndPos: 3846, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, StartPos: 3844, EndPos: 3846, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3844, + EndPos: 3846, + }, + }, + Value: []byte("b"), }, }, }, @@ -8399,935 +10115,1145 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3851, - EndPos: 3855, - }, - Expr: &expr.BitwiseNot{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 171, EndLine: 171, StartPos: 3851, - EndPos: 3854, + EndPos: 3855, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprBitwiseNot{ + Node: ast.Node{ Position: &position.Position{ StartLine: 171, EndLine: 171, - StartPos: 3852, + StartPos: 3851, EndPos: 3854, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 171, EndLine: 171, StartPos: 3852, EndPos: 3854, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3852, + EndPos: 3854, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3858, - EndPos: 3862, - }, - Expr: &expr.BooleanNot{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 172, EndLine: 172, StartPos: 3858, - EndPos: 3861, + EndPos: 3862, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprBooleanNot{ + Node: ast.Node{ Position: &position.Position{ StartLine: 172, EndLine: 172, - StartPos: 3859, + StartPos: 3858, EndPos: 3861, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 172, EndLine: 172, StartPos: 3859, EndPos: 3861, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3859, + EndPos: 3861, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3866, - EndPos: 3875, - }, - Expr: &expr.ClassConstFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 174, EndLine: 174, StartPos: 3866, - EndPos: 3874, + EndPos: 3875, }, - Class: &name.Name{ + }, + Expr: &ast.ExprClassConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 174, EndLine: 174, StartPos: 3866, - EndPos: 3869, + EndPos: 3874, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3866, - EndPos: 3869, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3866, + EndPos: 3869, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3866, + EndPos: 3869, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3871, - EndPos: 3874, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3871, + EndPos: 3874, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3878, - EndPos: 3888, - }, - Expr: &expr.Clone{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 175, EndLine: 175, StartPos: 3878, - EndPos: 3886, + EndPos: 3888, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprClone{ + Node: ast.Node{ Position: &position.Position{ StartLine: 175, EndLine: 175, - StartPos: 3884, + StartPos: 3878, EndPos: 3886, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 175, EndLine: 175, StartPos: 3884, EndPos: 3886, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3884, + EndPos: 3886, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 176, - EndLine: 176, - StartPos: 3891, - EndPos: 3900, - }, - Expr: &expr.Clone{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 176, EndLine: 176, StartPos: 3891, - EndPos: 3899, + EndPos: 3900, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprClone{ + Node: ast.Node{ Position: &position.Position{ StartLine: 176, EndLine: 176, - StartPos: 3897, + StartPos: 3891, EndPos: 3899, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 176, EndLine: 176, StartPos: 3897, EndPos: 3899, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 3897, + EndPos: 3899, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3903, - EndPos: 3916, - }, - Expr: &expr.Closure{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 177, EndLine: 177, StartPos: 3903, - EndPos: 3915, + EndPos: 3916, }, - Static: false, - PhpDocComment: "", - ReturnsRef: false, - Stmts: []node.Node{}, + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 177, + EndLine: 177, + StartPos: 3903, + EndPos: 3915, + }, + }, + Static: false, + ReturnsRef: false, + Stmts: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3919, - EndPos: 3953, - }, - Expr: &expr.Closure{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 178, EndLine: 178, StartPos: 3919, - EndPos: 3952, + EndPos: 3953, }, - ReturnsRef: false, - Static: false, - PhpDocComment: "", - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3928, - EndPos: 3930, - }, - ByRef: false, - Variadic: false, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3919, + EndPos: 3952, + }, + }, + ReturnsRef: false, + Static: false, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 178, EndLine: 178, StartPos: 3928, EndPos: 3930, }, - VarName: &node.Identifier{ + }, + ByRef: false, + Variadic: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 178, EndLine: 178, StartPos: 3928, EndPos: 3930, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3928, + EndPos: 3930, + }, + }, + Value: []byte("a"), }, }, }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3932, - EndPos: 3934, - }, - Variadic: false, - ByRef: false, - Variable: &expr.Variable{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 178, EndLine: 178, StartPos: 3932, EndPos: 3934, }, - VarName: &node.Identifier{ + }, + Variadic: false, + ByRef: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 178, EndLine: 178, StartPos: 3932, EndPos: 3934, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3932, + EndPos: 3934, + }, + }, + Value: []byte("b"), }, }, }, }, - ClosureUse: &expr.ClosureUse{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3936, - EndPos: 3949, + ClosureUse: &ast.ExprClosureUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3936, + EndPos: 3949, + }, }, - Uses: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3941, - EndPos: 3943, - }, - VarName: &node.Identifier{ + Uses: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 178, EndLine: 178, StartPos: 3941, EndPos: 3943, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3941, + EndPos: 3943, + }, + }, + Value: []byte("c"), }, }, - &expr.Reference{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3945, - EndPos: 3948, - }, - Variable: &expr.Variable{ + &ast.ExprReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 178, EndLine: 178, - StartPos: 3946, + StartPos: 3945, EndPos: 3948, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 178, EndLine: 178, StartPos: 3946, EndPos: 3948, }, - Value: "d", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3946, + EndPos: 3948, + }, + }, + Value: []byte("d"), }, }, }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3956, - EndPos: 3990, - }, - Expr: &expr.Closure{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 179, EndLine: 179, StartPos: 3956, - EndPos: 3989, + EndPos: 3990, }, - ReturnsRef: false, - Static: false, - PhpDocComment: "", - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3965, - EndPos: 3967, - }, - ByRef: false, - Variadic: false, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 3956, + EndPos: 3989, + }, + }, + ReturnsRef: false, + Static: false, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 179, EndLine: 179, StartPos: 3965, EndPos: 3967, }, - VarName: &node.Identifier{ + }, + ByRef: false, + Variadic: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 179, EndLine: 179, StartPos: 3965, EndPos: 3967, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 3965, + EndPos: 3967, + }, + }, + Value: []byte("a"), }, }, }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3969, - EndPos: 3971, - }, - ByRef: false, - Variadic: false, - Variable: &expr.Variable{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 179, EndLine: 179, StartPos: 3969, EndPos: 3971, }, - VarName: &node.Identifier{ + }, + ByRef: false, + Variadic: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 179, EndLine: 179, StartPos: 3969, EndPos: 3971, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 3969, + EndPos: 3971, + }, + }, + Value: []byte("b"), }, }, }, }, - ClosureUse: &expr.ClosureUse{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3973, - EndPos: 3986, + ClosureUse: &ast.ExprClosureUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 3973, + EndPos: 3986, + }, }, - Uses: []node.Node{ - &expr.Reference{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3978, - EndPos: 3981, - }, - Variable: &expr.Variable{ + Uses: []ast.Vertex{ + &ast.ExprReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 179, EndLine: 179, - StartPos: 3979, + StartPos: 3978, EndPos: 3981, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 179, EndLine: 179, StartPos: 3979, EndPos: 3981, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 3979, + EndPos: 3981, + }, + }, + Value: []byte("c"), }, }, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3983, - EndPos: 3985, - }, - VarName: &node.Identifier{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 179, EndLine: 179, StartPos: 3983, EndPos: 3985, }, - Value: "d", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 3983, + EndPos: 3985, + }, + }, + Value: []byte("d"), }, }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 180, - EndLine: 180, - StartPos: 3993, - EndPos: 4007, - }, - Expr: &expr.Closure{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 180, EndLine: 180, StartPos: 3993, - EndPos: 4006, + EndPos: 4007, }, - ReturnsRef: false, - Static: false, - PhpDocComment: "", - Stmts: []node.Node{}, + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 3993, + EndPos: 4006, + }, + }, + ReturnsRef: false, + Static: false, + Stmts: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4010, - EndPos: 4014, - }, - Expr: &expr.ConstFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 181, EndLine: 181, StartPos: 4010, - EndPos: 4013, + EndPos: 4014, }, - Constant: &name.Name{ + }, + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 181, EndLine: 181, StartPos: 4010, EndPos: 4013, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4010, - EndPos: 4013, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4010, + EndPos: 4013, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4010, + EndPos: 4013, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 4017, - EndPos: 4031, - }, - Expr: &expr.ConstFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 182, EndLine: 182, StartPos: 4017, - EndPos: 4030, + EndPos: 4031, }, - Constant: &name.Relative{ + }, + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 182, EndLine: 182, StartPos: 4017, EndPos: 4030, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 4027, - EndPos: 4030, + }, + Const: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4017, + EndPos: 4030, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4027, + EndPos: 4030, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 4034, - EndPos: 4039, - }, - Expr: &expr.ConstFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 183, EndLine: 183, StartPos: 4034, - EndPos: 4038, + EndPos: 4039, }, - Constant: &name.FullyQualified{ + }, + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 183, EndLine: 183, StartPos: 4034, EndPos: 4038, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 4035, - EndPos: 4038, + }, + Const: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4034, + EndPos: 4038, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4035, + EndPos: 4038, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 4043, - EndPos: 4053, - }, - Expr: &expr.Empty{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 185, EndLine: 185, StartPos: 4043, - EndPos: 4052, + EndPos: 4053, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprEmpty{ + Node: ast.Node{ Position: &position.Position{ StartLine: 185, EndLine: 185, - StartPos: 4049, - EndPos: 4051, + StartPos: 4043, + EndPos: 4052, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 185, EndLine: 185, StartPos: 4049, EndPos: 4051, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 185, + EndLine: 185, + StartPos: 4049, + EndPos: 4051, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 4056, - EndPos: 4067, - }, - Expr: &expr.Empty{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 186, EndLine: 186, StartPos: 4056, - EndPos: 4066, + EndPos: 4067, }, - Expr: &expr.ConstFetch{ + }, + Expr: &ast.ExprEmpty{ + Node: ast.Node{ Position: &position.Position{ StartLine: 186, EndLine: 186, - StartPos: 4062, - EndPos: 4065, + StartPos: 4056, + EndPos: 4066, }, - Constant: &name.Name{ + }, + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 186, EndLine: 186, StartPos: 4062, EndPos: 4065, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 4062, - EndPos: 4065, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4062, + EndPos: 4065, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4062, + EndPos: 4065, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 4070, - EndPos: 4074, - }, - Expr: &expr.ErrorSuppress{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 187, EndLine: 187, StartPos: 4070, - EndPos: 4073, + EndPos: 4074, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprErrorSuppress{ + Node: ast.Node{ Position: &position.Position{ StartLine: 187, EndLine: 187, - StartPos: 4071, + StartPos: 4070, EndPos: 4073, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 187, EndLine: 187, StartPos: 4071, EndPos: 4073, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4071, + EndPos: 4073, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 4077, - EndPos: 4086, - }, - Expr: &expr.Eval{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 188, EndLine: 188, StartPos: 4077, - EndPos: 4085, + EndPos: 4086, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprEval{ + Node: ast.Node{ Position: &position.Position{ StartLine: 188, EndLine: 188, - StartPos: 4082, - EndPos: 4084, + StartPos: 4077, + EndPos: 4085, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 188, EndLine: 188, StartPos: 4082, EndPos: 4084, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4082, + EndPos: 4084, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 189, - EndLine: 189, - StartPos: 4089, - EndPos: 4094, - }, - Expr: &expr.Exit{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 189, EndLine: 189, StartPos: 4089, - EndPos: 4093, + EndPos: 4094, + }, + }, + Expr: &ast.ExprExit{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 189, + EndLine: 189, + StartPos: 4089, + EndPos: 4093, + }, }, Die: false, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4097, - EndPos: 4106, - }, - Expr: &expr.Exit{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 190, EndLine: 190, StartPos: 4097, - EndPos: 4105, + EndPos: 4106, }, - Die: false, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprExit{ + Node: ast.Node{ Position: &position.Position{ StartLine: 190, EndLine: 190, - StartPos: 4102, - EndPos: 4104, + StartPos: 4097, + EndPos: 4105, }, - VarName: &node.Identifier{ + }, + Die: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 190, EndLine: 190, StartPos: 4102, EndPos: 4104, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4102, + EndPos: 4104, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 191, - EndLine: 191, - StartPos: 4109, - EndPos: 4115, - }, - Expr: &expr.Exit{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 191, EndLine: 191, StartPos: 4109, - EndPos: 4114, + EndPos: 4115, + }, + }, + Expr: &ast.ExprExit{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4109, + EndPos: 4114, + }, }, Die: true, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 4118, - EndPos: 4126, - }, - Expr: &expr.Exit{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 192, EndLine: 192, StartPos: 4118, - EndPos: 4125, + EndPos: 4126, }, - Die: true, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprExit{ + Node: ast.Node{ Position: &position.Position{ StartLine: 192, EndLine: 192, - StartPos: 4122, - EndPos: 4124, + StartPos: 4118, + EndPos: 4125, }, - VarName: &node.Identifier{ + }, + Die: true, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 192, EndLine: 192, StartPos: 4122, EndPos: 4124, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4122, + EndPos: 4124, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 4129, - EndPos: 4135, - }, - Expr: &expr.FunctionCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 193, EndLine: 193, StartPos: 4129, - EndPos: 4134, + EndPos: 4135, }, - Function: &name.Name{ + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 193, EndLine: 193, StartPos: 4129, - EndPos: 4132, + EndPos: 4134, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 4129, - EndPos: 4132, + }, + Function: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4129, + EndPos: 4132, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4129, + EndPos: 4132, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 4132, - EndPos: 4134, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4132, + EndPos: 4134, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 4138, - EndPos: 4157, - }, - Expr: &expr.FunctionCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 194, EndLine: 194, StartPos: 4138, - EndPos: 4156, + EndPos: 4157, }, - Function: &name.Relative{ + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 194, EndLine: 194, StartPos: 4138, - EndPos: 4151, + EndPos: 4156, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 4148, - EndPos: 4151, + }, + Function: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4138, + EndPos: 4151, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4148, + EndPos: 4151, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 4151, - EndPos: 4156, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4151, + EndPos: 4156, + }, }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 4153, - EndPos: 4155, - }, - Variadic: false, - IsReference: true, - Expr: &expr.Variable{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 194, EndLine: 194, StartPos: 4153, EndPos: 4155, }, - VarName: &node.Identifier{ + }, + Variadic: false, + IsReference: true, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 194, EndLine: 194, StartPos: 4153, EndPos: 4155, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4153, + EndPos: 4155, + }, + }, + Value: []byte("a"), }, }, }, @@ -9335,140 +11261,172 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 195, - EndLine: 195, - StartPos: 4160, - EndPos: 4169, - }, - Expr: &expr.FunctionCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 195, EndLine: 195, StartPos: 4160, - EndPos: 4168, + EndPos: 4169, }, - Function: &name.FullyQualified{ + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 195, EndLine: 195, StartPos: 4160, - EndPos: 4164, + EndPos: 4168, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 195, - EndLine: 195, - StartPos: 4161, - EndPos: 4164, + }, + Function: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 195, + EndLine: 195, + StartPos: 4160, + EndPos: 4164, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 195, + EndLine: 195, + StartPos: 4161, + EndPos: 4164, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 195, - EndLine: 195, - StartPos: 4164, - EndPos: 4168, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 195, + EndLine: 195, + StartPos: 4164, + EndPos: 4168, + }, }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 195, - EndLine: 195, - StartPos: 4165, - EndPos: 4167, - }, - Variadic: false, - IsReference: false, - Expr: &expr.ShortArray{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 195, EndLine: 195, StartPos: 4165, EndPos: 4167, }, - Items: []node.Node{}, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 195, + EndLine: 195, + StartPos: 4165, + EndPos: 4167, + }, + }, + Items: []ast.Vertex{}, }, }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 4172, - EndPos: 4187, - }, - Expr: &expr.FunctionCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 196, EndLine: 196, StartPos: 4172, - EndPos: 4186, + EndPos: 4187, }, - Function: &expr.Variable{ + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 196, EndLine: 196, StartPos: 4172, - EndPos: 4176, + EndPos: 4186, }, - VarName: &node.Identifier{ + }, + Function: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 196, EndLine: 196, StartPos: 4172, EndPos: 4176, }, - Value: "foo", }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 4176, - EndPos: 4186, - }, - Arguments: []node.Node{ - &node.Argument{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 196, EndLine: 196, - StartPos: 4177, - EndPos: 4185, + StartPos: 4172, + EndPos: 4176, }, - IsReference: false, - Variadic: false, - Expr: &expr.Yield{ + }, + Value: []byte("foo"), + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4176, + EndPos: 4186, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 196, EndLine: 196, StartPos: 4177, EndPos: 4185, }, - Value: &expr.Variable{ + }, + IsReference: false, + Variadic: false, + Expr: &ast.ExprYield{ + Node: ast.Node{ Position: &position.Position{ StartLine: 196, EndLine: 196, - StartPos: 4183, + StartPos: 4177, EndPos: 4185, }, - VarName: &node.Identifier{ + }, + Value: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 196, EndLine: 196, StartPos: 4183, EndPos: 4185, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4183, + EndPos: 4185, + }, + }, + Value: []byte("a"), }, }, }, @@ -9477,516 +11435,638 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 4191, - EndPos: 4196, - }, - Expr: &expr.PostDec{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 198, EndLine: 198, StartPos: 4191, - EndPos: 4195, + EndPos: 4196, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprPostDec{ + Node: ast.Node{ Position: &position.Position{ StartLine: 198, EndLine: 198, StartPos: 4191, - EndPos: 4193, + EndPos: 4195, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 198, EndLine: 198, StartPos: 4191, EndPos: 4193, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4191, + EndPos: 4193, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 199, - EndLine: 199, - StartPos: 4199, - EndPos: 4204, - }, - Expr: &expr.PostInc{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 199, EndLine: 199, StartPos: 4199, - EndPos: 4203, + EndPos: 4204, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprPostInc{ + Node: ast.Node{ Position: &position.Position{ StartLine: 199, EndLine: 199, StartPos: 4199, - EndPos: 4201, + EndPos: 4203, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 199, EndLine: 199, StartPos: 4199, EndPos: 4201, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 199, + EndLine: 199, + StartPos: 4199, + EndPos: 4201, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 4207, - EndPos: 4212, - }, - Expr: &expr.PreDec{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 200, EndLine: 200, StartPos: 4207, - EndPos: 4211, + EndPos: 4212, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprPreDec{ + Node: ast.Node{ Position: &position.Position{ StartLine: 200, EndLine: 200, - StartPos: 4209, + StartPos: 4207, EndPos: 4211, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 200, EndLine: 200, StartPos: 4209, EndPos: 4211, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 200, + EndLine: 200, + StartPos: 4209, + EndPos: 4211, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 201, - EndLine: 201, - StartPos: 4215, - EndPos: 4220, - }, - Expr: &expr.PreInc{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 201, EndLine: 201, StartPos: 4215, - EndPos: 4219, + EndPos: 4220, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprPreInc{ + Node: ast.Node{ Position: &position.Position{ StartLine: 201, EndLine: 201, - StartPos: 4217, + StartPos: 4215, EndPos: 4219, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 201, EndLine: 201, StartPos: 4217, EndPos: 4219, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 201, + EndLine: 201, + StartPos: 4217, + EndPos: 4219, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 4224, - EndPos: 4235, - }, - Expr: &expr.Include{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 203, EndLine: 203, StartPos: 4224, - EndPos: 4234, + EndPos: 4235, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprInclude{ + Node: ast.Node{ Position: &position.Position{ StartLine: 203, EndLine: 203, - StartPos: 4232, + StartPos: 4224, EndPos: 4234, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 203, EndLine: 203, StartPos: 4232, EndPos: 4234, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4232, + EndPos: 4234, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 4238, - EndPos: 4254, - }, - Expr: &expr.IncludeOnce{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 204, EndLine: 204, StartPos: 4238, - EndPos: 4253, + EndPos: 4254, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprIncludeOnce{ + Node: ast.Node{ Position: &position.Position{ StartLine: 204, EndLine: 204, - StartPos: 4251, + StartPos: 4238, EndPos: 4253, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 204, EndLine: 204, StartPos: 4251, EndPos: 4253, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 204, + EndLine: 204, + StartPos: 4251, + EndPos: 4253, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 4257, - EndPos: 4268, - }, - Expr: &expr.Require{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 205, EndLine: 205, StartPos: 4257, - EndPos: 4267, + EndPos: 4268, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprRequire{ + Node: ast.Node{ Position: &position.Position{ StartLine: 205, EndLine: 205, - StartPos: 4265, + StartPos: 4257, EndPos: 4267, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 205, EndLine: 205, StartPos: 4265, EndPos: 4267, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4265, + EndPos: 4267, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 4271, - EndPos: 4287, - }, - Expr: &expr.RequireOnce{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 206, EndLine: 206, StartPos: 4271, - EndPos: 4286, + EndPos: 4287, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprRequireOnce{ + Node: ast.Node{ Position: &position.Position{ StartLine: 206, EndLine: 206, - StartPos: 4284, + StartPos: 4271, EndPos: 4286, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 206, EndLine: 206, StartPos: 4284, EndPos: 4286, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4284, + EndPos: 4286, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 4291, - EndPos: 4309, - }, - Expr: &expr.InstanceOf{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 208, EndLine: 208, StartPos: 4291, - EndPos: 4308, + EndPos: 4309, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprInstanceOf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 208, EndLine: 208, StartPos: 4291, - EndPos: 4293, + EndPos: 4308, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 208, EndLine: 208, StartPos: 4291, EndPos: 4293, }, - Value: "a", }, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 4305, - EndPos: 4308, - }, - Parts: []node.Node{ - &name.NamePart{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 208, EndLine: 208, - StartPos: 4305, - EndPos: 4308, + StartPos: 4291, + EndPos: 4293, }, - Value: "Foo", + }, + Value: []byte("a"), + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 208, + EndLine: 208, + StartPos: 4305, + EndPos: 4308, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 208, + EndLine: 208, + StartPos: 4305, + EndPos: 4308, + }, + }, + Value: []byte("Foo"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 4312, - EndPos: 4340, - }, - Expr: &expr.InstanceOf{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 209, EndLine: 209, StartPos: 4312, - EndPos: 4339, + EndPos: 4340, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprInstanceOf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 209, EndLine: 209, StartPos: 4312, - EndPos: 4314, + EndPos: 4339, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 209, EndLine: 209, StartPos: 4312, EndPos: 4314, }, - Value: "a", }, - }, - Class: &name.Relative{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 4326, - EndPos: 4339, - }, - Parts: []node.Node{ - &name.NamePart{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 209, EndLine: 209, - StartPos: 4336, - EndPos: 4339, + StartPos: 4312, + EndPos: 4314, }, - Value: "Foo", + }, + Value: []byte("a"), + }, + }, + Class: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 209, + EndLine: 209, + StartPos: 4326, + EndPos: 4339, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 209, + EndLine: 209, + StartPos: 4336, + EndPos: 4339, + }, + }, + Value: []byte("Foo"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4343, - EndPos: 4362, - }, - Expr: &expr.InstanceOf{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 210, EndLine: 210, StartPos: 4343, - EndPos: 4361, + EndPos: 4362, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprInstanceOf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 210, EndLine: 210, StartPos: 4343, - EndPos: 4345, + EndPos: 4361, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 210, EndLine: 210, StartPos: 4343, EndPos: 4345, }, - Value: "a", }, - }, - Class: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4357, - EndPos: 4361, - }, - Parts: []node.Node{ - &name.NamePart{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 210, EndLine: 210, - StartPos: 4358, - EndPos: 4361, + StartPos: 4343, + EndPos: 4345, }, - Value: "Foo", + }, + Value: []byte("a"), + }, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4357, + EndPos: 4361, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4358, + EndPos: 4361, + }, + }, + Value: []byte("Foo"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 212, - EndLine: 212, - StartPos: 4366, - EndPos: 4380, - }, - Expr: &expr.Isset{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 212, EndLine: 212, StartPos: 4366, - EndPos: 4379, + EndPos: 4380, }, - Variables: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 212, - EndLine: 212, - StartPos: 4372, - EndPos: 4374, - }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprIsset{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 212, + EndLine: 212, + StartPos: 4366, + EndPos: 4379, + }, + }, + Vars: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 212, EndLine: 212, StartPos: 4372, EndPos: 4374, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 212, + EndLine: 212, + StartPos: 4372, + EndPos: 4374, + }, + }, + Value: []byte("a"), }, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 212, - EndLine: 212, - StartPos: 4376, - EndPos: 4378, - }, - VarName: &node.Identifier{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 212, EndLine: 212, StartPos: 4376, EndPos: 4378, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 212, + EndLine: 212, + StartPos: 4376, + EndPos: 4378, + }, + }, + Value: []byte("b"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4383, - EndPos: 4394, - }, - Expr: &expr.Isset{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 213, EndLine: 213, StartPos: 4383, - EndPos: 4393, + EndPos: 4394, }, - Variables: []node.Node{ - &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4389, - EndPos: 4392, - }, - Constant: &name.Name{ + }, + Expr: &ast.ExprIsset{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 213, + EndLine: 213, + StartPos: 4383, + EndPos: 4393, + }, + }, + Vars: []ast.Vertex{ + &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 213, EndLine: 213, StartPos: 4389, EndPos: 4392, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4389, - EndPos: 4392, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 213, + EndLine: 213, + StartPos: 4389, + EndPos: 4392, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 213, + EndLine: 213, + StartPos: 4389, + EndPos: 4392, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, @@ -9994,276 +12074,342 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4397, - EndPos: 4409, - }, - Expr: &assign.Assign{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 214, EndLine: 214, StartPos: 4397, - EndPos: 4408, + EndPos: 4409, }, - Variable: &expr.List{ + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ Position: &position.Position{ StartLine: 214, EndLine: 214, StartPos: 4397, - EndPos: 4403, - }, - Items: []node.Node{}, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4406, EndPos: 4408, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4397, + EndPos: 4403, + }, + }, + Items: []ast.Vertex{}, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 214, EndLine: 214, StartPos: 4406, EndPos: 4408, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4406, + EndPos: 4408, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4412, - EndPos: 4430, - }, - Expr: &assign.Assign{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 215, EndLine: 215, StartPos: 4412, - EndPos: 4429, + EndPos: 4430, }, - Variable: &expr.List{ + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ Position: &position.Position{ StartLine: 215, EndLine: 215, StartPos: 4412, - EndPos: 4424, + EndPos: 4429, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4417, - EndPos: 4419, - }, - Val: &expr.Variable{ + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4412, + EndPos: 4424, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 215, EndLine: 215, StartPos: 4417, EndPos: 4419, }, - VarName: &node.Identifier{ + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 215, EndLine: 215, StartPos: 4417, EndPos: 4419, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4417, + EndPos: 4419, + }, + }, + Value: []byte("a"), }, }, }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4421, - EndPos: 4423, - }, - Val: &expr.Variable{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 215, EndLine: 215, StartPos: 4421, EndPos: 4423, }, - VarName: &node.Identifier{ + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 215, EndLine: 215, StartPos: 4421, EndPos: 4423, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4421, + EndPos: 4423, + }, + }, + Value: []byte("b"), }, }, }, }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4427, - EndPos: 4429, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 215, EndLine: 215, StartPos: 4427, EndPos: 4429, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4427, + EndPos: 4429, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4433, - EndPos: 4449, - }, - Expr: &assign.Assign{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 216, EndLine: 216, StartPos: 4433, - EndPos: 4448, + EndPos: 4449, }, - Variable: &expr.List{ + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ Position: &position.Position{ StartLine: 216, EndLine: 216, StartPos: 4433, - EndPos: 4443, + EndPos: 4448, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4438, - EndPos: 4442, - }, - Val: &expr.ArrayDimFetch{ + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4433, + EndPos: 4443, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 216, EndLine: 216, StartPos: 4438, EndPos: 4442, }, - Variable: &expr.Variable{ + }, + Val: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 216, EndLine: 216, StartPos: 4438, - EndPos: 4440, + EndPos: 4442, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 216, EndLine: 216, StartPos: 4438, EndPos: 4440, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4438, + EndPos: 4440, + }, + }, + Value: []byte("a"), }, }, }, }, }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4446, - EndPos: 4448, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 216, EndLine: 216, StartPos: 4446, EndPos: 4448, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4446, + EndPos: 4448, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4452, - EndPos: 4472, - }, - Expr: &assign.Assign{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 217, EndLine: 217, StartPos: 4452, - EndPos: 4471, + EndPos: 4472, }, - Variable: &expr.List{ + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ Position: &position.Position{ StartLine: 217, EndLine: 217, StartPos: 4452, - EndPos: 4466, + EndPos: 4471, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4457, - EndPos: 4465, - }, - Val: &expr.List{ + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4452, + EndPos: 4466, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 217, EndLine: 217, StartPos: 4457, EndPos: 4465, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4462, - EndPos: 4464, - }, - Val: &expr.Variable{ + }, + Val: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4457, + EndPos: 4465, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 217, EndLine: 217, StartPos: 4462, EndPos: 4464, }, - VarName: &node.Identifier{ + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 217, EndLine: 217, StartPos: 4462, EndPos: 4464, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4462, + EndPos: 4464, + }, + }, + Value: []byte("a"), }, }, }, @@ -10272,3654 +12418,4522 @@ func TestPhp5(t *testing.T) { }, }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4469, - EndPos: 4471, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 217, EndLine: 217, StartPos: 4469, EndPos: 4471, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4469, + EndPos: 4471, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4476, - EndPos: 4486, - }, - Expr: &expr.MethodCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 219, EndLine: 219, StartPos: 4476, - EndPos: 4485, + EndPos: 4486, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprMethodCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 219, EndLine: 219, StartPos: 4476, - EndPos: 4478, + EndPos: 4485, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 219, EndLine: 219, StartPos: 4476, EndPos: 4478, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4476, + EndPos: 4478, + }, + }, + Value: []byte("a"), }, }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4480, - EndPos: 4483, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4480, + EndPos: 4483, + }, }, - Value: "foo", + Value: []byte("foo"), }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4483, - EndPos: 4485, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4483, + EndPos: 4485, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4489, - EndPos: 4497, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 220, EndLine: 220, StartPos: 4489, - EndPos: 4496, + EndPos: 4497, }, - Class: &name.Name{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 220, EndLine: 220, - StartPos: 4493, + StartPos: 4489, EndPos: 4496, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4493, - EndPos: 4496, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4493, + EndPos: 4496, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4493, + EndPos: 4496, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 221, - EndLine: 221, - StartPos: 4500, - EndPos: 4520, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 221, EndLine: 221, StartPos: 4500, - EndPos: 4519, + EndPos: 4520, }, - Class: &name.Relative{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 221, EndLine: 221, - StartPos: 4504, - EndPos: 4517, + StartPos: 4500, + EndPos: 4519, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 221, - EndLine: 221, - StartPos: 4514, - EndPos: 4517, + }, + Class: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4504, + EndPos: 4517, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4514, + EndPos: 4517, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 221, - EndLine: 221, - StartPos: 4517, - EndPos: 4519, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4517, + EndPos: 4519, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4523, - EndPos: 4534, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 222, EndLine: 222, StartPos: 4523, - EndPos: 4533, + EndPos: 4534, }, - Class: &name.FullyQualified{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 222, EndLine: 222, - StartPos: 4527, - EndPos: 4531, + StartPos: 4523, + EndPos: 4533, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4528, - EndPos: 4531, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4527, + EndPos: 4531, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4528, + EndPos: 4531, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4531, - EndPos: 4533, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4531, + EndPos: 4533, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4537, - EndPos: 4547, - }, - Expr: &expr.Print{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 223, EndLine: 223, StartPos: 4537, - EndPos: 4545, + EndPos: 4547, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprPrint{ + Node: ast.Node{ Position: &position.Position{ StartLine: 223, EndLine: 223, - StartPos: 4543, + StartPos: 4537, EndPos: 4545, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 223, EndLine: 223, StartPos: 4543, EndPos: 4545, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4543, + EndPos: 4545, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4550, - EndPos: 4558, - }, - Expr: &expr.PropertyFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 224, EndLine: 224, StartPos: 4550, - EndPos: 4557, + EndPos: 4558, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 224, EndLine: 224, StartPos: 4550, - EndPos: 4552, + EndPos: 4557, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 224, EndLine: 224, StartPos: 4550, EndPos: 4552, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4550, + EndPos: 4552, + }, + }, + Value: []byte("a"), }, }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4554, - EndPos: 4557, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4554, + EndPos: 4557, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4561, - EndPos: 4572, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 225, EndLine: 225, StartPos: 4561, - EndPos: 4570, + EndPos: 4572, }, - Variable: &expr.PropertyFetch{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 225, EndLine: 225, StartPos: 4561, - EndPos: 4568, + EndPos: 4570, }, - Variable: &expr.Variable{ + }, + Var: &ast.ExprPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 225, EndLine: 225, StartPos: 4561, - EndPos: 4563, + EndPos: 4568, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 225, EndLine: 225, StartPos: 4561, EndPos: 4563, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4561, + EndPos: 4563, + }, + }, + Value: []byte("a"), }, }, - Property: &node.Identifier{ + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4565, + EndPos: 4568, + }, + }, + Value: []byte("foo"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 225, EndLine: 225, - StartPos: 4565, - EndPos: 4568, + StartPos: 4569, + EndPos: 4570, }, - Value: "foo", }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4569, - EndPos: 4570, - }, - Value: "1", + Value: []byte("1"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4575, - EndPos: 4604, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, StartPos: 4575, - EndPos: 4602, + EndPos: 4604, }, - Variable: &expr.PropertyFetch{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, StartPos: 4575, - EndPos: 4600, + EndPos: 4602, }, - Variable: &expr.MethodCall{ + }, + Var: &ast.ExprPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, StartPos: 4575, - EndPos: 4594, + EndPos: 4600, }, - Variable: &expr.PropertyFetch{ + }, + Var: &ast.ExprMethodCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, StartPos: 4575, - EndPos: 4587, + EndPos: 4594, }, - Variable: &expr.PropertyFetch{ + }, + Var: &ast.ExprPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, StartPos: 4575, - EndPos: 4582, + EndPos: 4587, }, - Variable: &expr.Variable{ + }, + Var: &ast.ExprPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, StartPos: 4575, - EndPos: 4577, + EndPos: 4582, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, StartPos: 4575, EndPos: 4577, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4575, + EndPos: 4577, + }, + }, + Value: []byte("a"), }, }, - Property: &node.Identifier{ + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4579, + EndPos: 4582, + }, + }, + Value: []byte("foo"), + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, - StartPos: 4579, - EndPos: 4582, + StartPos: 4584, + EndPos: 4587, }, - Value: "foo", }, + Value: []byte("bar"), }, - Property: &node.Identifier{ + }, + Method: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, - StartPos: 4584, - EndPos: 4587, + StartPos: 4589, + EndPos: 4592, }, - Value: "bar", }, + Value: []byte("baz"), }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4589, - EndPos: 4592, - }, - Value: "baz", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4592, - EndPos: 4594, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4592, + EndPos: 4594, + }, }, }, }, - Property: &node.Identifier{ + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4596, + EndPos: 4600, + }, + }, + Value: []byte("quux"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, - StartPos: 4596, - EndPos: 4600, + StartPos: 4601, + EndPos: 4602, }, - Value: "quux", }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4601, - EndPos: 4602, - }, - Value: "0", + Value: []byte("0"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4607, - EndPos: 4623, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 227, EndLine: 227, StartPos: 4607, - EndPos: 4621, + EndPos: 4623, }, - Variable: &expr.ArrayDimFetch{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 227, EndLine: 227, StartPos: 4607, - EndPos: 4618, + EndPos: 4621, }, - Variable: &expr.MethodCall{ + }, + Var: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 227, EndLine: 227, StartPos: 4607, - EndPos: 4616, + EndPos: 4618, }, - Variable: &expr.Variable{ + }, + Var: &ast.ExprMethodCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 227, EndLine: 227, StartPos: 4607, - EndPos: 4609, + EndPos: 4616, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 227, EndLine: 227, StartPos: 4607, EndPos: 4609, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4607, + EndPos: 4609, + }, + }, + Value: []byte("a"), }, }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4611, - EndPos: 4614, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4611, + EndPos: 4614, + }, }, - Value: "foo", + Value: []byte("foo"), }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4614, - EndPos: 4616, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4614, + EndPos: 4616, + }, }, }, }, - Dim: &scalar.Lnumber{ + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4617, + EndPos: 4618, + }, + }, + Value: []byte("1"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 227, EndLine: 227, - StartPos: 4617, - EndPos: 4618, + StartPos: 4620, + EndPos: 4621, }, - Value: "1", }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4620, - EndPos: 4621, - }, - Value: "1", + Value: []byte("1"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4626, - EndPos: 4635, - }, - Expr: &expr.ShellExec{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 228, EndLine: 228, StartPos: 4626, - EndPos: 4634, + EndPos: 4635, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4627, - EndPos: 4631, - }, - Value: "cmd ", + }, + Expr: &ast.ExprShellExec{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4626, + EndPos: 4634, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4631, - EndPos: 4633, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4627, + EndPos: 4631, + }, }, - VarName: &node.Identifier{ + Value: []byte("cmd "), + }, + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 228, EndLine: 228, StartPos: 4631, EndPos: 4633, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4631, + EndPos: 4633, + }, + }, + Value: []byte("a"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4638, - EndPos: 4644, - }, - Expr: &expr.ShellExec{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 229, EndLine: 229, StartPos: 4638, - EndPos: 4643, + EndPos: 4644, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4639, - EndPos: 4642, + }, + Expr: &ast.ExprShellExec{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4638, + EndPos: 4643, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4639, + EndPos: 4642, + }, }, - Value: "cmd", + Value: []byte("cmd"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4647, - EndPos: 4650, - }, - Expr: &expr.ShellExec{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 230, EndLine: 230, StartPos: 4647, - EndPos: 4649, + EndPos: 4650, }, - Parts: []node.Node{}, + }, + Expr: &ast.ExprShellExec{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4647, + EndPos: 4649, + }, + }, + Parts: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4653, - EndPos: 4656, - }, - Expr: &expr.ShortArray{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 231, EndLine: 231, StartPos: 4653, - EndPos: 4655, + EndPos: 4656, }, - Items: []node.Node{}, + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4653, + EndPos: 4655, + }, + }, + Items: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4659, - EndPos: 4663, - }, - Expr: &expr.ShortArray{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 232, EndLine: 232, StartPos: 4659, - EndPos: 4662, + EndPos: 4663, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4660, - EndPos: 4661, - }, - Val: &scalar.Lnumber{ + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4659, + EndPos: 4662, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 232, EndLine: 232, StartPos: 4660, EndPos: 4661, }, - Value: "1", + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4660, + EndPos: 4661, + }, + }, + Value: []byte("1"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4666, - EndPos: 4679, - }, - Expr: &expr.ShortArray{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 233, EndLine: 233, StartPos: 4666, - EndPos: 4678, + EndPos: 4679, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4667, - EndPos: 4671, - }, - Key: &scalar.Lnumber{ + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4666, + EndPos: 4678, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 233, EndLine: 233, StartPos: 4667, - EndPos: 4668, - }, - Value: "1", - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4670, EndPos: 4671, }, - Value: "1", + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4667, + EndPos: 4668, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4670, + EndPos: 4671, + }, + }, + Value: []byte("1"), }, }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4673, - EndPos: 4676, - }, - Val: &expr.Reference{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 233, EndLine: 233, StartPos: 4673, EndPos: 4676, }, - Variable: &expr.Variable{ + }, + Val: &ast.ExprReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 233, EndLine: 233, - StartPos: 4674, + StartPos: 4673, EndPos: 4676, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 233, EndLine: 233, StartPos: 4674, EndPos: 4676, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4674, + EndPos: 4676, + }, + }, + Value: []byte("b"), }, }, }, }, - &expr.ArrayItem{}, + &ast.ExprArrayItem{}, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4683, - EndPos: 4694, - }, - Expr: &expr.StaticCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 235, EndLine: 235, StartPos: 4683, - EndPos: 4693, + EndPos: 4694, }, - Class: &name.Name{ + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 235, EndLine: 235, StartPos: 4683, - EndPos: 4686, + EndPos: 4693, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4683, - EndPos: 4686, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4683, + EndPos: 4686, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4683, + EndPos: 4686, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4688, - EndPos: 4691, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4688, + EndPos: 4691, + }, }, - Value: "bar", + Value: []byte("bar"), }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4691, - EndPos: 4693, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4691, + EndPos: 4693, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4697, - EndPos: 4718, - }, - Expr: &expr.StaticCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 236, EndLine: 236, StartPos: 4697, - EndPos: 4717, + EndPos: 4718, }, - Class: &name.Relative{ + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 236, EndLine: 236, StartPos: 4697, - EndPos: 4710, + EndPos: 4717, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4707, - EndPos: 4710, + }, + Class: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 236, + EndLine: 236, + StartPos: 4697, + EndPos: 4710, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 236, + EndLine: 236, + StartPos: 4707, + EndPos: 4710, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4712, - EndPos: 4715, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 236, + EndLine: 236, + StartPos: 4712, + EndPos: 4715, + }, }, - Value: "bar", + Value: []byte("bar"), }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4715, - EndPos: 4717, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 236, + EndLine: 236, + StartPos: 4715, + EndPos: 4717, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4721, - EndPos: 4733, - }, - Expr: &expr.StaticCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 237, EndLine: 237, StartPos: 4721, - EndPos: 4732, + EndPos: 4733, }, - Class: &name.FullyQualified{ + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 237, EndLine: 237, StartPos: 4721, - EndPos: 4725, + EndPos: 4732, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4722, - EndPos: 4725, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4721, + EndPos: 4725, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4722, + EndPos: 4725, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4727, - EndPos: 4730, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4727, + EndPos: 4730, + }, }, - Value: "bar", + Value: []byte("bar"), }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4730, - EndPos: 4732, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4730, + EndPos: 4732, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4736, - EndPos: 4748, - }, - Expr: &expr.StaticCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 238, EndLine: 238, StartPos: 4736, - EndPos: 4747, + EndPos: 4748, }, - Class: &name.Name{ + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 238, EndLine: 238, StartPos: 4736, - EndPos: 4739, + EndPos: 4747, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4736, - EndPos: 4739, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4736, + EndPos: 4739, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4736, + EndPos: 4739, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Call: &expr.Variable{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4741, - EndPos: 4745, - }, - VarName: &node.Identifier{ + Call: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 238, EndLine: 238, StartPos: 4741, EndPos: 4745, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4741, + EndPos: 4745, + }, + }, + Value: []byte("bar"), }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4745, - EndPos: 4747, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4745, + EndPos: 4747, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4751, - EndPos: 4764, - }, - Expr: &expr.StaticCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 239, EndLine: 239, StartPos: 4751, - EndPos: 4763, + EndPos: 4764, }, - Class: &expr.Variable{ + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 239, EndLine: 239, StartPos: 4751, - EndPos: 4755, + EndPos: 4763, }, - VarName: &node.Identifier{ + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 239, EndLine: 239, StartPos: 4751, EndPos: 4755, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4751, + EndPos: 4755, + }, + }, + Value: []byte("foo"), }, }, - Call: &expr.Variable{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4757, - EndPos: 4761, - }, - VarName: &node.Identifier{ + Call: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 239, EndLine: 239, StartPos: 4757, EndPos: 4761, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4757, + EndPos: 4761, + }, + }, + Value: []byte("bar"), }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4761, - EndPos: 4763, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4761, + EndPos: 4763, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 240, - EndLine: 240, - StartPos: 4767, - EndPos: 4777, - }, - Expr: &expr.StaticPropertyFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 240, EndLine: 240, StartPos: 4767, - EndPos: 4776, + EndPos: 4777, }, - Class: &name.Name{ + }, + Expr: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 240, EndLine: 240, StartPos: 4767, - EndPos: 4770, + EndPos: 4776, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 240, - EndLine: 240, - StartPos: 4767, - EndPos: 4770, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4767, + EndPos: 4770, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4767, + EndPos: 4770, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 240, - EndLine: 240, - StartPos: 4772, - EndPos: 4776, - }, - VarName: &node.Identifier{ + Property: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 240, EndLine: 240, StartPos: 4772, EndPos: 4776, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4772, + EndPos: 4776, + }, + }, + Value: []byte("bar"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4780, - EndPos: 4800, - }, - Expr: &expr.StaticPropertyFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 241, EndLine: 241, StartPos: 4780, - EndPos: 4799, + EndPos: 4800, }, - Class: &name.Relative{ + }, + Expr: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 241, EndLine: 241, StartPos: 4780, - EndPos: 4793, + EndPos: 4799, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4790, - EndPos: 4793, + }, + Class: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4780, + EndPos: 4793, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4790, + EndPos: 4793, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4795, - EndPos: 4799, - }, - VarName: &node.Identifier{ + Property: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 241, EndLine: 241, StartPos: 4795, EndPos: 4799, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4795, + EndPos: 4799, + }, + }, + Value: []byte("bar"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4803, - EndPos: 4814, - }, - Expr: &expr.StaticPropertyFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 242, EndLine: 242, StartPos: 4803, - EndPos: 4813, + EndPos: 4814, }, - Class: &name.FullyQualified{ + }, + Expr: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 242, EndLine: 242, StartPos: 4803, - EndPos: 4807, + EndPos: 4813, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4804, - EndPos: 4807, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4803, + EndPos: 4807, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4804, + EndPos: 4807, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4809, - EndPos: 4813, - }, - VarName: &node.Identifier{ + Property: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 242, EndLine: 242, StartPos: 4809, EndPos: 4813, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4809, + EndPos: 4813, + }, + }, + Value: []byte("bar"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4817, - EndPos: 4830, - }, - Expr: &expr.Ternary{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 243, EndLine: 243, StartPos: 4817, - EndPos: 4829, + EndPos: 4830, }, - Condition: &expr.Variable{ + }, + Expr: &ast.ExprTernary{ + Node: ast.Node{ Position: &position.Position{ StartLine: 243, EndLine: 243, StartPos: 4817, - EndPos: 4819, + EndPos: 4829, }, - VarName: &node.Identifier{ + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 243, EndLine: 243, StartPos: 4817, EndPos: 4819, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4817, + EndPos: 4819, + }, + }, + Value: []byte("a"), }, }, - IfTrue: &expr.Variable{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4822, - EndPos: 4824, - }, - VarName: &node.Identifier{ + IfTrue: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 243, EndLine: 243, StartPos: 4822, EndPos: 4824, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4822, + EndPos: 4824, + }, + }, + Value: []byte("b"), }, }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4827, - EndPos: 4829, - }, - VarName: &node.Identifier{ + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 243, EndLine: 243, StartPos: 4827, EndPos: 4829, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4827, + EndPos: 4829, + }, + }, + Value: []byte("c"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4833, - EndPos: 4843, - }, - Expr: &expr.Ternary{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 244, EndLine: 244, StartPos: 4833, - EndPos: 4842, + EndPos: 4843, }, - Condition: &expr.Variable{ + }, + Expr: &ast.ExprTernary{ + Node: ast.Node{ Position: &position.Position{ StartLine: 244, EndLine: 244, StartPos: 4833, - EndPos: 4835, + EndPos: 4842, }, - VarName: &node.Identifier{ + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 244, EndLine: 244, StartPos: 4833, EndPos: 4835, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4833, + EndPos: 4835, + }, + }, + Value: []byte("a"), }, }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4840, - EndPos: 4842, - }, - VarName: &node.Identifier{ + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 244, EndLine: 244, StartPos: 4840, EndPos: 4842, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4840, + EndPos: 4842, + }, + }, + Value: []byte("c"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4846, - EndPos: 4869, - }, - Expr: &expr.Ternary{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 245, EndLine: 245, StartPos: 4846, - EndPos: 4868, + EndPos: 4869, }, - Condition: &expr.Variable{ + }, + Expr: &ast.ExprTernary{ + Node: ast.Node{ Position: &position.Position{ StartLine: 245, EndLine: 245, StartPos: 4846, - EndPos: 4848, + EndPos: 4868, }, - VarName: &node.Identifier{ + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 245, EndLine: 245, StartPos: 4846, EndPos: 4848, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4846, + EndPos: 4848, + }, + }, + Value: []byte("a"), }, }, - IfTrue: &expr.Ternary{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4851, - EndPos: 4863, - }, - Condition: &expr.Variable{ + IfTrue: &ast.ExprTernary{ + Node: ast.Node{ Position: &position.Position{ StartLine: 245, EndLine: 245, StartPos: 4851, - EndPos: 4853, + EndPos: 4863, }, - VarName: &node.Identifier{ + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 245, EndLine: 245, StartPos: 4851, EndPos: 4853, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4851, + EndPos: 4853, + }, + }, + Value: []byte("b"), }, }, - IfTrue: &expr.Variable{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4856, - EndPos: 4858, - }, - VarName: &node.Identifier{ + IfTrue: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 245, EndLine: 245, StartPos: 4856, EndPos: 4858, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4856, + EndPos: 4858, + }, + }, + Value: []byte("c"), }, }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4861, - EndPos: 4863, - }, - VarName: &node.Identifier{ + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 245, EndLine: 245, StartPos: 4861, EndPos: 4863, }, - Value: "d", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4861, + EndPos: 4863, + }, + }, + Value: []byte("d"), }, }, }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4866, - EndPos: 4868, - }, - VarName: &node.Identifier{ + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 245, EndLine: 245, StartPos: 4866, EndPos: 4868, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4866, + EndPos: 4868, + }, + }, + Value: []byte("e"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4872, - EndPos: 4895, - }, - Expr: &expr.Ternary{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 246, EndLine: 246, StartPos: 4872, - EndPos: 4894, + EndPos: 4895, }, - Condition: &expr.Ternary{ + }, + Expr: &ast.ExprTernary{ + Node: ast.Node{ Position: &position.Position{ StartLine: 246, EndLine: 246, StartPos: 4872, - EndPos: 4884, + EndPos: 4894, }, - Condition: &expr.Variable{ + }, + Condition: &ast.ExprTernary{ + Node: ast.Node{ Position: &position.Position{ StartLine: 246, EndLine: 246, StartPos: 4872, - EndPos: 4874, + EndPos: 4884, }, - VarName: &node.Identifier{ + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 246, EndLine: 246, StartPos: 4872, EndPos: 4874, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4872, + EndPos: 4874, + }, + }, + Value: []byte("a"), }, }, - IfTrue: &expr.Variable{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4877, - EndPos: 4879, - }, - VarName: &node.Identifier{ + IfTrue: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 246, EndLine: 246, StartPos: 4877, EndPos: 4879, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4877, + EndPos: 4879, + }, + }, + Value: []byte("b"), }, }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4882, - EndPos: 4884, - }, - VarName: &node.Identifier{ + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 246, EndLine: 246, StartPos: 4882, EndPos: 4884, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4882, + EndPos: 4884, + }, + }, + Value: []byte("c"), }, }, }, - IfTrue: &expr.Variable{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4887, - EndPos: 4889, - }, - VarName: &node.Identifier{ + IfTrue: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 246, EndLine: 246, StartPos: 4887, EndPos: 4889, }, - Value: "d", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4887, + EndPos: 4889, + }, + }, + Value: []byte("d"), }, }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4892, - EndPos: 4894, - }, - VarName: &node.Identifier{ + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 246, EndLine: 246, StartPos: 4892, EndPos: 4894, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4892, + EndPos: 4894, + }, + }, + Value: []byte("e"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4898, - EndPos: 4902, - }, - Expr: &expr.UnaryMinus{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 247, EndLine: 247, StartPos: 4898, - EndPos: 4901, + EndPos: 4902, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprUnaryMinus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 247, EndLine: 247, - StartPos: 4899, + StartPos: 4898, EndPos: 4901, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 247, EndLine: 247, StartPos: 4899, EndPos: 4901, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4899, + EndPos: 4901, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4905, - EndPos: 4909, - }, - Expr: &expr.UnaryPlus{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 248, EndLine: 248, StartPos: 4905, - EndPos: 4908, + EndPos: 4909, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprUnaryPlus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 248, EndLine: 248, - StartPos: 4906, + StartPos: 4905, EndPos: 4908, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 248, EndLine: 248, StartPos: 4906, EndPos: 4908, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4906, + EndPos: 4908, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4912, - EndPos: 4916, - }, - Expr: &expr.Variable{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 249, EndLine: 249, StartPos: 4912, - EndPos: 4915, + EndPos: 4916, }, - VarName: &expr.Variable{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 249, EndLine: 249, - StartPos: 4913, + StartPos: 4912, EndPos: 4915, }, - VarName: &node.Identifier{ + }, + VarName: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 249, EndLine: 249, StartPos: 4913, EndPos: 4915, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4913, + EndPos: 4915, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4919, - EndPos: 4924, - }, - Expr: &expr.Variable{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 250, EndLine: 250, StartPos: 4919, - EndPos: 4923, + EndPos: 4924, }, - VarName: &expr.Variable{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 250, EndLine: 250, - StartPos: 4920, + StartPos: 4919, EndPos: 4923, }, - VarName: &expr.Variable{ + }, + VarName: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 250, EndLine: 250, - StartPos: 4921, + StartPos: 4920, EndPos: 4923, }, - VarName: &node.Identifier{ + }, + VarName: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 250, EndLine: 250, StartPos: 4921, EndPos: 4923, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4921, + EndPos: 4923, + }, + }, + Value: []byte("a"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4927, - EndPos: 4933, - }, - Expr: &expr.Yield{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 251, EndLine: 251, StartPos: 4927, - EndPos: 4932, + EndPos: 4933, + }, + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4927, + EndPos: 4932, + }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4936, - EndPos: 4945, - }, - Expr: &expr.Yield{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 252, EndLine: 252, StartPos: 4936, - EndPos: 4944, + EndPos: 4945, }, - Value: &expr.Variable{ + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ Position: &position.Position{ StartLine: 252, EndLine: 252, - StartPos: 4942, + StartPos: 4936, EndPos: 4944, }, - VarName: &node.Identifier{ + }, + Value: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 252, EndLine: 252, StartPos: 4942, EndPos: 4944, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4942, + EndPos: 4944, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4948, - EndPos: 4963, - }, - Expr: &expr.Yield{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 253, EndLine: 253, StartPos: 4948, - EndPos: 4962, + EndPos: 4963, }, - Key: &expr.Variable{ + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ Position: &position.Position{ StartLine: 253, EndLine: 253, - StartPos: 4954, - EndPos: 4956, + StartPos: 4948, + EndPos: 4962, }, - VarName: &node.Identifier{ + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 253, EndLine: 253, StartPos: 4954, EndPos: 4956, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4954, + EndPos: 4956, + }, + }, + Value: []byte("a"), }, }, - Value: &expr.Variable{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4960, - EndPos: 4962, - }, - VarName: &node.Identifier{ + Value: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 253, EndLine: 253, StartPos: 4960, EndPos: 4962, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4960, + EndPos: 4962, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4966, - EndPos: 4983, - }, - Expr: &expr.Yield{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 254, EndLine: 254, StartPos: 4966, - EndPos: 4982, + EndPos: 4983, }, - Value: &expr.ClassConstFetch{ + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ Position: &position.Position{ StartLine: 254, EndLine: 254, - StartPos: 4972, + StartPos: 4966, EndPos: 4982, }, - Class: &name.Name{ + }, + Value: &ast.ExprClassConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 254, EndLine: 254, StartPos: 4972, - EndPos: 4975, + EndPos: 4982, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4972, - EndPos: 4975, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4972, + EndPos: 4975, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4972, + EndPos: 4975, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4977, - EndPos: 4982, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4977, + EndPos: 4982, + }, }, - Value: "class", + Value: []byte("class"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4986, - EndPos: 5009, - }, - Expr: &expr.Yield{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 255, EndLine: 255, StartPos: 4986, - EndPos: 5008, + EndPos: 5009, }, - Key: &expr.Variable{ + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ Position: &position.Position{ StartLine: 255, EndLine: 255, - StartPos: 4992, - EndPos: 4994, + StartPos: 4986, + EndPos: 5008, }, - VarName: &node.Identifier{ + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 255, EndLine: 255, StartPos: 4992, EndPos: 4994, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 4992, + EndPos: 4994, + }, + }, + Value: []byte("a"), }, }, - Value: &expr.ClassConstFetch{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4998, - EndPos: 5008, - }, - Class: &name.Name{ + Value: &ast.ExprClassConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 255, EndLine: 255, StartPos: 4998, - EndPos: 5001, + EndPos: 5008, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4998, - EndPos: 5001, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 4998, + EndPos: 5001, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 4998, + EndPos: 5001, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 5003, - EndPos: 5008, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5003, + EndPos: 5008, + }, }, - Value: "class", + Value: []byte("class"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 5015, - EndPos: 5025, - }, - Expr: &cast.Array{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 257, EndLine: 257, StartPos: 5015, - EndPos: 5024, + EndPos: 5025, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastArray{ + Node: ast.Node{ Position: &position.Position{ StartLine: 257, EndLine: 257, - StartPos: 5022, + StartPos: 5015, EndPos: 5024, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 257, EndLine: 257, StartPos: 5022, EndPos: 5024, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5022, + EndPos: 5024, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 258, - EndLine: 258, - StartPos: 5028, - EndPos: 5040, - }, - Expr: &cast.Bool{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 258, EndLine: 258, StartPos: 5028, - EndPos: 5039, + EndPos: 5040, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastBool{ + Node: ast.Node{ Position: &position.Position{ StartLine: 258, EndLine: 258, - StartPos: 5037, + StartPos: 5028, EndPos: 5039, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 258, EndLine: 258, StartPos: 5037, EndPos: 5039, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 258, + EndLine: 258, + StartPos: 5037, + EndPos: 5039, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 5043, - EndPos: 5052, - }, - Expr: &cast.Bool{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 259, EndLine: 259, StartPos: 5043, - EndPos: 5051, + EndPos: 5052, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastBool{ + Node: ast.Node{ Position: &position.Position{ StartLine: 259, EndLine: 259, - StartPos: 5049, + StartPos: 5043, EndPos: 5051, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 259, EndLine: 259, StartPos: 5049, EndPos: 5051, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 259, + EndLine: 259, + StartPos: 5049, + EndPos: 5051, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 5055, - EndPos: 5066, - }, - Expr: &cast.Double{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 260, EndLine: 260, StartPos: 5055, - EndPos: 5065, + EndPos: 5066, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastDouble{ + Node: ast.Node{ Position: &position.Position{ StartLine: 260, EndLine: 260, - StartPos: 5063, + StartPos: 5055, EndPos: 5065, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 260, EndLine: 260, StartPos: 5063, EndPos: 5065, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5063, + EndPos: 5065, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 5069, - EndPos: 5079, - }, - Expr: &cast.Double{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 261, EndLine: 261, StartPos: 5069, - EndPos: 5078, + EndPos: 5079, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastDouble{ + Node: ast.Node{ Position: &position.Position{ StartLine: 261, EndLine: 261, - StartPos: 5076, + StartPos: 5069, EndPos: 5078, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 261, EndLine: 261, StartPos: 5076, EndPos: 5078, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5076, + EndPos: 5078, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 262, - EndLine: 262, - StartPos: 5082, - EndPos: 5094, - }, - Expr: &cast.Int{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 262, EndLine: 262, StartPos: 5082, - EndPos: 5093, + EndPos: 5094, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastInt{ + Node: ast.Node{ Position: &position.Position{ StartLine: 262, EndLine: 262, - StartPos: 5091, + StartPos: 5082, EndPos: 5093, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 262, EndLine: 262, StartPos: 5091, EndPos: 5093, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 262, + EndLine: 262, + StartPos: 5091, + EndPos: 5093, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 5097, - EndPos: 5105, - }, - Expr: &cast.Int{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 263, EndLine: 263, StartPos: 5097, - EndPos: 5104, + EndPos: 5105, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastInt{ + Node: ast.Node{ Position: &position.Position{ StartLine: 263, EndLine: 263, - StartPos: 5102, + StartPos: 5097, EndPos: 5104, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 263, EndLine: 263, StartPos: 5102, EndPos: 5104, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 263, + EndLine: 263, + StartPos: 5102, + EndPos: 5104, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 5108, - EndPos: 5119, - }, - Expr: &cast.Object{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 264, EndLine: 264, StartPos: 5108, - EndPos: 5118, + EndPos: 5119, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastObject{ + Node: ast.Node{ Position: &position.Position{ StartLine: 264, EndLine: 264, - StartPos: 5116, + StartPos: 5108, EndPos: 5118, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 264, EndLine: 264, StartPos: 5116, EndPos: 5118, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5116, + EndPos: 5118, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 5122, - EndPos: 5133, - }, - Expr: &cast.String{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 265, EndLine: 265, StartPos: 5122, - EndPos: 5132, + EndPos: 5133, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastString{ + Node: ast.Node{ Position: &position.Position{ StartLine: 265, EndLine: 265, - StartPos: 5130, + StartPos: 5122, EndPos: 5132, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 265, EndLine: 265, StartPos: 5130, EndPos: 5132, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5130, + EndPos: 5132, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 5136, - EndPos: 5146, - }, - Expr: &cast.Unset{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 266, EndLine: 266, StartPos: 5136, - EndPos: 5145, + EndPos: 5146, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastUnset{ + Node: ast.Node{ Position: &position.Position{ StartLine: 266, EndLine: 266, - StartPos: 5143, + StartPos: 5136, EndPos: 5145, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 266, EndLine: 266, StartPos: 5143, EndPos: 5145, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5143, + EndPos: 5145, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 5150, - EndPos: 5158, - }, - Expr: &binary.BitwiseAnd{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 268, EndLine: 268, StartPos: 5150, - EndPos: 5157, + EndPos: 5158, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryBitwiseAnd{ + Node: ast.Node{ Position: &position.Position{ StartLine: 268, EndLine: 268, StartPos: 5150, - EndPos: 5152, + EndPos: 5157, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 268, EndLine: 268, StartPos: 5150, EndPos: 5152, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5150, + EndPos: 5152, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 5155, - EndPos: 5157, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 268, EndLine: 268, StartPos: 5155, EndPos: 5157, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5155, + EndPos: 5157, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 5161, - EndPos: 5169, - }, - Expr: &binary.BitwiseOr{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 269, EndLine: 269, StartPos: 5161, - EndPos: 5168, + EndPos: 5169, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryBitwiseOr{ + Node: ast.Node{ Position: &position.Position{ StartLine: 269, EndLine: 269, StartPos: 5161, - EndPos: 5163, + EndPos: 5168, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 269, EndLine: 269, StartPos: 5161, EndPos: 5163, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 269, + EndLine: 269, + StartPos: 5161, + EndPos: 5163, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 5166, - EndPos: 5168, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 269, EndLine: 269, StartPos: 5166, EndPos: 5168, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 269, + EndLine: 269, + StartPos: 5166, + EndPos: 5168, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 5172, - EndPos: 5180, - }, - Expr: &binary.BitwiseXor{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 270, EndLine: 270, StartPos: 5172, - EndPos: 5179, + EndPos: 5180, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryBitwiseXor{ + Node: ast.Node{ Position: &position.Position{ StartLine: 270, EndLine: 270, StartPos: 5172, - EndPos: 5174, + EndPos: 5179, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 270, EndLine: 270, StartPos: 5172, EndPos: 5174, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5172, + EndPos: 5174, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 5177, - EndPos: 5179, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 270, EndLine: 270, StartPos: 5177, EndPos: 5179, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5177, + EndPos: 5179, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 5183, - EndPos: 5192, - }, - Expr: &binary.BooleanAnd{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 271, EndLine: 271, StartPos: 5183, - EndPos: 5191, + EndPos: 5192, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryBooleanAnd{ + Node: ast.Node{ Position: &position.Position{ StartLine: 271, EndLine: 271, StartPos: 5183, - EndPos: 5185, + EndPos: 5191, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 271, EndLine: 271, StartPos: 5183, EndPos: 5185, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5183, + EndPos: 5185, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 5189, - EndPos: 5191, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 271, EndLine: 271, StartPos: 5189, EndPos: 5191, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5189, + EndPos: 5191, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 5195, - EndPos: 5204, - }, - Expr: &binary.BooleanOr{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 272, EndLine: 272, StartPos: 5195, - EndPos: 5203, + EndPos: 5204, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryBooleanOr{ + Node: ast.Node{ Position: &position.Position{ StartLine: 272, EndLine: 272, StartPos: 5195, - EndPos: 5197, + EndPos: 5203, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 272, EndLine: 272, StartPos: 5195, EndPos: 5197, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5195, + EndPos: 5197, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 5201, - EndPos: 5203, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 272, EndLine: 272, StartPos: 5201, EndPos: 5203, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5201, + EndPos: 5203, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 273, - EndLine: 273, - StartPos: 5207, - EndPos: 5215, - }, - Expr: &binary.Concat{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 273, EndLine: 273, StartPos: 5207, - EndPos: 5214, + EndPos: 5215, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryConcat{ + Node: ast.Node{ Position: &position.Position{ StartLine: 273, EndLine: 273, StartPos: 5207, - EndPos: 5209, + EndPos: 5214, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 273, EndLine: 273, StartPos: 5207, EndPos: 5209, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 273, + EndLine: 273, + StartPos: 5207, + EndPos: 5209, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 273, - EndLine: 273, - StartPos: 5212, - EndPos: 5214, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 273, EndLine: 273, StartPos: 5212, EndPos: 5214, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 273, + EndLine: 273, + StartPos: 5212, + EndPos: 5214, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 5218, - EndPos: 5226, - }, - Expr: &binary.Div{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 274, EndLine: 274, StartPos: 5218, - EndPos: 5225, + EndPos: 5226, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryDiv{ + Node: ast.Node{ Position: &position.Position{ StartLine: 274, EndLine: 274, StartPos: 5218, - EndPos: 5220, + EndPos: 5225, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 274, EndLine: 274, StartPos: 5218, EndPos: 5220, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5218, + EndPos: 5220, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 5223, - EndPos: 5225, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 274, EndLine: 274, StartPos: 5223, EndPos: 5225, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5223, + EndPos: 5225, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 5229, - EndPos: 5238, - }, - Expr: &binary.Equal{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 275, EndLine: 275, StartPos: 5229, - EndPos: 5237, + EndPos: 5238, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryEqual{ + Node: ast.Node{ Position: &position.Position{ StartLine: 275, EndLine: 275, StartPos: 5229, - EndPos: 5231, + EndPos: 5237, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 275, EndLine: 275, StartPos: 5229, EndPos: 5231, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5229, + EndPos: 5231, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 5235, - EndPos: 5237, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 275, EndLine: 275, StartPos: 5235, EndPos: 5237, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5235, + EndPos: 5237, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 5241, - EndPos: 5250, - }, - Expr: &binary.GreaterOrEqual{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 276, EndLine: 276, StartPos: 5241, - EndPos: 5249, + EndPos: 5250, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryGreaterOrEqual{ + Node: ast.Node{ Position: &position.Position{ StartLine: 276, EndLine: 276, StartPos: 5241, - EndPos: 5243, + EndPos: 5249, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 276, EndLine: 276, StartPos: 5241, EndPos: 5243, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5241, + EndPos: 5243, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 5247, - EndPos: 5249, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 276, EndLine: 276, StartPos: 5247, EndPos: 5249, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5247, + EndPos: 5249, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 5253, - EndPos: 5261, - }, - Expr: &binary.Greater{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 277, EndLine: 277, StartPos: 5253, - EndPos: 5260, + EndPos: 5261, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryGreater{ + Node: ast.Node{ Position: &position.Position{ StartLine: 277, EndLine: 277, StartPos: 5253, - EndPos: 5255, + EndPos: 5260, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 277, EndLine: 277, StartPos: 5253, EndPos: 5255, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5253, + EndPos: 5255, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 5258, - EndPos: 5260, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 277, EndLine: 277, StartPos: 5258, EndPos: 5260, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5258, + EndPos: 5260, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 5264, - EndPos: 5274, - }, - Expr: &binary.Identical{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 278, EndLine: 278, StartPos: 5264, - EndPos: 5273, + EndPos: 5274, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryIdentical{ + Node: ast.Node{ Position: &position.Position{ StartLine: 278, EndLine: 278, StartPos: 5264, - EndPos: 5266, + EndPos: 5273, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 278, EndLine: 278, StartPos: 5264, EndPos: 5266, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5264, + EndPos: 5266, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 5271, - EndPos: 5273, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 278, EndLine: 278, StartPos: 5271, EndPos: 5273, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5271, + EndPos: 5273, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 5277, - EndPos: 5287, - }, - Expr: &binary.LogicalAnd{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 279, EndLine: 279, StartPos: 5277, - EndPos: 5286, + EndPos: 5287, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryLogicalAnd{ + Node: ast.Node{ Position: &position.Position{ StartLine: 279, EndLine: 279, StartPos: 5277, - EndPos: 5279, + EndPos: 5286, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 279, EndLine: 279, StartPos: 5277, EndPos: 5279, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5277, + EndPos: 5279, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 5284, - EndPos: 5286, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 279, EndLine: 279, StartPos: 5284, EndPos: 5286, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5284, + EndPos: 5286, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 5290, - EndPos: 5299, - }, - Expr: &binary.LogicalOr{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 280, EndLine: 280, StartPos: 5290, - EndPos: 5298, + EndPos: 5299, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryLogicalOr{ + Node: ast.Node{ Position: &position.Position{ StartLine: 280, EndLine: 280, StartPos: 5290, - EndPos: 5292, + EndPos: 5298, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 280, EndLine: 280, StartPos: 5290, EndPos: 5292, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5290, + EndPos: 5292, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 5296, - EndPos: 5298, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 280, EndLine: 280, StartPos: 5296, EndPos: 5298, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5296, + EndPos: 5298, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 5302, - EndPos: 5312, - }, - Expr: &binary.LogicalXor{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 281, EndLine: 281, StartPos: 5302, - EndPos: 5311, + EndPos: 5312, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryLogicalXor{ + Node: ast.Node{ Position: &position.Position{ StartLine: 281, EndLine: 281, StartPos: 5302, - EndPos: 5304, + EndPos: 5311, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 281, EndLine: 281, StartPos: 5302, EndPos: 5304, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5302, + EndPos: 5304, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 5309, - EndPos: 5311, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 281, EndLine: 281, StartPos: 5309, EndPos: 5311, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5309, + EndPos: 5311, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 5315, - EndPos: 5323, - }, - Expr: &binary.Minus{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 282, EndLine: 282, StartPos: 5315, - EndPos: 5322, + EndPos: 5323, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryMinus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 282, EndLine: 282, StartPos: 5315, - EndPos: 5317, + EndPos: 5322, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 282, EndLine: 282, StartPos: 5315, EndPos: 5317, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5315, + EndPos: 5317, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 5320, - EndPos: 5322, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 282, EndLine: 282, StartPos: 5320, EndPos: 5322, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5320, + EndPos: 5322, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 5326, - EndPos: 5334, - }, - Expr: &binary.Mod{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 283, EndLine: 283, StartPos: 5326, - EndPos: 5333, + EndPos: 5334, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryMod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 283, EndLine: 283, StartPos: 5326, - EndPos: 5328, + EndPos: 5333, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 283, EndLine: 283, StartPos: 5326, EndPos: 5328, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5326, + EndPos: 5328, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 5331, - EndPos: 5333, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 283, EndLine: 283, StartPos: 5331, EndPos: 5333, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5331, + EndPos: 5333, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 5337, - EndPos: 5345, - }, - Expr: &binary.Mul{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 284, EndLine: 284, StartPos: 5337, - EndPos: 5344, + EndPos: 5345, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryMul{ + Node: ast.Node{ Position: &position.Position{ StartLine: 284, EndLine: 284, StartPos: 5337, - EndPos: 5339, + EndPos: 5344, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 284, EndLine: 284, StartPos: 5337, EndPos: 5339, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5337, + EndPos: 5339, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 5342, - EndPos: 5344, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 284, EndLine: 284, StartPos: 5342, EndPos: 5344, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5342, + EndPos: 5344, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 5348, - EndPos: 5357, - }, - Expr: &binary.NotEqual{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 285, EndLine: 285, StartPos: 5348, - EndPos: 5356, + EndPos: 5357, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryNotEqual{ + Node: ast.Node{ Position: &position.Position{ StartLine: 285, EndLine: 285, StartPos: 5348, - EndPos: 5350, + EndPos: 5356, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 285, EndLine: 285, StartPos: 5348, EndPos: 5350, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5348, + EndPos: 5350, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 5354, - EndPos: 5356, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 285, EndLine: 285, StartPos: 5354, EndPos: 5356, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5354, + EndPos: 5356, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 5360, - EndPos: 5370, - }, - Expr: &binary.NotIdentical{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 286, EndLine: 286, StartPos: 5360, - EndPos: 5369, + EndPos: 5370, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryNotIdentical{ + Node: ast.Node{ Position: &position.Position{ StartLine: 286, EndLine: 286, StartPos: 5360, - EndPos: 5362, + EndPos: 5369, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 286, EndLine: 286, StartPos: 5360, EndPos: 5362, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5360, + EndPos: 5362, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 5367, - EndPos: 5369, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 286, EndLine: 286, StartPos: 5367, EndPos: 5369, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5367, + EndPos: 5369, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 5373, - EndPos: 5381, - }, - Expr: &binary.Plus{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 287, EndLine: 287, StartPos: 5373, - EndPos: 5380, + EndPos: 5381, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryPlus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 287, EndLine: 287, StartPos: 5373, - EndPos: 5375, + EndPos: 5380, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 287, EndLine: 287, StartPos: 5373, EndPos: 5375, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5373, + EndPos: 5375, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 5378, - EndPos: 5380, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 287, EndLine: 287, StartPos: 5378, EndPos: 5380, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5378, + EndPos: 5380, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 5384, - EndPos: 5393, - }, - Expr: &binary.Pow{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 288, EndLine: 288, StartPos: 5384, - EndPos: 5392, + EndPos: 5393, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryPow{ + Node: ast.Node{ Position: &position.Position{ StartLine: 288, EndLine: 288, StartPos: 5384, - EndPos: 5386, + EndPos: 5392, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 288, EndLine: 288, StartPos: 5384, EndPos: 5386, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5384, + EndPos: 5386, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 5390, - EndPos: 5392, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 288, EndLine: 288, StartPos: 5390, EndPos: 5392, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5390, + EndPos: 5392, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 5396, - EndPos: 5405, - }, - Expr: &binary.ShiftLeft{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 289, EndLine: 289, StartPos: 5396, - EndPos: 5404, + EndPos: 5405, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryShiftLeft{ + Node: ast.Node{ Position: &position.Position{ StartLine: 289, EndLine: 289, StartPos: 5396, - EndPos: 5398, + EndPos: 5404, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 289, EndLine: 289, StartPos: 5396, EndPos: 5398, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5396, + EndPos: 5398, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 5402, - EndPos: 5404, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 289, EndLine: 289, StartPos: 5402, EndPos: 5404, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5402, + EndPos: 5404, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 5408, - EndPos: 5417, - }, - Expr: &binary.ShiftRight{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 290, EndLine: 290, StartPos: 5408, - EndPos: 5416, + EndPos: 5417, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryShiftRight{ + Node: ast.Node{ Position: &position.Position{ StartLine: 290, EndLine: 290, StartPos: 5408, - EndPos: 5410, + EndPos: 5416, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 290, EndLine: 290, StartPos: 5408, EndPos: 5410, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5408, + EndPos: 5410, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 5414, - EndPos: 5416, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 290, EndLine: 290, StartPos: 5414, EndPos: 5416, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5414, + EndPos: 5416, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 5420, - EndPos: 5429, - }, - Expr: &binary.SmallerOrEqual{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 291, EndLine: 291, StartPos: 5420, - EndPos: 5428, + EndPos: 5429, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinarySmallerOrEqual{ + Node: ast.Node{ Position: &position.Position{ StartLine: 291, EndLine: 291, StartPos: 5420, - EndPos: 5422, + EndPos: 5428, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 291, EndLine: 291, StartPos: 5420, EndPos: 5422, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5420, + EndPos: 5422, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 5426, - EndPos: 5428, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 291, EndLine: 291, StartPos: 5426, EndPos: 5428, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5426, + EndPos: 5428, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 5432, - EndPos: 5440, - }, - Expr: &binary.Smaller{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 292, EndLine: 292, StartPos: 5432, - EndPos: 5439, + EndPos: 5440, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinarySmaller{ + Node: ast.Node{ Position: &position.Position{ StartLine: 292, EndLine: 292, StartPos: 5432, - EndPos: 5434, + EndPos: 5439, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 292, EndLine: 292, StartPos: 5432, EndPos: 5434, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5432, + EndPos: 5434, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 5437, - EndPos: 5439, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 292, EndLine: 292, StartPos: 5437, EndPos: 5439, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5437, + EndPos: 5439, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 5444, - EndPos: 5453, - }, - Expr: &assign.Reference{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 294, EndLine: 294, StartPos: 5444, - EndPos: 5452, + EndPos: 5453, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 294, EndLine: 294, StartPos: 5444, - EndPos: 5446, + EndPos: 5452, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 294, EndLine: 294, StartPos: 5444, EndPos: 5446, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5444, + EndPos: 5446, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 5450, - EndPos: 5452, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 294, EndLine: 294, StartPos: 5450, EndPos: 5452, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5450, + EndPos: 5452, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5456, - EndPos: 5470, - }, - Expr: &assign.Reference{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 295, EndLine: 295, StartPos: 5456, - EndPos: 5469, + EndPos: 5470, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 295, EndLine: 295, StartPos: 5456, - EndPos: 5458, + EndPos: 5469, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 295, EndLine: 295, StartPos: 5456, EndPos: 5458, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5456, + EndPos: 5458, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.New{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5462, - EndPos: 5469, - }, - Class: &name.Name{ + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 295, EndLine: 295, - StartPos: 5466, + StartPos: 5462, EndPos: 5469, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5466, - EndPos: 5469, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5466, + EndPos: 5469, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5466, + EndPos: 5469, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5473, - EndPos: 5491, - }, - Expr: &assign.Reference{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 296, EndLine: 296, StartPos: 5473, - EndPos: 5490, + EndPos: 5491, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 296, EndLine: 296, StartPos: 5473, - EndPos: 5475, + EndPos: 5490, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 296, EndLine: 296, StartPos: 5473, EndPos: 5475, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5473, + EndPos: 5475, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.New{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5479, - EndPos: 5490, - }, - Class: &name.Name{ + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 296, EndLine: 296, - StartPos: 5483, - EndPos: 5486, + StartPos: 5479, + EndPos: 5490, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5483, - EndPos: 5486, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5483, + EndPos: 5486, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5483, + EndPos: 5486, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5486, - EndPos: 5490, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5486, + EndPos: 5490, + }, }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5487, - EndPos: 5489, - }, - IsReference: false, - Variadic: false, - Expr: &expr.Variable{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 296, EndLine: 296, StartPos: 5487, EndPos: 5489, }, - VarName: &node.Identifier{ + }, + IsReference: false, + Variadic: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 296, EndLine: 296, StartPos: 5487, EndPos: 5489, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5487, + EndPos: 5489, + }, + }, + Value: []byte("b"), }, }, }, @@ -13928,765 +16942,885 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 5494, - EndPos: 5502, - }, - Expr: &assign.Assign{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 297, EndLine: 297, StartPos: 5494, - EndPos: 5501, + EndPos: 5502, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ Position: &position.Position{ StartLine: 297, EndLine: 297, StartPos: 5494, - EndPos: 5496, + EndPos: 5501, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 297, EndLine: 297, StartPos: 5494, EndPos: 5496, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5494, + EndPos: 5496, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 5499, - EndPos: 5501, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 297, EndLine: 297, StartPos: 5499, EndPos: 5501, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5499, + EndPos: 5501, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 5505, - EndPos: 5514, - }, - Expr: &assign.BitwiseAnd{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 298, EndLine: 298, StartPos: 5505, - EndPos: 5513, + EndPos: 5514, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignBitwiseAnd{ + Node: ast.Node{ Position: &position.Position{ StartLine: 298, EndLine: 298, StartPos: 5505, - EndPos: 5507, + EndPos: 5513, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 298, EndLine: 298, StartPos: 5505, EndPos: 5507, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5505, + EndPos: 5507, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 5511, - EndPos: 5513, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 298, EndLine: 298, StartPos: 5511, EndPos: 5513, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5511, + EndPos: 5513, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5517, - EndPos: 5526, - }, - Expr: &assign.BitwiseOr{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 299, EndLine: 299, StartPos: 5517, - EndPos: 5525, + EndPos: 5526, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignBitwiseOr{ + Node: ast.Node{ Position: &position.Position{ StartLine: 299, EndLine: 299, StartPos: 5517, - EndPos: 5519, + EndPos: 5525, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 299, EndLine: 299, StartPos: 5517, EndPos: 5519, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5517, + EndPos: 5519, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5523, - EndPos: 5525, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 299, EndLine: 299, StartPos: 5523, EndPos: 5525, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5523, + EndPos: 5525, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5529, - EndPos: 5538, - }, - Expr: &assign.BitwiseXor{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 300, EndLine: 300, StartPos: 5529, - EndPos: 5537, + EndPos: 5538, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignBitwiseXor{ + Node: ast.Node{ Position: &position.Position{ StartLine: 300, EndLine: 300, StartPos: 5529, - EndPos: 5531, + EndPos: 5537, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 300, EndLine: 300, StartPos: 5529, EndPos: 5531, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5529, + EndPos: 5531, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5535, - EndPos: 5537, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 300, EndLine: 300, StartPos: 5535, EndPos: 5537, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5535, + EndPos: 5537, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 301, - EndLine: 301, - StartPos: 5541, - EndPos: 5550, - }, - Expr: &assign.Concat{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 301, EndLine: 301, StartPos: 5541, - EndPos: 5549, + EndPos: 5550, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignConcat{ + Node: ast.Node{ Position: &position.Position{ StartLine: 301, EndLine: 301, StartPos: 5541, - EndPos: 5543, + EndPos: 5549, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 301, EndLine: 301, StartPos: 5541, EndPos: 5543, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 301, + EndLine: 301, + StartPos: 5541, + EndPos: 5543, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 301, - EndLine: 301, - StartPos: 5547, - EndPos: 5549, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 301, EndLine: 301, StartPos: 5547, EndPos: 5549, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 301, + EndLine: 301, + StartPos: 5547, + EndPos: 5549, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5553, - EndPos: 5562, - }, - Expr: &assign.Div{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 302, EndLine: 302, StartPos: 5553, - EndPos: 5561, + EndPos: 5562, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignDiv{ + Node: ast.Node{ Position: &position.Position{ StartLine: 302, EndLine: 302, StartPos: 5553, - EndPos: 5555, + EndPos: 5561, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 302, EndLine: 302, StartPos: 5553, EndPos: 5555, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5553, + EndPos: 5555, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5559, - EndPos: 5561, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 302, EndLine: 302, StartPos: 5559, EndPos: 5561, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5559, + EndPos: 5561, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5565, - EndPos: 5574, - }, - Expr: &assign.Minus{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 303, EndLine: 303, StartPos: 5565, - EndPos: 5573, + EndPos: 5574, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignMinus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 303, EndLine: 303, StartPos: 5565, - EndPos: 5567, + EndPos: 5573, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 303, EndLine: 303, StartPos: 5565, EndPos: 5567, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5565, + EndPos: 5567, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5571, - EndPos: 5573, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 303, EndLine: 303, StartPos: 5571, EndPos: 5573, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5571, + EndPos: 5573, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5577, - EndPos: 5586, - }, - Expr: &assign.Mod{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 304, EndLine: 304, StartPos: 5577, - EndPos: 5585, + EndPos: 5586, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignMod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 304, EndLine: 304, StartPos: 5577, - EndPos: 5579, + EndPos: 5585, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 304, EndLine: 304, StartPos: 5577, EndPos: 5579, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5577, + EndPos: 5579, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5583, - EndPos: 5585, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 304, EndLine: 304, StartPos: 5583, EndPos: 5585, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5583, + EndPos: 5585, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5589, - EndPos: 5598, - }, - Expr: &assign.Mul{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 305, EndLine: 305, StartPos: 5589, - EndPos: 5597, + EndPos: 5598, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignMul{ + Node: ast.Node{ Position: &position.Position{ StartLine: 305, EndLine: 305, StartPos: 5589, - EndPos: 5591, + EndPos: 5597, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 305, EndLine: 305, StartPos: 5589, EndPos: 5591, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5589, + EndPos: 5591, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5595, - EndPos: 5597, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 305, EndLine: 305, StartPos: 5595, EndPos: 5597, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5595, + EndPos: 5597, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5601, - EndPos: 5610, - }, - Expr: &assign.Plus{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 306, EndLine: 306, StartPos: 5601, - EndPos: 5609, + EndPos: 5610, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignPlus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 306, EndLine: 306, StartPos: 5601, - EndPos: 5603, + EndPos: 5609, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 306, EndLine: 306, StartPos: 5601, EndPos: 5603, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5601, + EndPos: 5603, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5607, - EndPos: 5609, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 306, EndLine: 306, StartPos: 5607, EndPos: 5609, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5607, + EndPos: 5609, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5613, - EndPos: 5623, - }, - Expr: &assign.Pow{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 307, EndLine: 307, StartPos: 5613, - EndPos: 5622, + EndPos: 5623, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignPow{ + Node: ast.Node{ Position: &position.Position{ StartLine: 307, EndLine: 307, StartPos: 5613, - EndPos: 5615, + EndPos: 5622, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 307, EndLine: 307, StartPos: 5613, EndPos: 5615, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5613, + EndPos: 5615, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5620, - EndPos: 5622, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 307, EndLine: 307, StartPos: 5620, EndPos: 5622, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5620, + EndPos: 5622, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5626, - EndPos: 5636, - }, - Expr: &assign.ShiftLeft{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 308, EndLine: 308, StartPos: 5626, - EndPos: 5635, + EndPos: 5636, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignShiftLeft{ + Node: ast.Node{ Position: &position.Position{ StartLine: 308, EndLine: 308, StartPos: 5626, - EndPos: 5628, + EndPos: 5635, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 308, EndLine: 308, StartPos: 5626, EndPos: 5628, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5626, + EndPos: 5628, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5633, - EndPos: 5635, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 308, EndLine: 308, StartPos: 5633, EndPos: 5635, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5633, + EndPos: 5635, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5639, - EndPos: 5649, - }, - Expr: &assign.ShiftRight{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 309, EndLine: 309, StartPos: 5639, - EndPos: 5648, + EndPos: 5649, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignShiftRight{ + Node: ast.Node{ Position: &position.Position{ StartLine: 309, EndLine: 309, StartPos: 5639, - EndPos: 5641, + EndPos: 5648, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 309, EndLine: 309, StartPos: 5639, EndPos: 5641, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5639, + EndPos: 5641, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5646, - EndPos: 5648, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 309, EndLine: 309, StartPos: 5646, EndPos: 5648, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5646, + EndPos: 5648, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5655, - EndPos: 5667, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 312, EndLine: 312, StartPos: 5655, - EndPos: 5665, + EndPos: 5667, }, - Class: &name.FullyQualified{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 312, EndLine: 312, - StartPos: 5659, - EndPos: 5663, + StartPos: 5655, + EndPos: 5665, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5660, - EndPos: 5663, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5659, + EndPos: 5663, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5660, + EndPos: 5663, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5663, - EndPos: 5665, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5663, + EndPos: 5665, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5691, - EndPos: 5695, - }, - Expr: &expr.PropertyFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 313, EndLine: 313, StartPos: 5691, - EndPos: 5694, + EndPos: 5695, }, - Variable: &expr.MethodCall{ + }, + Expr: &ast.ExprPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 313, EndLine: 313, - StartPos: 5687, - EndPos: 5689, + StartPos: 5691, + EndPos: 5694, }, - Variable: &expr.New{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5671, - EndPos: 5681, - }, - Class: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5675, - EndPos: 5679, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5676, - EndPos: 5679, - }, - Value: "Foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5679, - EndPos: 5681, - }, - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5684, - EndPos: 5687, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ + }, + Var: &ast.ExprMethodCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 313, EndLine: 313, @@ -14694,171 +17828,190 @@ func TestPhp5(t *testing.T) { EndPos: 5689, }, }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5691, - EndPos: 5694, + Var: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5671, + EndPos: 5681, + }, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5675, + EndPos: 5679, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5676, + EndPos: 5679, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5679, + EndPos: 5681, + }, + }, + }, }, - Value: "baz", + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5684, + EndPos: 5687, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5687, + EndPos: 5689, + }, + }, + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5691, + EndPos: 5694, + }, + }, + Value: []byte("baz"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5714, - EndPos: 5717, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 314, EndLine: 314, StartPos: 5714, - EndPos: 5715, + EndPos: 5717, }, - Variable: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5711, - EndPos: 5712, - }, - Variable: &expr.New{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5699, - EndPos: 5709, - }, - Class: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5703, - EndPos: 5707, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5704, - EndPos: 5707, - }, - Value: "Foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5707, - EndPos: 5709, - }, - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5711, - EndPos: 5712, - }, - Value: "0", - }, - }, - Dim: &scalar.Lnumber{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 314, EndLine: 314, StartPos: 5714, EndPos: 5715, }, - Value: "0", + }, + Var: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5711, + EndPos: 5712, + }, + }, + Var: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5699, + EndPos: 5709, + }, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5703, + EndPos: 5707, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5704, + EndPos: 5707, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5707, + EndPos: 5709, + }, + }, + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5711, + EndPos: 5712, + }, + }, + Value: []byte("0"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5714, + EndPos: 5715, + }, + }, + Value: []byte("0"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5740, - EndPos: 5743, - }, - Expr: &expr.MethodCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 315, EndLine: 315, StartPos: 5740, - EndPos: 5742, + EndPos: 5743, }, - Variable: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5733, - EndPos: 5734, - }, - Variable: &expr.New{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5721, - EndPos: 5731, - }, - Class: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5725, - EndPos: 5729, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5726, - EndPos: 5729, - }, - Value: "Foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5729, - EndPos: 5731, - }, - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5733, - EndPos: 5734, - }, - Value: "0", - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5737, - EndPos: 5740, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ + }, + Expr: &ast.ExprMethodCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 315, EndLine: 315, @@ -14866,67 +18019,168 @@ func TestPhp5(t *testing.T) { EndPos: 5742, }, }, + Var: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5733, + EndPos: 5734, + }, + }, + Var: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5721, + EndPos: 5731, + }, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5725, + EndPos: 5729, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5726, + EndPos: 5729, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5729, + EndPos: 5731, + }, + }, + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5733, + EndPos: 5734, + }, + }, + Value: []byte("0"), + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5737, + EndPos: 5740, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5740, + EndPos: 5742, + }, + }, + }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5747, - EndPos: 5764, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 317, EndLine: 317, StartPos: 5747, - EndPos: 5763, + EndPos: 5764, }, - Variable: &expr.ArrayDimFetch{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 317, EndLine: 317, StartPos: 5747, - EndPos: 5760, + EndPos: 5763, }, - Variable: &expr.Array{ + }, + Var: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 317, EndLine: 317, StartPos: 5747, - EndPos: 5757, + EndPos: 5760, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5753, - EndPos: 5756, - }, - Val: &expr.ShortArray{ + }, + Var: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5747, + EndPos: 5757, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 317, EndLine: 317, StartPos: 5753, EndPos: 5756, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5754, - EndPos: 5755, - }, - Val: &scalar.Lnumber{ + }, + Val: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5753, + EndPos: 5756, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 317, EndLine: 317, StartPos: 5754, EndPos: 5755, }, - Value: "0", + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5754, + EndPos: 5755, + }, + }, + Value: []byte("0"), }, }, }, @@ -14934,2702 +18188,3324 @@ func TestPhp5(t *testing.T) { }, }, }, - Dim: &scalar.Lnumber{ + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5758, + EndPos: 5759, + }, + }, + Value: []byte("0"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 317, EndLine: 317, - StartPos: 5758, - EndPos: 5759, + StartPos: 5761, + EndPos: 5762, }, - Value: "0", }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5761, - EndPos: 5762, - }, - Value: "0", + Value: []byte("0"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5767, - EndPos: 5776, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 318, EndLine: 318, StartPos: 5767, - EndPos: 5775, + EndPos: 5776, }, - Variable: &scalar.String{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 318, EndLine: 318, StartPos: 5767, - EndPos: 5772, + EndPos: 5775, }, - Value: "\"foo\"", }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5773, - EndPos: 5774, + Var: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5767, + EndPos: 5772, + }, }, - Value: "0", + Value: []byte("\"foo\""), + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5773, + EndPos: 5774, + }, + }, + Value: []byte("0"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 319, - EndLine: 319, - StartPos: 5779, - EndPos: 5786, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 319, EndLine: 319, StartPos: 5779, - EndPos: 5785, + EndPos: 5786, }, - Variable: &expr.ConstFetch{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 319, EndLine: 319, StartPos: 5779, - EndPos: 5782, + EndPos: 5785, }, - Constant: &name.Name{ + }, + Var: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 319, EndLine: 319, StartPos: 5779, EndPos: 5782, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 319, - EndLine: 319, - StartPos: 5779, - EndPos: 5782, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5779, + EndPos: 5782, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5779, + EndPos: 5782, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 319, - EndLine: 319, - StartPos: 5783, - EndPos: 5784, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5783, + EndPos: 5784, + }, }, - Value: "0", + Value: []byte("0"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5789, - EndPos: 5801, - }, - Expr: &expr.ClassConstFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 320, EndLine: 320, StartPos: 5789, - EndPos: 5800, + EndPos: 5801, }, - Class: &node.Identifier{ + }, + Expr: &ast.ExprClassConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 320, EndLine: 320, StartPos: 5789, - EndPos: 5795, - }, - Value: "static", - }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5797, EndPos: 5800, }, - Value: "foo", + }, + Class: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5789, + EndPos: 5795, + }, + }, + Value: []byte("static"), + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5797, + EndPos: 5800, + }, + }, + Value: []byte("foo"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 322, - EndLine: 322, - StartPos: 5805, - EndPos: 5814, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 322, EndLine: 322, StartPos: 5805, - EndPos: 5813, + EndPos: 5814, }, - Class: &expr.Variable{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 322, EndLine: 322, - StartPos: 5809, + StartPos: 5805, EndPos: 5813, }, - VarName: &node.Identifier{ + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 322, EndLine: 322, StartPos: 5809, EndPos: 5813, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 322, + EndLine: 322, + StartPos: 5809, + EndPos: 5813, + }, + }, + Value: []byte("foo"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 323, - EndLine: 323, - StartPos: 5817, - EndPos: 5832, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 323, EndLine: 323, StartPos: 5817, - EndPos: 5831, + EndPos: 5832, }, - Class: &expr.StaticPropertyFetch{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 323, EndLine: 323, - StartPos: 5821, + StartPos: 5817, EndPos: 5831, }, - Class: &expr.Variable{ + }, + Class: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 323, EndLine: 323, StartPos: 5821, - EndPos: 5825, + EndPos: 5831, }, - VarName: &node.Identifier{ + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 323, EndLine: 323, StartPos: 5821, EndPos: 5825, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 323, + EndLine: 323, + StartPos: 5821, + EndPos: 5825, + }, + }, + Value: []byte("foo"), }, }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 323, - EndLine: 323, - StartPos: 5827, - EndPos: 5831, - }, - VarName: &node.Identifier{ + Property: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 323, EndLine: 323, StartPos: 5827, EndPos: 5831, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 323, + EndLine: 323, + StartPos: 5827, + EndPos: 5831, + }, + }, + Value: []byte("bar"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5835, - EndPos: 5848, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 324, EndLine: 324, StartPos: 5835, - EndPos: 5846, + EndPos: 5848, }, - Class: &expr.ArrayDimFetch{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 324, EndLine: 324, - StartPos: 5845, + StartPos: 5835, EndPos: 5846, }, - Variable: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5843, - EndPos: 5846, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5839, - EndPos: 5844, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5839, - EndPos: 5841, - }, - Value: "a", - }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5843, - EndPos: 5844, - }, - Value: "b", - }, - }, - Dim: &scalar.Lnumber{ + }, + Class: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 324, EndLine: 324, StartPos: 5845, EndPos: 5846, }, - Value: "0", + }, + Var: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5843, + EndPos: 5846, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5839, + EndPos: 5844, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5839, + EndPos: 5841, + }, + }, + Value: []byte("a"), + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5843, + EndPos: 5844, + }, + }, + Value: []byte("b"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5845, + EndPos: 5846, + }, + }, + Value: []byte("0"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5851, - EndPos: 5883, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 325, EndLine: 325, StartPos: 5851, - EndPos: 5881, + EndPos: 5883, }, - Class: &expr.ArrayDimFetch{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 325, EndLine: 325, - StartPos: 5880, + StartPos: 5851, EndPos: 5881, }, - Variable: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5878, - EndPos: 5881, - }, - Variable: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5874, - EndPos: 5879, - }, - Variable: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5861, - EndPos: 5876, - }, - Variable: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5859, - EndPos: 5871, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5855, - EndPos: 5860, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5855, - EndPos: 5857, - }, - Value: "a", - }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5859, - EndPos: 5860, - }, - Value: "b", - }, - }, - Dim: &expr.Ternary{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5861, - EndPos: 5871, - }, - Condition: &expr.Variable{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5861, - EndPos: 5863, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5861, - EndPos: 5863, - }, - Value: "b", - }, - }, - IfFalse: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5867, - EndPos: 5871, - }, - Constant: &name.Name{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5867, - EndPos: 5871, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5867, - EndPos: 5871, - }, - Value: "null", - }, - }, - }, - }, - }, - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5874, - EndPos: 5876, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5874, - EndPos: 5876, - }, - Value: "c", - }, - }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5878, - EndPos: 5879, - }, - Value: "d", - }, - }, - Dim: &scalar.Lnumber{ + }, + Class: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 325, EndLine: 325, StartPos: 5880, EndPos: 5881, }, - Value: "0", + }, + Var: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5878, + EndPos: 5881, + }, + }, + Var: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5874, + EndPos: 5879, + }, + }, + Var: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5861, + EndPos: 5876, + }, + }, + Var: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5859, + EndPos: 5871, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5855, + EndPos: 5860, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5855, + EndPos: 5857, + }, + }, + Value: []byte("a"), + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5859, + EndPos: 5860, + }, + }, + Value: []byte("b"), + }, + }, + Dim: &ast.ExprTernary{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5861, + EndPos: 5871, + }, + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5861, + EndPos: 5863, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5861, + EndPos: 5863, + }, + }, + Value: []byte("b"), + }, + }, + IfFalse: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5867, + EndPos: 5871, + }, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5867, + EndPos: 5871, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5867, + EndPos: 5871, + }, + }, + Value: []byte("null"), + }, + }, + }, + }, + }, + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5874, + EndPos: 5876, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5874, + EndPos: 5876, + }, + }, + Value: []byte("c"), + }, + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5878, + EndPos: 5879, + }, + }, + Value: []byte("d"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5880, + EndPos: 5881, + }, + }, + Value: []byte("0"), }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5883, - EndPos: 5902, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5883, + EndPos: 5902, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5890, - EndPos: 5901, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 325, EndLine: 325, StartPos: 5890, - EndPos: 5892, + EndPos: 5901, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 325, EndLine: 325, StartPos: 5890, EndPos: 5892, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5890, + EndPos: 5892, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5895, - EndPos: 5901, - }, - Variable: &expr.ShortArray{ + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 325, EndLine: 325, StartPos: 5895, - EndPos: 5898, + EndPos: 5901, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5896, - EndPos: 5897, - }, - Val: &scalar.Lnumber{ + }, + Var: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5895, + EndPos: 5898, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 325, EndLine: 325, StartPos: 5896, EndPos: 5897, }, - Value: "1", + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5896, + EndPos: 5897, + }, + }, + Value: []byte("1"), }, }, }, }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5899, - EndPos: 5900, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5899, + EndPos: 5900, + }, }, - Value: "0", + Value: []byte("0"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 327, - EndLine: 327, - StartPos: 5906, - EndPos: 5921, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5906, + EndPos: 5921, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 327, - EndLine: 327, - StartPos: 5913, - EndPos: 5920, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 327, EndLine: 327, StartPos: 5913, - EndPos: 5915, + EndPos: 5920, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 327, EndLine: 327, StartPos: 5913, EndPos: 5915, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5913, + EndPos: 5915, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.BooleanNot{ - Position: &position.Position{ - StartLine: 327, - EndLine: 327, - StartPos: 5918, - EndPos: 5920, - }, - Expr: &scalar.Lnumber{ + Expr: &ast.ExprBooleanNot{ + Node: ast.Node{ Position: &position.Position{ StartLine: 327, EndLine: 327, - StartPos: 5919, + StartPos: 5918, EndPos: 5920, }, - Value: "1", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5919, + EndPos: 5920, + }, + }, + Value: []byte("1"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5924, - EndPos: 5939, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5924, + EndPos: 5939, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5931, - EndPos: 5938, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 328, EndLine: 328, StartPos: 5931, - EndPos: 5933, + EndPos: 5938, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 328, EndLine: 328, StartPos: 5931, EndPos: 5933, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5931, + EndPos: 5933, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.BitwiseNot{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5936, - EndPos: 5938, - }, - Expr: &scalar.Lnumber{ + Expr: &ast.ExprBitwiseNot{ + Node: ast.Node{ Position: &position.Position{ StartLine: 328, EndLine: 328, - StartPos: 5937, + StartPos: 5936, EndPos: 5938, }, - Value: "1", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5937, + EndPos: 5938, + }, + }, + Value: []byte("1"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5942, - EndPos: 5957, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5942, + EndPos: 5957, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5949, - EndPos: 5956, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 329, EndLine: 329, StartPos: 5949, - EndPos: 5951, + EndPos: 5956, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 329, EndLine: 329, StartPos: 5949, EndPos: 5951, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5949, + EndPos: 5951, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.UnaryPlus{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5954, - EndPos: 5956, - }, - Expr: &scalar.Lnumber{ + Expr: &ast.ExprUnaryPlus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 329, EndLine: 329, - StartPos: 5955, + StartPos: 5954, EndPos: 5956, }, - Value: "1", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5955, + EndPos: 5956, + }, + }, + Value: []byte("1"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5960, - EndPos: 5975, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5960, + EndPos: 5975, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5967, - EndPos: 5974, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 330, EndLine: 330, StartPos: 5967, - EndPos: 5969, + EndPos: 5974, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 330, EndLine: 330, StartPos: 5967, EndPos: 5969, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5967, + EndPos: 5969, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.UnaryMinus{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5972, - EndPos: 5974, - }, - Expr: &scalar.Lnumber{ + Expr: &ast.ExprUnaryMinus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 330, EndLine: 330, - StartPos: 5973, + StartPos: 5972, EndPos: 5974, }, - Value: "1", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5973, + EndPos: 5974, + }, + }, + Value: []byte("1"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 331, - EndLine: 331, - StartPos: 5978, - EndPos: 5994, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 5978, + EndPos: 5994, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 331, - EndLine: 331, - StartPos: 5985, - EndPos: 5992, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 331, EndLine: 331, StartPos: 5985, - EndPos: 5987, + EndPos: 5992, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 331, EndLine: 331, StartPos: 5985, EndPos: 5987, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 5985, + EndPos: 5987, + }, + }, + Value: []byte("a"), }, }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 331, - EndLine: 331, - StartPos: 5991, - EndPos: 5992, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 5991, + EndPos: 5992, + }, }, - Value: "1", + Value: []byte("1"), }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 5997, - EndPos: 6016, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 5997, + EndPos: 6016, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6004, - EndPos: 6015, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 332, EndLine: 332, StartPos: 6004, - EndPos: 6006, + EndPos: 6015, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 332, EndLine: 332, StartPos: 6004, EndPos: 6006, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6004, + EndPos: 6006, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.Ternary{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6009, - EndPos: 6015, - }, - Condition: &scalar.Lnumber{ + Expr: &ast.ExprTernary{ + Node: ast.Node{ Position: &position.Position{ StartLine: 332, EndLine: 332, StartPos: 6009, - EndPos: 6010, - }, - Value: "1", - }, - IfFalse: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6014, EndPos: 6015, }, - Value: "2", + }, + Condition: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6009, + EndPos: 6010, + }, + }, + Value: []byte("1"), + }, + IfFalse: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6014, + EndPos: 6015, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6019, - EndPos: 6041, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6019, + EndPos: 6041, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6026, - EndPos: 6040, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 333, EndLine: 333, StartPos: 6026, - EndPos: 6028, + EndPos: 6040, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 333, EndLine: 333, StartPos: 6026, EndPos: 6028, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6026, + EndPos: 6028, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.Ternary{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6031, - EndPos: 6040, - }, - Condition: &scalar.Lnumber{ + Expr: &ast.ExprTernary{ + Node: ast.Node{ Position: &position.Position{ StartLine: 333, EndLine: 333, StartPos: 6031, - EndPos: 6032, - }, - Value: "1", - }, - IfTrue: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6035, - EndPos: 6036, - }, - Value: "2", - }, - IfFalse: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6039, EndPos: 6040, }, - Value: "3", + }, + Condition: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6031, + EndPos: 6032, + }, + }, + Value: []byte("1"), + }, + IfTrue: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6035, + EndPos: 6036, + }, + }, + Value: []byte("2"), + }, + IfFalse: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6039, + EndPos: 6040, + }, + }, + Value: []byte("3"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6044, - EndPos: 6062, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6044, + EndPos: 6062, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6051, - EndPos: 6061, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 334, EndLine: 334, StartPos: 6051, - EndPos: 6053, + EndPos: 6061, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 334, EndLine: 334, StartPos: 6051, EndPos: 6053, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6051, + EndPos: 6053, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.BitwiseAnd{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6056, - EndPos: 6061, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryBitwiseAnd{ + Node: ast.Node{ Position: &position.Position{ StartLine: 334, EndLine: 334, StartPos: 6056, - EndPos: 6057, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6060, EndPos: 6061, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6056, + EndPos: 6057, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6060, + EndPos: 6061, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6065, - EndPos: 6083, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6065, + EndPos: 6083, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6072, - EndPos: 6082, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 335, EndLine: 335, StartPos: 6072, - EndPos: 6074, + EndPos: 6082, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 335, EndLine: 335, StartPos: 6072, EndPos: 6074, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6072, + EndPos: 6074, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.BitwiseOr{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6077, - EndPos: 6082, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryBitwiseOr{ + Node: ast.Node{ Position: &position.Position{ StartLine: 335, EndLine: 335, StartPos: 6077, - EndPos: 6078, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6081, EndPos: 6082, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6077, + EndPos: 6078, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6081, + EndPos: 6082, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 6086, - EndPos: 6104, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6086, + EndPos: 6104, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 6093, - EndPos: 6103, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 336, EndLine: 336, StartPos: 6093, - EndPos: 6095, + EndPos: 6103, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 336, EndLine: 336, StartPos: 6093, EndPos: 6095, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6093, + EndPos: 6095, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.BitwiseXor{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 6098, - EndPos: 6103, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryBitwiseXor{ + Node: ast.Node{ Position: &position.Position{ StartLine: 336, EndLine: 336, StartPos: 6098, - EndPos: 6099, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 6102, EndPos: 6103, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6098, + EndPos: 6099, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6102, + EndPos: 6103, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6107, - EndPos: 6126, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6107, + EndPos: 6126, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6114, - EndPos: 6125, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 337, EndLine: 337, StartPos: 6114, - EndPos: 6116, + EndPos: 6125, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 337, EndLine: 337, StartPos: 6114, EndPos: 6116, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6114, + EndPos: 6116, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.BooleanAnd{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6119, - EndPos: 6125, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryBooleanAnd{ + Node: ast.Node{ Position: &position.Position{ StartLine: 337, EndLine: 337, StartPos: 6119, - EndPos: 6120, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6124, EndPos: 6125, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6119, + EndPos: 6120, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6124, + EndPos: 6125, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6129, - EndPos: 6148, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6129, + EndPos: 6148, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6136, - EndPos: 6147, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 338, EndLine: 338, StartPos: 6136, - EndPos: 6138, + EndPos: 6147, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 338, EndLine: 338, StartPos: 6136, EndPos: 6138, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6136, + EndPos: 6138, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.BooleanOr{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6141, - EndPos: 6147, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryBooleanOr{ + Node: ast.Node{ Position: &position.Position{ StartLine: 338, EndLine: 338, StartPos: 6141, - EndPos: 6142, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6146, EndPos: 6147, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6141, + EndPos: 6142, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6146, + EndPos: 6147, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 339, - EndLine: 339, - StartPos: 6151, - EndPos: 6169, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6151, + EndPos: 6169, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 339, - EndLine: 339, - StartPos: 6158, - EndPos: 6168, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 339, EndLine: 339, StartPos: 6158, - EndPos: 6160, + EndPos: 6168, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 339, EndLine: 339, StartPos: 6158, EndPos: 6160, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6158, + EndPos: 6160, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Concat{ - Position: &position.Position{ - StartLine: 339, - EndLine: 339, - StartPos: 6163, - EndPos: 6168, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryConcat{ + Node: ast.Node{ Position: &position.Position{ StartLine: 339, EndLine: 339, StartPos: 6163, - EndPos: 6164, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 339, - EndLine: 339, - StartPos: 6167, EndPos: 6168, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6163, + EndPos: 6164, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6167, + EndPos: 6168, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6172, - EndPos: 6190, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6172, + EndPos: 6190, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6179, - EndPos: 6189, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 340, EndLine: 340, StartPos: 6179, - EndPos: 6181, + EndPos: 6189, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 340, EndLine: 340, StartPos: 6179, EndPos: 6181, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6179, + EndPos: 6181, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Div{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6184, - EndPos: 6189, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryDiv{ + Node: ast.Node{ Position: &position.Position{ StartLine: 340, EndLine: 340, StartPos: 6184, - EndPos: 6185, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6188, EndPos: 6189, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6184, + EndPos: 6185, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6188, + EndPos: 6189, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6193, - EndPos: 6212, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6193, + EndPos: 6212, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6200, - EndPos: 6211, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 341, EndLine: 341, StartPos: 6200, - EndPos: 6202, + EndPos: 6211, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 341, EndLine: 341, StartPos: 6200, EndPos: 6202, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6200, + EndPos: 6202, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Equal{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6205, - EndPos: 6211, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryEqual{ + Node: ast.Node{ Position: &position.Position{ StartLine: 341, EndLine: 341, StartPos: 6205, - EndPos: 6206, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6210, EndPos: 6211, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6205, + EndPos: 6206, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6210, + EndPos: 6211, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 342, - EndLine: 342, - StartPos: 6215, - EndPos: 6234, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6215, + EndPos: 6234, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 342, - EndLine: 342, - StartPos: 6222, - EndPos: 6233, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 342, EndLine: 342, StartPos: 6222, - EndPos: 6224, + EndPos: 6233, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 342, EndLine: 342, StartPos: 6222, EndPos: 6224, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6222, + EndPos: 6224, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.GreaterOrEqual{ - Position: &position.Position{ - StartLine: 342, - EndLine: 342, - StartPos: 6227, - EndPos: 6233, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryGreaterOrEqual{ + Node: ast.Node{ Position: &position.Position{ StartLine: 342, EndLine: 342, StartPos: 6227, - EndPos: 6228, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 342, - EndLine: 342, - StartPos: 6232, EndPos: 6233, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6227, + EndPos: 6228, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6232, + EndPos: 6233, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6237, - EndPos: 6255, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6237, + EndPos: 6255, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6244, - EndPos: 6254, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 343, EndLine: 343, StartPos: 6244, - EndPos: 6246, + EndPos: 6254, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 343, EndLine: 343, StartPos: 6244, EndPos: 6246, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6244, + EndPos: 6246, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Greater{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6249, - EndPos: 6254, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryGreater{ + Node: ast.Node{ Position: &position.Position{ StartLine: 343, EndLine: 343, StartPos: 6249, - EndPos: 6250, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6253, EndPos: 6254, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6249, + EndPos: 6250, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6253, + EndPos: 6254, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6258, - EndPos: 6278, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6258, + EndPos: 6278, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6265, - EndPos: 6277, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 344, EndLine: 344, StartPos: 6265, - EndPos: 6267, + EndPos: 6277, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 344, EndLine: 344, StartPos: 6265, EndPos: 6267, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6265, + EndPos: 6267, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Identical{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6270, - EndPos: 6277, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryIdentical{ + Node: ast.Node{ Position: &position.Position{ StartLine: 344, EndLine: 344, StartPos: 6270, - EndPos: 6271, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6276, EndPos: 6277, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6270, + EndPos: 6271, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6276, + EndPos: 6277, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 345, - EndLine: 345, - StartPos: 6281, - EndPos: 6301, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6281, + EndPos: 6301, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 345, - EndLine: 345, - StartPos: 6288, - EndPos: 6300, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 345, EndLine: 345, StartPos: 6288, - EndPos: 6290, + EndPos: 6300, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 345, EndLine: 345, StartPos: 6288, EndPos: 6290, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6288, + EndPos: 6290, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.LogicalAnd{ - Position: &position.Position{ - StartLine: 345, - EndLine: 345, - StartPos: 6293, - EndPos: 6300, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryLogicalAnd{ + Node: ast.Node{ Position: &position.Position{ StartLine: 345, EndLine: 345, StartPos: 6293, - EndPos: 6294, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 345, - EndLine: 345, - StartPos: 6299, EndPos: 6300, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6293, + EndPos: 6294, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6299, + EndPos: 6300, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6304, - EndPos: 6323, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6304, + EndPos: 6323, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6311, - EndPos: 6322, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 346, EndLine: 346, StartPos: 6311, - EndPos: 6313, + EndPos: 6322, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 346, EndLine: 346, StartPos: 6311, EndPos: 6313, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6311, + EndPos: 6313, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.LogicalOr{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6316, - EndPos: 6322, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryLogicalOr{ + Node: ast.Node{ Position: &position.Position{ StartLine: 346, EndLine: 346, StartPos: 6316, - EndPos: 6317, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6321, EndPos: 6322, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6316, + EndPos: 6317, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6321, + EndPos: 6322, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 347, - EndLine: 347, - StartPos: 6326, - EndPos: 6346, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6326, + EndPos: 6346, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 347, - EndLine: 347, - StartPos: 6333, - EndPos: 6345, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 347, EndLine: 347, StartPos: 6333, - EndPos: 6335, + EndPos: 6345, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 347, EndLine: 347, StartPos: 6333, EndPos: 6335, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6333, + EndPos: 6335, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.LogicalXor{ - Position: &position.Position{ - StartLine: 347, - EndLine: 347, - StartPos: 6338, - EndPos: 6345, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryLogicalXor{ + Node: ast.Node{ Position: &position.Position{ StartLine: 347, EndLine: 347, StartPos: 6338, - EndPos: 6339, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 347, - EndLine: 347, - StartPos: 6344, EndPos: 6345, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6338, + EndPos: 6339, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6344, + EndPos: 6345, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 6349, - EndPos: 6367, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 348, + EndLine: 348, + StartPos: 6349, + EndPos: 6367, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 6356, - EndPos: 6366, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 348, EndLine: 348, StartPos: 6356, - EndPos: 6358, + EndPos: 6366, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 348, EndLine: 348, StartPos: 6356, EndPos: 6358, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 348, + EndLine: 348, + StartPos: 6356, + EndPos: 6358, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Minus{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 6361, - EndPos: 6366, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryMinus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 348, EndLine: 348, StartPos: 6361, - EndPos: 6362, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 6365, EndPos: 6366, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 348, + EndLine: 348, + StartPos: 6361, + EndPos: 6362, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 348, + EndLine: 348, + StartPos: 6365, + EndPos: 6366, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 349, - EndLine: 349, - StartPos: 6370, - EndPos: 6388, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 349, + EndLine: 349, + StartPos: 6370, + EndPos: 6388, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 349, - EndLine: 349, - StartPos: 6377, - EndPos: 6387, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 349, EndLine: 349, StartPos: 6377, - EndPos: 6379, + EndPos: 6387, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 349, EndLine: 349, StartPos: 6377, EndPos: 6379, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 349, + EndLine: 349, + StartPos: 6377, + EndPos: 6379, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Mod{ - Position: &position.Position{ - StartLine: 349, - EndLine: 349, - StartPos: 6382, - EndPos: 6387, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryMod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 349, EndLine: 349, StartPos: 6382, - EndPos: 6383, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 349, - EndLine: 349, - StartPos: 6386, EndPos: 6387, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 349, + EndLine: 349, + StartPos: 6382, + EndPos: 6383, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 349, + EndLine: 349, + StartPos: 6386, + EndPos: 6387, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 350, - EndLine: 350, - StartPos: 6391, - EndPos: 6409, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 350, + EndLine: 350, + StartPos: 6391, + EndPos: 6409, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 350, - EndLine: 350, - StartPos: 6398, - EndPos: 6408, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 350, EndLine: 350, StartPos: 6398, - EndPos: 6400, + EndPos: 6408, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 350, EndLine: 350, StartPos: 6398, EndPos: 6400, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 350, + EndLine: 350, + StartPos: 6398, + EndPos: 6400, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Mul{ - Position: &position.Position{ - StartLine: 350, - EndLine: 350, - StartPos: 6403, - EndPos: 6408, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryMul{ + Node: ast.Node{ Position: &position.Position{ StartLine: 350, EndLine: 350, StartPos: 6403, - EndPos: 6404, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 350, - EndLine: 350, - StartPos: 6407, EndPos: 6408, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 350, + EndLine: 350, + StartPos: 6403, + EndPos: 6404, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 350, + EndLine: 350, + StartPos: 6407, + EndPos: 6408, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 351, - EndLine: 351, - StartPos: 6412, - EndPos: 6431, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 351, + EndLine: 351, + StartPos: 6412, + EndPos: 6431, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 351, - EndLine: 351, - StartPos: 6419, - EndPos: 6430, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 351, EndLine: 351, StartPos: 6419, - EndPos: 6421, + EndPos: 6430, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 351, EndLine: 351, StartPos: 6419, EndPos: 6421, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 351, + EndLine: 351, + StartPos: 6419, + EndPos: 6421, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.NotEqual{ - Position: &position.Position{ - StartLine: 351, - EndLine: 351, - StartPos: 6424, - EndPos: 6430, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryNotEqual{ + Node: ast.Node{ Position: &position.Position{ StartLine: 351, EndLine: 351, StartPos: 6424, - EndPos: 6425, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 351, - EndLine: 351, - StartPos: 6429, EndPos: 6430, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 351, + EndLine: 351, + StartPos: 6424, + EndPos: 6425, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 351, + EndLine: 351, + StartPos: 6429, + EndPos: 6430, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 352, - EndLine: 352, - StartPos: 6434, - EndPos: 6454, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 352, + EndLine: 352, + StartPos: 6434, + EndPos: 6454, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 352, - EndLine: 352, - StartPos: 6441, - EndPos: 6453, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 352, EndLine: 352, StartPos: 6441, - EndPos: 6443, + EndPos: 6453, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 352, EndLine: 352, StartPos: 6441, EndPos: 6443, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 352, + EndLine: 352, + StartPos: 6441, + EndPos: 6443, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.NotIdentical{ - Position: &position.Position{ - StartLine: 352, - EndLine: 352, - StartPos: 6446, - EndPos: 6453, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryNotIdentical{ + Node: ast.Node{ Position: &position.Position{ StartLine: 352, EndLine: 352, StartPos: 6446, - EndPos: 6447, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 352, - EndLine: 352, - StartPos: 6452, EndPos: 6453, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 352, + EndLine: 352, + StartPos: 6446, + EndPos: 6447, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 352, + EndLine: 352, + StartPos: 6452, + EndPos: 6453, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 353, - EndLine: 353, - StartPos: 6457, - EndPos: 6475, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 353, + EndLine: 353, + StartPos: 6457, + EndPos: 6475, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 353, - EndLine: 353, - StartPos: 6464, - EndPos: 6474, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 353, EndLine: 353, StartPos: 6464, - EndPos: 6466, + EndPos: 6474, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 353, EndLine: 353, StartPos: 6464, EndPos: 6466, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 353, + EndLine: 353, + StartPos: 6464, + EndPos: 6466, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Plus{ - Position: &position.Position{ - StartLine: 353, - EndLine: 353, - StartPos: 6469, - EndPos: 6474, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryPlus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 353, EndLine: 353, StartPos: 6469, - EndPos: 6470, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 353, - EndLine: 353, - StartPos: 6473, EndPos: 6474, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 353, + EndLine: 353, + StartPos: 6469, + EndPos: 6470, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 353, + EndLine: 353, + StartPos: 6473, + EndPos: 6474, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 354, - EndLine: 354, - StartPos: 6478, - EndPos: 6497, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 354, + EndLine: 354, + StartPos: 6478, + EndPos: 6497, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 354, - EndLine: 354, - StartPos: 6485, - EndPos: 6496, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 354, EndLine: 354, StartPos: 6485, - EndPos: 6487, + EndPos: 6496, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 354, EndLine: 354, StartPos: 6485, EndPos: 6487, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 354, + EndLine: 354, + StartPos: 6485, + EndPos: 6487, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Pow{ - Position: &position.Position{ - StartLine: 354, - EndLine: 354, - StartPos: 6490, - EndPos: 6496, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryPow{ + Node: ast.Node{ Position: &position.Position{ StartLine: 354, EndLine: 354, StartPos: 6490, - EndPos: 6491, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 354, - EndLine: 354, - StartPos: 6495, EndPos: 6496, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 354, + EndLine: 354, + StartPos: 6490, + EndPos: 6491, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 354, + EndLine: 354, + StartPos: 6495, + EndPos: 6496, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 355, - EndLine: 355, - StartPos: 6500, - EndPos: 6519, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 355, + EndLine: 355, + StartPos: 6500, + EndPos: 6519, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 355, - EndLine: 355, - StartPos: 6507, - EndPos: 6518, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 355, EndLine: 355, StartPos: 6507, - EndPos: 6509, + EndPos: 6518, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 355, EndLine: 355, StartPos: 6507, EndPos: 6509, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 355, + EndLine: 355, + StartPos: 6507, + EndPos: 6509, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.ShiftLeft{ - Position: &position.Position{ - StartLine: 355, - EndLine: 355, - StartPos: 6512, - EndPos: 6518, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryShiftLeft{ + Node: ast.Node{ Position: &position.Position{ StartLine: 355, EndLine: 355, StartPos: 6512, - EndPos: 6513, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 355, - EndLine: 355, - StartPos: 6517, EndPos: 6518, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 355, + EndLine: 355, + StartPos: 6512, + EndPos: 6513, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 355, + EndLine: 355, + StartPos: 6517, + EndPos: 6518, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 356, - EndLine: 356, - StartPos: 6522, - EndPos: 6541, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 356, + EndLine: 356, + StartPos: 6522, + EndPos: 6541, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 356, - EndLine: 356, - StartPos: 6529, - EndPos: 6540, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 356, EndLine: 356, StartPos: 6529, - EndPos: 6531, + EndPos: 6540, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 356, EndLine: 356, StartPos: 6529, EndPos: 6531, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 356, + EndLine: 356, + StartPos: 6529, + EndPos: 6531, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.ShiftRight{ - Position: &position.Position{ - StartLine: 356, - EndLine: 356, - StartPos: 6534, - EndPos: 6540, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryShiftRight{ + Node: ast.Node{ Position: &position.Position{ StartLine: 356, EndLine: 356, StartPos: 6534, - EndPos: 6535, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 356, - EndLine: 356, - StartPos: 6539, EndPos: 6540, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 356, + EndLine: 356, + StartPos: 6534, + EndPos: 6535, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 356, + EndLine: 356, + StartPos: 6539, + EndPos: 6540, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 357, - EndLine: 357, - StartPos: 6544, - EndPos: 6563, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 357, + EndLine: 357, + StartPos: 6544, + EndPos: 6563, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 357, - EndLine: 357, - StartPos: 6551, - EndPos: 6562, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 357, EndLine: 357, StartPos: 6551, - EndPos: 6553, + EndPos: 6562, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 357, EndLine: 357, StartPos: 6551, EndPos: 6553, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 357, + EndLine: 357, + StartPos: 6551, + EndPos: 6553, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.SmallerOrEqual{ - Position: &position.Position{ - StartLine: 357, - EndLine: 357, - StartPos: 6556, - EndPos: 6562, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinarySmallerOrEqual{ + Node: ast.Node{ Position: &position.Position{ StartLine: 357, EndLine: 357, StartPos: 6556, - EndPos: 6557, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 357, - EndLine: 357, - StartPos: 6561, EndPos: 6562, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 357, + EndLine: 357, + StartPos: 6556, + EndPos: 6557, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 357, + EndLine: 357, + StartPos: 6561, + EndPos: 6562, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 358, - EndLine: 358, - StartPos: 6566, - EndPos: 6584, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 358, + EndLine: 358, + StartPos: 6566, + EndPos: 6584, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 358, - EndLine: 358, - StartPos: 6573, - EndPos: 6583, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 358, EndLine: 358, StartPos: 6573, - EndPos: 6575, + EndPos: 6583, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 358, EndLine: 358, StartPos: 6573, EndPos: 6575, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 358, + EndLine: 358, + StartPos: 6573, + EndPos: 6575, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Smaller{ - Position: &position.Position{ - StartLine: 358, - EndLine: 358, - StartPos: 6578, - EndPos: 6583, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinarySmaller{ + Node: ast.Node{ Position: &position.Position{ StartLine: 358, EndLine: 358, StartPos: 6578, - EndPos: 6579, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 358, - EndLine: 358, - StartPos: 6582, EndPos: 6583, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 358, + EndLine: 358, + StartPos: 6578, + EndPos: 6579, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 358, + EndLine: 358, + StartPos: 6582, + EndPos: 6583, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 6587, - EndPos: 6608, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 359, + EndLine: 359, + StartPos: 6587, + EndPos: 6608, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 6594, - EndPos: 6607, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 359, EndLine: 359, StartPos: 6594, - EndPos: 6596, + EndPos: 6607, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 359, EndLine: 359, StartPos: 6594, EndPos: 6596, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 359, + EndLine: 359, + StartPos: 6594, + EndPos: 6596, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.ClassConstFetch{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 6599, - EndPos: 6607, - }, - Class: &name.Name{ + Expr: &ast.ExprClassConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 359, EndLine: 359, StartPos: 6599, - EndPos: 6602, + EndPos: 6607, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 6599, - EndPos: 6602, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 359, + EndLine: 359, + StartPos: 6599, + EndPos: 6602, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 359, + EndLine: 359, + StartPos: 6599, + EndPos: 6602, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 6604, - EndPos: 6607, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 359, + EndLine: 359, + StartPos: 6604, + EndPos: 6607, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 6611, - EndPos: 6634, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 360, + EndLine: 360, + StartPos: 6611, + EndPos: 6634, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 6618, - EndPos: 6633, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 360, EndLine: 360, StartPos: 6618, - EndPos: 6620, + EndPos: 6633, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 360, EndLine: 360, StartPos: 6618, EndPos: 6620, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 360, + EndLine: 360, + StartPos: 6618, + EndPos: 6620, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.ClassConstFetch{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 6623, - EndPos: 6633, - }, - Class: &name.Name{ + Expr: &ast.ExprClassConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 360, EndLine: 360, StartPos: 6623, - EndPos: 6626, + EndPos: 6633, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 6623, - EndPos: 6626, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 360, + EndLine: 360, + StartPos: 6623, + EndPos: 6626, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 360, + EndLine: 360, + StartPos: 6623, + EndPos: 6626, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 6628, - EndPos: 6633, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 360, + EndLine: 360, + StartPos: 6628, + EndPos: 6633, + }, }, - Value: "class", + Value: []byte("class"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 361, - EndLine: 361, - StartPos: 6637, - EndPos: 6659, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 361, + EndLine: 361, + StartPos: 6637, + EndPos: 6659, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 361, - EndLine: 361, - StartPos: 6644, - EndPos: 6658, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 361, EndLine: 361, StartPos: 6644, - EndPos: 6646, + EndPos: 6658, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 361, EndLine: 361, StartPos: 6644, EndPos: 6646, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 361, + EndLine: 361, + StartPos: 6644, + EndPos: 6646, + }, + }, + Value: []byte("a"), }, }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 361, - EndLine: 361, - StartPos: 6649, - EndPos: 6658, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 361, + EndLine: 361, + StartPos: 6649, + EndPos: 6658, + }, }, - Value: "__CLASS__", + Value: []byte("__CLASS__"), }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 362, - EndLine: 362, - StartPos: 6662, - EndPos: 6678, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 362, + EndLine: 362, + StartPos: 6662, + EndPos: 6678, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 362, - EndLine: 362, - StartPos: 6669, - EndPos: 6677, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 362, EndLine: 362, StartPos: 6669, - EndPos: 6671, + EndPos: 6677, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 362, EndLine: 362, StartPos: 6669, EndPos: 6671, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 362, + EndLine: 362, + StartPos: 6669, + EndPos: 6671, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 362, - EndLine: 362, - StartPos: 6674, - EndPos: 6677, - }, - Constant: &name.Name{ + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 362, EndLine: 362, StartPos: 6674, EndPos: 6677, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 362, - EndLine: 362, - StartPos: 6674, - EndPos: 6677, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 362, + EndLine: 362, + StartPos: 6674, + EndPos: 6677, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 362, + EndLine: 362, + StartPos: 6674, + EndPos: 6677, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, @@ -17637,61 +21513,75 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 363, - EndLine: 363, - StartPos: 6681, - EndPos: 6707, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 363, + EndLine: 363, + StartPos: 6681, + EndPos: 6707, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 363, - EndLine: 363, - StartPos: 6688, - EndPos: 6706, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 363, EndLine: 363, StartPos: 6688, - EndPos: 6690, + EndPos: 6706, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 363, EndLine: 363, StartPos: 6688, EndPos: 6690, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 363, + EndLine: 363, + StartPos: 6688, + EndPos: 6690, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 363, - EndLine: 363, - StartPos: 6693, - EndPos: 6706, - }, - Constant: &name.Relative{ + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 363, EndLine: 363, StartPos: 6693, EndPos: 6706, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 363, - EndLine: 363, - StartPos: 6703, - EndPos: 6706, + }, + Const: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 363, + EndLine: 363, + StartPos: 6693, + EndPos: 6706, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 363, + EndLine: 363, + StartPos: 6703, + EndPos: 6706, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, @@ -17699,61 +21589,75 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 364, - EndLine: 364, - StartPos: 6710, - EndPos: 6727, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 364, + EndLine: 364, + StartPos: 6710, + EndPos: 6727, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 364, - EndLine: 364, - StartPos: 6717, - EndPos: 6726, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 364, EndLine: 364, StartPos: 6717, - EndPos: 6719, + EndPos: 6726, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 364, EndLine: 364, StartPos: 6717, EndPos: 6719, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 364, + EndLine: 364, + StartPos: 6717, + EndPos: 6719, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 364, - EndLine: 364, - StartPos: 6722, - EndPos: 6726, - }, - Constant: &name.FullyQualified{ + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 364, EndLine: 364, StartPos: 6722, EndPos: 6726, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 364, - EndLine: 364, - StartPos: 6723, - EndPos: 6726, + }, + Const: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 364, + EndLine: 364, + StartPos: 6722, + EndPos: 6726, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 364, + EndLine: 364, + StartPos: 6723, + EndPos: 6726, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, @@ -17761,130 +21665,160 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 365, - EndLine: 365, - StartPos: 6730, - EndPos: 6750, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 365, + EndLine: 365, + StartPos: 6730, + EndPos: 6750, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 365, - EndLine: 365, - StartPos: 6737, - EndPos: 6749, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 365, EndLine: 365, StartPos: 6737, - EndPos: 6739, + EndPos: 6749, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 365, EndLine: 365, StartPos: 6737, EndPos: 6739, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 365, + EndLine: 365, + StartPos: 6737, + EndPos: 6739, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.Array{ - Position: &position.Position{ - StartLine: 365, - EndLine: 365, - StartPos: 6742, - EndPos: 6749, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 365, + EndLine: 365, + StartPos: 6742, + EndPos: 6749, + }, }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6753, - EndPos: 6782, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 366, + EndLine: 366, + StartPos: 6753, + EndPos: 6782, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6760, - EndPos: 6781, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 366, EndLine: 366, StartPos: 6760, - EndPos: 6762, + EndPos: 6781, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 366, EndLine: 366, StartPos: 6760, EndPos: 6762, }, - Value: "a", }, - }, - Expr: &expr.Array{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6765, - EndPos: 6781, - }, - Items: []node.Node{ - &expr.ArrayItem{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 366, EndLine: 366, - StartPos: 6771, - EndPos: 6777, + StartPos: 6760, + EndPos: 6762, }, - Key: &scalar.Lnumber{ + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 366, + EndLine: 366, + StartPos: 6765, + EndPos: 6781, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 366, EndLine: 366, StartPos: 6771, - EndPos: 6772, - }, - Value: "1", - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6776, EndPos: 6777, }, - Value: "1", + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 366, + EndLine: 366, + StartPos: 6771, + EndPos: 6772, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 366, + EndLine: 366, + StartPos: 6776, + EndPos: 6777, + }, + }, + Value: []byte("1"), }, }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6779, - EndPos: 6780, - }, - Val: &scalar.Lnumber{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 366, EndLine: 366, StartPos: 6779, EndPos: 6780, }, - Value: "2", + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 366, + EndLine: 366, + StartPos: 6779, + EndPos: 6780, + }, + }, + Value: []byte("2"), }, }, }, @@ -17892,510 +21826,630 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6785, - EndPos: 6812, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6785, + EndPos: 6812, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6792, - EndPos: 6811, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 367, EndLine: 367, StartPos: 6792, - EndPos: 6794, + EndPos: 6811, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 367, EndLine: 367, StartPos: 6792, EndPos: 6794, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6792, + EndPos: 6794, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6797, - EndPos: 6811, - }, - Variable: &expr.ShortArray{ + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 367, EndLine: 367, StartPos: 6797, - EndPos: 6808, + EndPos: 6811, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6798, - EndPos: 6799, - }, - Val: &scalar.Lnumber{ + }, + Var: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6797, + EndPos: 6808, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 367, EndLine: 367, StartPos: 6798, EndPos: 6799, }, - Value: "1", + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6798, + EndPos: 6799, + }, + }, + Value: []byte("1"), }, }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6801, - EndPos: 6807, - }, - Key: &scalar.Lnumber{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 367, EndLine: 367, StartPos: 6801, - EndPos: 6802, - }, - Value: "2", - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6806, EndPos: 6807, }, - Value: "2", + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6801, + EndPos: 6802, + }, + }, + Value: []byte("2"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6806, + EndPos: 6807, + }, + }, + Value: []byte("2"), }, }, }, }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6809, - EndPos: 6810, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6809, + EndPos: 6810, + }, }, - Value: "0", + Value: []byte("0"), }, }, }, }, }, - &stmt.If{ - Position: &position.Position{ - StartLine: 369, - EndLine: 369, - StartPos: 6816, - EndPos: 6831, - }, - Cond: &expr.Yield{ + &ast.StmtIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 369, EndLine: 369, - StartPos: 6820, - EndPos: 6827, + StartPos: 6816, + EndPos: 6831, }, - Value: &scalar.Lnumber{ + }, + Cond: &ast.ExprYield{ + Node: ast.Node{ Position: &position.Position{ StartLine: 369, EndLine: 369, - StartPos: 6826, + StartPos: 6820, EndPos: 6827, }, - Value: "1", + }, + Value: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 369, + EndLine: 369, + StartPos: 6826, + EndPos: 6827, + }, + }, + Value: []byte("1"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 369, - EndLine: 369, - StartPos: 6829, - EndPos: 6831, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 369, + EndLine: 369, + StartPos: 6829, + EndPos: 6831, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 370, - EndLine: 370, - StartPos: 6834, - EndPos: 6845, - }, - Expr: &expr.StaticPropertyFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 370, EndLine: 370, StartPos: 6834, - EndPos: 6844, + EndPos: 6845, }, - Class: &name.Name{ + }, + Expr: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 370, EndLine: 370, StartPos: 6834, - EndPos: 6837, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 370, - EndLine: 370, - StartPos: 6834, - EndPos: 6837, - }, - Value: "Foo", - }, - }, - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 370, - EndLine: 370, - StartPos: 6839, EndPos: 6844, }, - VarName: &expr.Variable{ + }, + Class: &ast.NameName{ + Node: ast.Node{ Position: &position.Position{ StartLine: 370, EndLine: 370, - StartPos: 6840, + StartPos: 6834, + EndPos: 6837, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 370, + EndLine: 370, + StartPos: 6834, + EndPos: 6837, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 370, + EndLine: 370, + StartPos: 6839, EndPos: 6844, }, - VarName: &node.Identifier{ + }, + VarName: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 370, EndLine: 370, StartPos: 6840, EndPos: 6844, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 370, + EndLine: 370, + StartPos: 6840, + EndPos: 6844, + }, + }, + Value: []byte("bar"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 372, - EndLine: 372, - StartPos: 6849, - EndPos: 6856, - }, - Expr: &expr.FunctionCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 372, EndLine: 372, StartPos: 6849, - EndPos: 6855, + EndPos: 6856, }, - Function: &expr.Variable{ + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 372, EndLine: 372, StartPos: 6849, - EndPos: 6853, + EndPos: 6855, }, - VarName: &node.Identifier{ + }, + Function: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 372, EndLine: 372, StartPos: 6849, EndPos: 6853, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 372, + EndLine: 372, + StartPos: 6849, + EndPos: 6853, + }, + }, + Value: []byte("foo"), }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 372, - EndLine: 372, - StartPos: 6853, - EndPos: 6855, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 372, + EndLine: 372, + StartPos: 6853, + EndPos: 6855, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 373, - EndLine: 373, - StartPos: 6859, - EndPos: 6872, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 373, EndLine: 373, StartPos: 6859, - EndPos: 6871, + EndPos: 6872, }, - Variable: &expr.ArrayDimFetch{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 373, EndLine: 373, StartPos: 6859, - EndPos: 6868, + EndPos: 6871, }, - Variable: &expr.FunctionCall{ + }, + Var: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 373, EndLine: 373, StartPos: 6859, - EndPos: 6865, + EndPos: 6868, }, - Function: &expr.Variable{ + }, + Var: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 373, EndLine: 373, StartPos: 6859, - EndPos: 6863, + EndPos: 6865, }, - VarName: &node.Identifier{ + }, + Function: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 373, EndLine: 373, StartPos: 6859, EndPos: 6863, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 373, + EndLine: 373, + StartPos: 6859, + EndPos: 6863, + }, + }, + Value: []byte("foo"), }, }, - ArgumentList: &node.ArgumentList{ + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 373, + EndLine: 373, + StartPos: 6863, + EndPos: 6865, + }, + }, + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 373, EndLine: 373, - StartPos: 6863, - EndPos: 6865, + StartPos: 6866, + EndPos: 6867, }, }, + Value: []byte("0"), }, - Dim: &scalar.Lnumber{ + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 373, EndLine: 373, - StartPos: 6866, - EndPos: 6867, + StartPos: 6869, + EndPos: 6870, }, - Value: "0", }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 373, - EndLine: 373, - StartPos: 6869, - EndPos: 6870, - }, - Value: "0", + Value: []byte("0"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 374, - EndLine: 374, - StartPos: 6875, - EndPos: 6882, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 374, EndLine: 374, StartPos: 6875, - EndPos: 6881, + EndPos: 6882, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 374, EndLine: 374, StartPos: 6875, - EndPos: 6877, + EndPos: 6881, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 374, EndLine: 374, StartPos: 6875, EndPos: 6877, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 374, + EndLine: 374, + StartPos: 6875, + EndPos: 6877, + }, + }, + Value: []byte("a"), }, }, - Dim: &expr.Variable{ - Position: &position.Position{ - StartLine: 374, - EndLine: 374, - StartPos: 6878, - EndPos: 6880, - }, - VarName: &node.Identifier{ + Dim: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 374, EndLine: 374, StartPos: 6878, EndPos: 6880, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 374, + EndLine: 374, + StartPos: 6878, + EndPos: 6880, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 375, - EndLine: 375, - StartPos: 6885, - EndPos: 6891, - }, - Expr: &expr.Variable{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 375, EndLine: 375, StartPos: 6885, - EndPos: 6890, + EndPos: 6891, }, - VarName: &expr.Variable{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 375, EndLine: 375, - StartPos: 6887, - EndPos: 6889, + StartPos: 6885, + EndPos: 6890, }, - VarName: &node.Identifier{ + }, + VarName: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 375, EndLine: 375, StartPos: 6887, EndPos: 6889, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 375, + EndLine: 375, + StartPos: 6887, + EndPos: 6889, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 376, - EndLine: 376, - StartPos: 6894, - EndPos: 6909, - }, - Expr: &expr.StaticCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 376, EndLine: 376, StartPos: 6894, - EndPos: 6908, + EndPos: 6909, }, - Class: &expr.Variable{ + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 376, EndLine: 376, StartPos: 6894, - EndPos: 6898, + EndPos: 6908, }, - VarName: &node.Identifier{ + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 376, EndLine: 376, StartPos: 6894, EndPos: 6898, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 376, + EndLine: 376, + StartPos: 6894, + EndPos: 6898, + }, + }, + Value: []byte("foo"), }, }, - Call: &expr.Variable{ - Position: &position.Position{ - StartLine: 376, - EndLine: 376, - StartPos: 6900, - EndPos: 6906, - }, - VarName: &node.Identifier{ + Call: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 376, EndLine: 376, - StartPos: 6901, - EndPos: 6905, + StartPos: 6900, + EndPos: 6906, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 376, + EndLine: 376, + StartPos: 6901, + EndPos: 6905, + }, + }, + Value: []byte("bar"), }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 376, - EndLine: 376, - StartPos: 6906, - EndPos: 6908, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 376, + EndLine: 376, + StartPos: 6906, + EndPos: 6908, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 377, - EndLine: 377, - StartPos: 6912, - EndPos: 6922, - }, - Expr: &expr.ClassConstFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 377, EndLine: 377, StartPos: 6912, - EndPos: 6921, + EndPos: 6922, }, - Class: &expr.Variable{ + }, + Expr: &ast.ExprClassConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 377, EndLine: 377, StartPos: 6912, - EndPos: 6916, + EndPos: 6921, }, - VarName: &node.Identifier{ + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 377, EndLine: 377, StartPos: 6912, EndPos: 6916, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 377, + EndLine: 377, + StartPos: 6912, + EndPos: 6916, + }, + }, + Value: []byte("foo"), }, }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 377, - EndLine: 377, - StartPos: 6918, - EndPos: 6921, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 377, + EndLine: 377, + StartPos: 6918, + EndPos: 6921, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, - &stmt.HaltCompiler{ - Position: &position.Position{ - StartLine: 379, - EndLine: 379, - StartPos: 6926, - EndPos: 6944, + &ast.StmtHaltCompiler{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 379, + EndLine: 379, + StartPos: 6926, + EndPos: 6944, + }, }, }, }, @@ -18420,97 +22474,119 @@ func TestPhp5Strings(t *testing.T) { '; ` - expected := &node.Root{ - Position: &position.Position{ - StartLine: 2, - EndLine: 10, - StartPos: 5, - EndPos: 70, + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 10, + StartPos: 5, + EndPos: 70, + }, }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 5, - EndPos: 12, - }, - Expr: &scalar.String{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 2, StartPos: 5, - EndPos: 11, + EndPos: 12, }, - Value: "\"test\"", + }, + Expr: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 11, + }, + }, + Value: []byte("\"test\""), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 15, - EndPos: 24, - }, - Expr: &scalar.String{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, StartPos: 15, - EndPos: 23, + EndPos: 24, }, - Value: "\"\\$test\"", + }, + Expr: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 15, + EndPos: 23, + }, + }, + Value: []byte("\"\\$test\""), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 4, - EndLine: 6, - StartPos: 27, - EndPos: 41, - }, - Expr: &scalar.String{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 6, StartPos: 27, - EndPos: 40, + EndPos: 41, }, - Value: "\"\n\t\t\ttest\n\t\t\"", + }, + Expr: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 6, + StartPos: 27, + EndPos: 40, + }, + }, + Value: []byte("\"\n\t\t\ttest\n\t\t\""), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 44, - EndPos: 52, - }, - Expr: &scalar.String{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 7, EndLine: 7, StartPos: 44, - EndPos: 51, + EndPos: 52, }, - Value: "'$test'", + }, + Expr: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 44, + EndPos: 51, + }, + }, + Value: []byte("'$test'"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 8, - EndLine: 10, - StartPos: 55, - EndPos: 70, - }, - Expr: &scalar.String{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 8, EndLine: 10, StartPos: 55, - EndPos: 69, + EndPos: 70, }, - Value: "'\n\t\t\t$test\n\t\t'", + }, + Expr: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 8, + EndLine: 10, + StartPos: 55, + EndPos: 69, + }, + }, + Value: []byte("'\n\t\t\t$test\n\t\t'"), }, }, }, @@ -18540,165 +22616,201 @@ CAD; CAD; ` - expected := &node.Root{ - Position: &position.Position{ - StartLine: 2, - EndLine: 15, - StartPos: 5, - EndPos: 120, + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 15, + StartPos: 5, + EndPos: 120, + }, }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 2, - EndLine: 3, - StartPos: 5, - EndPos: 16, - }, - Expr: &scalar.Heredoc{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 3, StartPos: 5, - EndPos: 15, + EndPos: 16, }, - Label: "<<