diff --git a/Makefile b/Makefile index 9540674..a5b8399 100644 --- a/Makefile +++ b/Makefile @@ -22,21 +22,21 @@ bench: go test -benchmem -bench=. ./php5 go test -benchmem -bench=. ./php7 -compile: ./php5/php5.go ./php7/php7.go ./scanner/scanner.go fmt - sed -i '' -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./php7/php7.go - sed -i '' -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./php5/php5.go - sed -i '' -e 's/\/\/line/\/\/ line/g' ./php5/php5.go - sed -i '' -e 's/\/\/line/\/\/ line/g' ./php7/php7.go - sed -i '' -e 's/\/\/line/\/\/ line/g' ./scanner/scanner.go +compile: ./internal/php5/php5.go ./internal/php7/php7.go ./internal/scanner/scanner.go fmt + sed -i '' -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./internal/php7/php7.go + sed -i '' -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./internal/php5/php5.go + sed -i '' -e 's/\/\/line/\/\/ line/g' ./internal/php5/php5.go + sed -i '' -e 's/\/\/line/\/\/ line/g' ./internal/php7/php7.go + sed -i '' -e 's/\/\/line/\/\/ line/g' ./internal/scanner/scanner.go rm -f y.output -./scanner/scanner.go: ./scanner/scanner.rl +./internal/scanner/scanner.go: ./internal/scanner/scanner.rl ragel -Z -G2 -o $@ $< -./php5/php5.go: ./php5/php5.y +./internal/php5/php5.go: ./internal/php5/php5.y goyacc -o $@ $< -./php7/php7.go: ./php7/php7.y +./internal/php7/php7.go: ./internal/php7/php7.y goyacc -o $@ $< cpu_pprof: diff --git a/php5/parser.go b/internal/php5/parser.go similarity index 94% rename from php5/parser.go rename to internal/php5/parser.go index 027f444..311e544 100644 --- a/php5/parser.go +++ b/internal/php5/parser.go @@ -1,13 +1,14 @@ package php5 import ( - "strings" - - "github.com/z7zmey/php-parser/errors" "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/positionbuilder" + "strings" + + "github.com/z7zmey/php-parser/internal/positionbuilder" + "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" ) @@ -20,7 +21,7 @@ type Parser struct { Lexer scanner.Scanner currentToken *scanner.Token positionBuilder *positionbuilder.PositionBuilder - rootNode node.Node + rootNode ast.Vertex } // NewParser creates and returns new Parser @@ -54,7 +55,7 @@ func (l *Parser) Error(msg string) { l.Lexer.AddError(errors.NewError(msg, pos)) } -func (l *Parser) WithFreeFloating() { +func (l *Parser) WithTokens() { l.Lexer.SetWithFreeFloating(true) } @@ -71,7 +72,7 @@ func (l *Parser) Parse() int { } // GetRootNode returns root node -func (l *Parser) GetRootNode() node.Node { +func (l *Parser) GetRootNode() ast.Vertex { return l.rootNode } diff --git a/php5/php5.go b/internal/php5/php5.go similarity index 100% rename from php5/php5.go rename to internal/php5/php5.go diff --git a/php5/php5.y b/internal/php5/php5.y similarity index 100% rename from php5/php5.y rename to internal/php5/php5.y diff --git a/php5/php5_bench_test.go b/internal/php5/php5_bench_test.go similarity index 100% rename from php5/php5_bench_test.go rename to internal/php5/php5_bench_test.go diff --git a/php5/php5_test.go b/internal/php5/php5_test.go similarity index 100% rename from php5/php5_test.go rename to internal/php5/php5_test.go diff --git a/internal/php7/parser.go b/internal/php7/parser.go new file mode 100644 index 0000000..cb42f54 --- /dev/null +++ b/internal/php7/parser.go @@ -0,0 +1,190 @@ +package php7 + +import ( + "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/pkg/token" +) + +func (lval *yySymType) Token(t *scanner.Token) { + lval.token = t +} + +// Parser structure +type Parser struct { + Lexer scanner.Scanner + currentToken *scanner.Token + positionBuilder *positionbuilder.PositionBuilder + rootNode ast.Vertex +} + +// NewParser creates and returns new Parser +func NewParser(src []byte, v string) *Parser { + lexer := scanner.NewLexer(src) + lexer.PHPVersion = v + + return &Parser{ + lexer, + nil, + nil, + nil, + } +} + +func (l *Parser) Lex(lval *yySymType) int { + t := l.Lexer.Lex(lval) + l.currentToken = lval.token + return t +} + +func (l *Parser) Error(msg string) { + pos := &position.Position{ + StartLine: l.currentToken.StartLine, + EndLine: l.currentToken.EndLine, + StartPos: l.currentToken.StartPos, + EndPos: l.currentToken.EndPos, + } + + l.Lexer.AddError(errors.NewError(msg, pos)) +} + +func (l *Parser) WithTokens() { + l.Lexer.SetWithTokens(true) +} + +// Parse the php7 Parser entrypoint +func (l *Parser) Parse() int { + // init + l.Lexer.SetErrors(nil) + l.rootNode = nil + l.positionBuilder = &positionbuilder.PositionBuilder{} + + // parse + + return yyParse(l) +} + +// GetRootNode returns root node +func (l *Parser) GetRootNode() ast.Vertex { + return l.rootNode +} + +// GetErrors returns errors list +func (l *Parser) GetErrors() []*errors.Error { + return l.Lexer.GetErrors() +} + +// helpers + +func lastNode(nn []ast.Vertex) ast.Vertex { + if len(nn) == 0 { + return nil + } + return nn[len(nn)-1] +} + +func firstNode(nn []ast.Vertex) ast.Vertex { + return nn[0] +} + +func isDollar(r rune) bool { + return r == '$' +} + +func (l *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { + if l.Lexer.GetWithFreeFloating() == false { + return + } + + if src.GetNode().Tokens == nil { + return + } + + l.setFreeFloating(dst, token.Start, src.GetNode().Tokens[token.Start]) + delete(src.GetNode().Tokens, token.Start) +} + +func (l *Parser) setFreeFloating(dst ast.Vertex, p token.Position, strings []token.Token) { + if l.Lexer.GetWithFreeFloating() == false { + return + } + + if len(strings) == 0 { + return + } + + dstCollection := &dst.GetNode().Tokens + if *dstCollection == nil { + *dstCollection = make(token.Collection) + } + + (*dstCollection)[p] = strings +} + +func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { + if l.Lexer.GetWithFreeFloating() == false { + return []token.Token{} + } + + tokens := make([]token.Token, len(t.Tokens)) + copy(tokens, t.Tokens) + + return tokens +} + +func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { + if l.Lexer.GetWithFreeFloating() == false { + return + } + + semiColon := prevNode.GetNode().Tokens[token.SemiColon] + delete(prevNode.GetNode().Tokens, token.SemiColon) + if len(semiColon) == 0 { + return + } + + if semiColon[0].Value[0] == ';' { + l.setFreeFloating(prevNode, token.SemiColon, []token.Token{ + { + ID: token.ID(';'), + Value: semiColon[0].Value[0:1], + }, + }) + } + + vlen := len(semiColon[0].Value) + tlen := 2 + if bytes.HasSuffix(semiColon[0].Value, []byte("?>\n")) { + tlen = 3 + } + + phpCloseTag := []token.Token{} + if vlen-tlen > 1 { + phpCloseTag = append(phpCloseTag, token.Token{ + ID: token.T_WHITESPACE, + Value: semiColon[0].Value[1 : vlen-tlen], + }) + } + + phpCloseTag = append(phpCloseTag, token.Token{ + ID: T_CLOSE_TAG, + Value: semiColon[0].Value[vlen-tlen:], + }) + + l.setFreeFloating(htmlNode, token.Start, append(phpCloseTag, htmlNode.GetNode().Tokens[token.Start]...)) +} + +func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { + for i := 1; i < len(yyDollar); i++ { + if yyDollar[i].token != nil { + p.Lexer.ReturnTokenToPool(yyDollar[i].token) + } + yyDollar[i].token = nil + } + yyVAL.token = nil +} diff --git a/php7/php7.go b/internal/php7/php7.go similarity index 50% rename from php7/php7.go rename to internal/php7/php7.go index 5e35ac0..0a41dff 100644 Binary files a/php7/php7.go and b/internal/php7/php7.go differ diff --git a/internal/php7/php7.y b/internal/php7/php7.y new file mode 100644 index 0000000..9f08fa4 --- /dev/null +++ b/internal/php7/php7.y @@ -0,0 +1,5655 @@ +%{ +package php7 + +import ( + "bytes" + "strconv" + + "github.com/z7zmey/php-parser/pkg/token" + "github.com/z7zmey/php-parser/internal/scanner" + "github.com/z7zmey/php-parser/pkg/ast" +) + +%} + +%union{ + node ast.Vertex + token *scanner.Token + list []ast.Vertex + str string + + ClassExtends *ast.StmtClassExtends + ClassImplements *ast.StmtClassImplements + InterfaceExtends *ast.StmtInterfaceExtends + ClosureUse *ast.ExprClosureUse +} + +%type $unk +%token T_INCLUDE +%token T_INCLUDE_ONCE +%token T_EXIT +%token T_IF +%token T_LNUMBER +%token T_DNUMBER +%token T_STRING +%token T_STRING_VARNAME +%token T_VARIABLE +%token T_NUM_STRING +%token T_INLINE_HTML +%token T_CHARACTER +%token T_BAD_CHARACTER +%token T_ENCAPSED_AND_WHITESPACE +%token T_CONSTANT_ENCAPSED_STRING +%token T_ECHO +%token T_DO +%token T_WHILE +%token T_ENDWHILE +%token T_FOR +%token T_ENDFOR +%token T_FOREACH +%token T_ENDFOREACH +%token T_DECLARE +%token T_ENDDECLARE +%token T_AS +%token T_SWITCH +%token T_ENDSWITCH +%token T_CASE +%token T_DEFAULT +%token T_BREAK +%token T_CONTINUE +%token T_GOTO +%token T_FUNCTION +%token T_FN +%token T_CONST +%token T_RETURN +%token T_TRY +%token T_CATCH +%token T_FINALLY +%token T_THROW +%token T_USE +%token T_INSTEADOF +%token T_GLOBAL +%token T_VAR +%token T_UNSET +%token T_ISSET +%token T_EMPTY +%token T_HALT_COMPILER +%token T_CLASS +%token T_TRAIT +%token T_INTERFACE +%token T_EXTENDS +%token T_IMPLEMENTS +%token T_OBJECT_OPERATOR +%token T_DOUBLE_ARROW +%token T_LIST +%token T_ARRAY +%token T_CALLABLE +%token T_CLASS_C +%token T_TRAIT_C +%token T_METHOD_C +%token T_FUNC_C +%token T_LINE +%token T_FILE +%token T_COMMENT +%token T_DOC_COMMENT +%token T_OPEN_TAG +%token T_OPEN_TAG_WITH_ECHO +%token T_CLOSE_TAG +%token T_WHITESPACE +%token T_START_HEREDOC +%token T_END_HEREDOC +%token T_DOLLAR_OPEN_CURLY_BRACES +%token T_CURLY_OPEN +%token T_PAAMAYIM_NEKUDOTAYIM +%token T_NAMESPACE +%token T_NS_C +%token T_DIR +%token T_NS_SEPARATOR +%token T_ELLIPSIS +%token T_EVAL +%token T_REQUIRE +%token T_REQUIRE_ONCE +%token T_LOGICAL_OR +%token T_LOGICAL_XOR +%token T_LOGICAL_AND +%token T_INSTANCEOF +%token T_NEW +%token T_CLONE +%token T_ELSEIF +%token T_ELSE +%token T_ENDIF +%token T_PRINT +%token T_YIELD +%token T_STATIC +%token T_ABSTRACT +%token T_FINAL +%token T_PRIVATE +%token T_PROTECTED +%token T_PUBLIC +%token T_INC +%token T_DEC +%token T_YIELD_FROM +%token T_INT_CAST +%token T_DOUBLE_CAST +%token T_STRING_CAST +%token T_ARRAY_CAST +%token T_OBJECT_CAST +%token T_BOOL_CAST +%token T_UNSET_CAST +%token T_COALESCE +%token T_SPACESHIP +%token T_NOELSE +%token T_PLUS_EQUAL +%token T_MINUS_EQUAL +%token T_MUL_EQUAL +%token T_POW_EQUAL +%token T_DIV_EQUAL +%token T_CONCAT_EQUAL +%token T_MOD_EQUAL +%token T_AND_EQUAL +%token T_OR_EQUAL +%token T_XOR_EQUAL +%token T_SL_EQUAL +%token T_SR_EQUAL +%token T_COALESCE_EQUAL +%token T_BOOLEAN_OR +%token T_BOOLEAN_AND +%token T_POW +%token T_SL +%token T_SR +%token T_IS_IDENTICAL +%token T_IS_NOT_IDENTICAL +%token T_IS_EQUAL +%token T_IS_NOT_EQUAL +%token T_IS_SMALLER_OR_EQUAL +%token T_IS_GREATER_OR_EQUAL +%token '"' +%token '`' +%token '{' +%token '}' +%token ';' +%token ':' +%token '(' +%token ')' +%token '[' +%token ']' +%token '?' +%token '&' +%token '-' +%token '+' +%token '!' +%token '~' +%token '@' +%token '$' +%token ',' +%token '|' +%token '=' +%token '^' +%token '*' +%token '/' +%token '%' +%token '<' +%token '>' +%token '.' + +%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE +%left ',' +%left T_LOGICAL_OR +%left T_LOGICAL_XOR +%left T_LOGICAL_AND +%right T_PRINT +%right T_YIELD +%right T_DOUBLE_ARROW +%right T_YIELD_FROM +%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL T_POW_EQUAL T_COALESCE_EQUAL +%left '?' ':' +%right T_COALESCE +%left T_BOOLEAN_OR +%left T_BOOLEAN_AND +%left '|' +%left '^' +%left '&' +%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL T_SPACESHIP +%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL +%left T_SL T_SR +%left '+' '-' '.' +%left '*' '/' '%' +%right '!' +%nonassoc T_INSTANCEOF +%right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@' +%right T_POW +%right '[' +%nonassoc T_NEW T_CLONE +%left T_NOELSE +%left T_ELSEIF +%left T_ELSE +%left T_ENDIF +%right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC + +%type is_reference is_variadic returns_ref + +%type reserved_non_modifiers +%type semi_reserved +%type identifier +%type possible_comma +%type case_separator + +%type top_statement name statement function_declaration_statement +%type class_declaration_statement trait_declaration_statement +%type interface_declaration_statement +%type group_use_declaration inline_use_declaration +%type mixed_group_use_declaration use_declaration unprefixed_use_declaration +%type const_decl inner_statement +%type expr optional_expr +%type declare_statement finally_statement unset_variable variable +%type parameter optional_type argument expr_without_variable global_var +%type static_var class_statement trait_adaptation trait_precedence trait_alias +%type absolute_trait_method_reference trait_method_reference property echo_expr +%type new_expr anonymous_class class_name class_name_reference simple_variable +%type internal_functions_in_yacc +%type exit_expr scalar lexical_var function_call member_name property_name +%type variable_class_name dereferencable_scalar constant dereferencable +%type callable_expr callable_variable static_member new_variable +%type encaps_var encaps_var_offset +%type if_stmt +%type alt_if_stmt +%type if_stmt_without_else +%type class_const_decl +%type alt_if_stmt_without_else +%type array_pair possible_array_pair +%type isset_variable type return_type type_expr +%type class_modifier +%type argument_list ctor_arguments +%type trait_adaptations +%type switch_case_list +%type method_body +%type foreach_statement for_statement while_statement +%type inline_function +%type extends_from +%type implements_list +%type interface_extends_list +%type lexical_vars + +%type member_modifier +%type use_type +%type foreach_variable + + +%type encaps_list backticks_expr namespace_name catch_name_list catch_list class_const_list +%type const_list echo_expr_list for_exprs non_empty_for_exprs global_var_list +%type unprefixed_use_declarations inline_use_declarations property_list static_var_list +%type case_list trait_adaptation_list unset_variables +%type use_declarations lexical_var_list isset_variables non_empty_array_pair_list +%type array_pair_list non_empty_argument_list top_statement_list +%type inner_statement_list parameter_list non_empty_parameter_list class_statement_list +%type method_modifiers variable_modifiers +%type non_empty_member_modifiers name_list class_modifiers + +%type backup_doc_comment + +%% + +///////////////////////////////////////////////////////////////////////// + +start: + top_statement_list + { + yylex.(*Parser).rootNode = &ast.Root{ast.Node{}, $1} + + // save position + yylex.(*Parser).rootNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + + yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, token.End, yylex.(*Parser).currentToken.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +reserved_non_modifiers: + T_INCLUDE {$$=$1} | T_INCLUDE_ONCE {$$=$1} | T_EVAL {$$=$1} | T_REQUIRE {$$=$1} | T_REQUIRE_ONCE {$$=$1} | T_LOGICAL_OR {$$=$1} | T_LOGICAL_XOR {$$=$1} | T_LOGICAL_AND {$$=$1} + | T_INSTANCEOF {$$=$1} | T_NEW {$$=$1} | T_CLONE {$$=$1} | T_EXIT {$$=$1} | T_IF {$$=$1} | T_ELSEIF {$$=$1} | T_ELSE {$$=$1} | T_ENDIF {$$=$1} | T_ECHO {$$=$1} | T_DO {$$=$1} | T_WHILE {$$=$1} | T_ENDWHILE {$$=$1} + | T_FOR {$$=$1} | T_ENDFOR {$$=$1} | T_FOREACH {$$=$1} | T_ENDFOREACH {$$=$1} | T_DECLARE {$$=$1} | T_ENDDECLARE {$$=$1} | T_AS {$$=$1} | T_TRY {$$=$1} | T_CATCH {$$=$1} | T_FINALLY {$$=$1} + | T_THROW {$$=$1} | T_USE {$$=$1} | T_INSTEADOF {$$=$1} | T_GLOBAL {$$=$1} | T_VAR {$$=$1} | T_UNSET {$$=$1} | T_ISSET {$$=$1} | T_EMPTY {$$=$1} | T_CONTINUE {$$=$1} | T_GOTO {$$=$1} + | T_FUNCTION {$$=$1} | T_CONST {$$=$1} | T_RETURN {$$=$1} | T_PRINT {$$=$1} | T_YIELD {$$=$1} | T_LIST {$$=$1} | T_SWITCH {$$=$1} | T_ENDSWITCH {$$=$1} | T_CASE {$$=$1} | T_DEFAULT {$$=$1} | T_BREAK {$$=$1} + | T_ARRAY {$$=$1} | T_CALLABLE {$$=$1} | T_EXTENDS {$$=$1} | T_IMPLEMENTS {$$=$1} | T_NAMESPACE {$$=$1} | T_TRAIT {$$=$1} | T_INTERFACE {$$=$1} | T_CLASS {$$=$1} + | T_CLASS_C {$$=$1} | T_TRAIT_C {$$=$1} | T_FUNC_C {$$=$1} | T_METHOD_C {$$=$1} | T_LINE {$$=$1} | T_FILE {$$=$1} | T_DIR {$$=$1} | T_NS_C {$$=$1} | T_FN {$$=$1} +; + +semi_reserved: + reserved_non_modifiers + { + $$ = $1 + } + | T_STATIC {$$=$1} | T_ABSTRACT {$$=$1} | T_FINAL {$$=$1} | T_PRIVATE {$$=$1} | T_PROTECTED {$$=$1} | T_PUBLIC {$$=$1} +; + +identifier: + T_STRING + { + $$ = $1 + } + | semi_reserved + { + $$ = $1 + } +; + +top_statement_list: + top_statement_list top_statement + { + if inlineHtmlNode, ok := $2.(*ast.StmtInlineHtml); ok && len($1) > 0 { + prevNode := lastNode($1) + yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) + } + + if $2 != nil { + $$ = append($1, $2) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | /* empty */ + { + $$ = []ast.Vertex{} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +namespace_name: + T_STRING + { + namePart := &ast.NameNamePart{ast.Node{}, $1.Value} + $$ = []ast.Vertex{namePart} + + // save position + namePart.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating(namePart, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | namespace_name T_NS_SEPARATOR T_STRING + { + namePart := &ast.NameNamePart{ast.Node{}, $3.Value} + $$ = append($1, namePart) + + // save position + namePart.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(namePart, token.Start, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +name: + namespace_name + { + $$ = &ast.NameName{ast.Node{}, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + + // save comments + yylex.(*Parser).MoveFreeFloating($1[0], $$) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NAMESPACE T_NS_SEPARATOR namespace_name + { + $$ = &ast.NameRelative{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NS_SEPARATOR namespace_name + { + $$ = &ast.NameFullyQualified{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +top_statement: + error + { + // error + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | function_declaration_statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | class_declaration_statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | trait_declaration_statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | interface_declaration_statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_HALT_COMPILER '(' ')' ';' + { + $$ = &ast.StmtHaltCompiler{ast.Node{}} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + 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 := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtNamespace{ast.Node{}, name, nil} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).MoveFreeFloating($2[0], name) + 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 := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtNamespace{ast.Node{}, name, $4} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).MoveFreeFloating($2[0], name) + 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 '}' + { + $$ = &ast.StmtNamespace{ast.Node{}, nil, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + 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 mixed_group_use_declaration ';' + { + $$ = $2 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + 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 use_type group_use_declaration ';' + { + $3.(*ast.StmtGroupUse).UseType = $2 + $$ = $3 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_USE use_declarations ';' + { + $$ = &ast.StmtUseList{ast.Node{}, nil, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + 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 use_type use_declarations ';' + { + $$ = &ast.StmtUseList{ast.Node{}, $2, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_CONST const_list ';' + { + $$ = &ast.StmtConstList{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +use_type: + T_FUNCTION + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_CONST + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +group_use_declaration: + namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' + { + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.StmtGroupUse{ast.Node{}, nil, name, $4} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6) + + // save comments + yylex.(*Parser).MoveFreeFloating($1[0], name) + yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, $3.Tokens) + if $5 != nil { + yylex.(*Parser).setFreeFloating($$, token.Stmts, append($5.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($5), $6.Tokens...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Tokens) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' + { + name := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtGroupUse{ast.Node{}, nil, name, $5} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.UseType, $1.Tokens) + yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, $4.Tokens) + if $6 != nil { + yylex.(*Parser).setFreeFloating($$, token.Stmts, append($6.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($6), $7.Tokens...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +mixed_group_use_declaration: + namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' + { + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.StmtGroupUse{ast.Node{}, nil, name, $4} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6) + + // save comments + yylex.(*Parser).MoveFreeFloating($1[0], name) + yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, $3.Tokens) + if $5 != nil { + yylex.(*Parser).setFreeFloating($$, token.Stmts, append($5.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($5), $6.Tokens...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Tokens) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' + { + name := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtGroupUse{ast.Node{}, nil, name, $5} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Use, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, $4.Tokens) + if $6 != nil { + yylex.(*Parser).setFreeFloating($$, token.Stmts, append($6.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($6), $7.Tokens...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +possible_comma: + /* empty */ + { + $$ = nil + } + | ',' + { + $$ = $1 + } +; + +inline_use_declarations: + inline_use_declarations ',' inline_use_declaration + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | inline_use_declaration + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +unprefixed_use_declarations: + unprefixed_use_declarations ',' unprefixed_use_declaration + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | unprefixed_use_declaration + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +use_declarations: + use_declarations ',' use_declaration + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | use_declaration + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +inline_use_declaration: + unprefixed_use_declaration + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | use_type unprefixed_use_declaration + { + $2.(*ast.StmtUse).UseType = $1 + $$ = $2 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +unprefixed_use_declaration: + namespace_name + { + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + + // save comments + yylex.(*Parser).MoveFreeFloating($1[0], name) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | namespace_name T_AS T_STRING + { + name := &ast.NameName{ast.Node{}, $1} + alias := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} + + // save position + 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], name) + yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +use_declaration: + unprefixed_use_declaration + { + $$ = $1 + + // save coments + yylex.(*Parser).MoveFreeFloating($1.(*ast.StmtUse).Use, $$) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NS_SEPARATOR unprefixed_use_declaration + { + $$ = $2; + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +const_list: + const_list ',' const_decl + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | const_decl + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +inner_statement_list: + inner_statement_list inner_statement + { + if inlineHtmlNode, ok := $2.(*ast.StmtInlineHtml); ok && len($1) > 0 { + prevNode := lastNode($1) + yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) + } + + if $2 != nil { + $$ = append($1, $2) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | /* empty */ + { + $$ = []ast.Vertex{} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +inner_statement: + error + { + // error + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | function_declaration_statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | class_declaration_statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | trait_declaration_statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | interface_declaration_statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_HALT_COMPILER '(' ')' ';' + { + $$ = &ast.StmtHaltCompiler{ast.Node{}, } + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + 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) + } + +statement: + '{' inner_statement_list '}' + { + $$ = &ast.StmtStmtList{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | if_stmt + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | alt_if_stmt + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_WHILE '(' expr ')' while_statement + { + switch n := $5.(type) { + case *ast.StmtWhile : + n.Cond = $3 + case *ast.StmtAltWhile : + n.Cond = $3 + } + + $$ = $5 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.While, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_DO statement T_WHILE '(' expr ')' ';' + { + $$ = &ast.StmtDo{ast.Node{}, $2, $5} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.While, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($7)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement + { + switch n := $9.(type) { + case *ast.StmtFor : + n.Init = $3 + n.Cond = $5 + n.Loop = $7 + case *ast.StmtAltFor : + n.Init = $3 + n.Cond = $5 + n.Loop = $7 + } + + $$ = $9 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9) + + // save comments + 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 '(' expr ')' switch_case_list + { + switch n := $5.(type) { + case *ast.StmtSwitch: + n.Cond = $3 + case *ast.StmtAltSwitch: + n.Cond = $3 + default: + panic("unexpected node type") + } + + $$ = $5 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Switch, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_BREAK optional_expr ';' + { + $$ = &ast.StmtBreak{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + 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 optional_expr ';' + { + $$ = &ast.StmtContinue{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + 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 optional_expr ';' + { + $$ = &ast.StmtReturn{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + 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_GLOBAL global_var_list ';' + { + $$ = &ast.StmtGlobal{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + 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 ';' + { + $$ = &ast.StmtStatic{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + 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 ';' + { + $$ = &ast.StmtEcho{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + 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 + { + $$ = &ast.StmtInlineHtml{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr ';' + { + $$ = &ast.StmtExpression{ast.Node{}, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + 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 possible_comma ')' ';' + { + $$ = &ast.StmtUnset{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Unset, $2.Tokens) + if $4 != nil { + yylex.(*Parser).setFreeFloating($$, token.VarList, append($4.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($4), $5.Tokens...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, token.VarList, $5.Tokens) + } + yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($6)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement + { + switch n := $7.(type) { + case *ast.StmtForeach : + n.Expr = $3 + n.Var = $5 + case *ast.StmtAltForeach : + n.Expr = $3 + n.Var = $5 + } + + $$ = $7 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $6.Tokens) + + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement + { + switch n := $9.(type) { + case *ast.StmtForeach : + n.Expr = $3 + n.Key = $5 + n.Var = $7 + case *ast.StmtAltForeach : + n.Expr = $3 + n.Key = $5 + n.Var = $7 + } + + $$ = $9 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Key, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $8.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_DECLARE '(' const_list ')' declare_statement + { + $$ = $5 + $$.(*ast.StmtDeclare).Consts = $3 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) + + // save comments + 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) + } + | ';' + { + $$ = &ast.StmtNop{ast.Node{}, } + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + 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_list finally_statement + { + if $6 == nil { + $$ = &ast.StmtTry{ast.Node{}, $3, $5, $6} + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $5) + } else { + $$ = &ast.StmtTry{ast.Node{}, $3, $5, $6} + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6) + } + + // save comments + 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 ';' + { + $$ = &ast.StmtThrow{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + 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 := &ast.Identifier{ast.Node{}, $2.Value} + $$ = &ast.StmtGoto{ast.Node{}, label} + + // save position + label.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + 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) + } + | T_STRING ':' + { + label := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.StmtLabel{ast.Node{}, label} + + // save position + label.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Label, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + +catch_list: + /* empty */ + { + $$ = []ast.Vertex{} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | catch_list T_CATCH '(' catch_name_list T_VARIABLE ')' '{' inner_statement_list '}' + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($5.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + catch := &ast.StmtCatch{ast.Node{}, $4, variable, $8} + $$ = append($1, catch) + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($5) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($5) + catch.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($2, $9) + + // save comments + yylex.(*Parser).setFreeFloating(catch, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(catch, token.Catch, $3.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $5.Tokens) + yylex.(*Parser).setFreeFloating(catch, token.Var, $6.Tokens) + yylex.(*Parser).setFreeFloating(catch, token.Cond, $7.Tokens) + yylex.(*Parser).setFreeFloating(catch, token.Stmts, $9.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; +catch_name_list: + name + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | catch_name_list '|' name + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +finally_statement: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FINALLY '{' inner_statement_list '}' + { + $$ = &ast.StmtFinally{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + 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) + } +; + +unset_variables: + unset_variable + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | unset_variables ',' unset_variable + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +unset_variable: + variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +function_declaration_statement: + T_FUNCTION returns_ref T_STRING backup_doc_comment '(' parameter_list ')' return_type '{' inner_statement_list '}' + { + name := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtFunction{ast.Node{}, $2 != nil, name, $6, $8, $10} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11) + + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + if $2 != nil { + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) + } else { + yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) + } + yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParamList, $7.Tokens) + if $8 != nil { + yylex.(*Parser).setFreeFloating($$, token.Params, $8.GetNode().Tokens[token.Colon]); delete($8.GetNode().Tokens, token.Colon) + } + yylex.(*Parser).setFreeFloating($$, token.ReturnType, $9.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $11.Tokens) + + // normalize + if $8 == nil { + yylex.(*Parser).setFreeFloating($$, token.Params, $$.GetNode().Tokens[token.ReturnType]); delete($$.GetNode().Tokens, token.ReturnType) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +is_reference: + /* empty */ + { + $$ = nil + } + | '&' + { + $$ = $1 + } +; + +is_variadic: + /* empty */ + { + $$ = nil + } + | T_ELLIPSIS + { + $$ = $1 + } +; + +class_declaration_statement: + class_modifiers T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' + { + name := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtClass{ast.Node{}, name, $1, nil, $4, $5, $8} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $9) + + // save comments + yylex.(*Parser).MoveFreeFloating($1[0], $$) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' + { + name := &ast.Identifier{ast.Node{}, $2.Value} + $$ = &ast.StmtClass{ast.Node{}, name, nil, nil, $3, $4, $7} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +class_modifiers: + class_modifier + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | class_modifiers class_modifier + { + $$ = append($1, $2) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +class_modifier: + T_ABSTRACT + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FINAL + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +trait_declaration_statement: + T_TRAIT T_STRING backup_doc_comment '{' class_statement_list '}' + { + name := &ast.Identifier{ast.Node{}, $2.Value} + $$ = &ast.StmtTrait{ast.Node{}, name, $5} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6) + + // save comments + 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) + } +; + +interface_declaration_statement: + T_INTERFACE T_STRING interface_extends_list backup_doc_comment '{' class_statement_list '}' + { + name := &ast.Identifier{ast.Node{}, $2.Value} + $$ = &ast.StmtInterface{ast.Node{}, name, $3, $6} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + 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) + } +; + +extends_from: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_EXTENDS name + { + $$ = &ast.StmtClassExtends{ast.Node{}, $2}; + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +interface_extends_list: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_EXTENDS name_list + { + $$ = &ast.StmtInterfaceExtends{ast.Node{}, $2}; + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +implements_list: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_IMPLEMENTS name_list + { + $$ = &ast.StmtClassImplements{ast.Node{}, $2}; + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +foreach_variable: + variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '&' variable + { + $$ = &ast.ExprReference{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_LIST '(' array_pair_list ')' + { + $$ = &ast.ExprList{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + 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) + } + | '[' array_pair_list ']' + { + $$ = &ast.ExprShortList{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save commentsc + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +for_statement: + statement + { + $$ = &ast.StmtFor{ast.Node{}, nil, nil, nil, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | ':' inner_statement_list T_ENDFOR ';' + { + stmtList := &ast.StmtStmtList{ast.Node{}, $2} + $$ = &ast.StmtAltFor{ast.Node{}, nil, nil, nil, stmtList} + + // save position + stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + 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) + } +; + +foreach_statement: + statement + { + $$ = &ast.StmtForeach{ast.Node{}, nil, nil, nil, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | ':' inner_statement_list T_ENDFOREACH ';' + { + stmtList := &ast.StmtStmtList{ast.Node{}, $2} + $$ = &ast.StmtAltForeach{ast.Node{}, nil, nil, nil, stmtList} + + // save position + stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + 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) + } +; + +declare_statement: + statement + { + $$ = &ast.StmtDeclare{ast.Node{}, false, nil, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | ':' inner_statement_list T_ENDDECLARE ';' + { + stmtList := &ast.StmtStmtList{ast.Node{}, $2} + $$ = &ast.StmtDeclare{ast.Node{}, true, nil, stmtList} + + // save position + stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + 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) + } +; + +switch_case_list: + '{' case_list '}' + { + caseList := &ast.StmtCaseList{ast.Node{}, $2} + $$ = &ast.StmtSwitch{ast.Node{}, nil, caseList} + + // save position + caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '{' ';' case_list '}' + { + caseList := &ast.StmtCaseList{ast.Node{}, $3} + $$ = &ast.StmtSwitch{ast.Node{}, nil, caseList} + + // save position + caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + 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 := &ast.StmtCaseList{ast.Node{}, $2} + $$ = &ast.StmtAltSwitch{ast.Node{}, nil, caseList} + + // save position + caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + 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 := &ast.StmtCaseList{ast.Node{}, $3} + $$ = &ast.StmtAltSwitch{ast.Node{}, nil, caseList} + + // save position + caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) + + // save comments + 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) + } +; + +case_list: + /* empty */ + { + $$ = []ast.Vertex{} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | case_list T_CASE expr case_separator inner_statement_list + { + _case := &ast.StmtCase{ast.Node{}, $3, $5} + $$ = append($1, _case) + + // save position + _case.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5) + + // save comments + yylex.(*Parser).setFreeFloating(_case, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_case, token.Expr, append($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 := &ast.StmtDefault{ast.Node{}, $4} + $$ = append($1, _default) + + // save position + _default.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4) + + // save comments + 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) + } +; + +case_separator: + ':' + { + $$ = $1 + } + | ';' + { + $$ = $1 + } +; + +while_statement: + statement + { + $$ = &ast.StmtWhile{ast.Node{}, nil, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | ':' inner_statement_list T_ENDWHILE ';' + { + stmtList := &ast.StmtStmtList{ast.Node{}, $2} + $$ = &ast.StmtAltWhile{ast.Node{}, nil, stmtList} + + // save position + stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + 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) + } +; + +if_stmt_without_else: + T_IF '(' expr ')' statement + { + $$ = &ast.StmtIf{ast.Node{}, $3, $5, nil, nil} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.If, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | if_stmt_without_else T_ELSEIF '(' expr ')' statement + { + _elseIf := &ast.StmtElseIf{ast.Node{}, $4, $6} + $1.(*ast.StmtIf).ElseIf = append($1.(*ast.StmtIf).ElseIf, _elseIf) + + $$ = $1 + + // save position + _elseIf.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6) + + // save comments + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.Tokens) + yylex.(*Parser).setFreeFloating(_elseIf, token.Expr, $5.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +if_stmt: + if_stmt_without_else %prec T_NOELSE + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | if_stmt_without_else T_ELSE statement + { + _else := &ast.StmtElse{ast.Node{}, $3} + $1.(*ast.StmtIf).Else = _else + + $$ = $1 + + // save position + _else.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(_else, token.Start, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +alt_if_stmt_without_else: + T_IF '(' expr ')' ':' inner_statement_list + { + stmts := &ast.StmtStmtList{ast.Node{}, $6} + $$ = &ast.StmtAltIf{ast.Node{}, $3, stmts, nil, nil} + + // save position + stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($6) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $6) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.If, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $5.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | alt_if_stmt_without_else T_ELSEIF '(' expr ')' ':' inner_statement_list + { + stmts := &ast.StmtStmtList{ast.Node{}, $7} + _elseIf := &ast.StmtAltElseIf{ast.Node{}, $4, stmts} + $1.(*ast.StmtAltIf).ElseIf = append($1.(*ast.StmtAltIf).ElseIf, _elseIf) + + $$ = $1 + + // save position + stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($7) + _elseIf.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $7) + + // save comments + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.Tokens) + yylex.(*Parser).setFreeFloating(_elseIf, token.Expr, $5.Tokens) + yylex.(*Parser).setFreeFloating(_elseIf, token.Cond, $6.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +alt_if_stmt: + alt_if_stmt_without_else T_ENDIF ';' + { + $$ = $1 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Stmts, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';' + { + stmts := &ast.StmtStmtList{ast.Node{}, $4} + _else := &ast.StmtAltElse{ast.Node{}, stmts} + $1.(*ast.StmtAltIf).Else = _else + + $$ = $1 + + // save position + stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($4) + _else.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6) + + // save comments + yylex.(*Parser).setFreeFloating(_else, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_else, token.Else, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($6)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +parameter_list: + non_empty_parameter_list + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +non_empty_parameter_list: + parameter + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | non_empty_parameter_list ',' parameter + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +parameter: + optional_type is_reference is_variadic T_VARIABLE + { + 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.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + if $1 != nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + } else if $2 != nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($2, $4) + } else if $3 != nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4) + } else { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + } + + // save comments + if $1 != nil { + yylex.(*Parser).MoveFreeFloating($1, $$) + } + if $2 != nil { + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Tokens) + } + if $3 != nil { + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) + } + yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) + + // normalize + if $3 == nil { + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $$.GetNode().Tokens[token.Variadic]); delete($$.GetNode().Tokens, token.Variadic) + } + if $2 == nil { + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $$.GetNode().Tokens[token.Ampersand]); delete($$.GetNode().Tokens, token.Ampersand) + } + if $1 == nil { + yylex.(*Parser).setFreeFloating($$, token.Start, $$.GetNode().Tokens[token.OptionalType]); delete($$.GetNode().Tokens, token.OptionalType) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | optional_type is_reference is_variadic T_VARIABLE '=' expr + { + 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.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + if $1 != nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6) + } else if $2 != nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6) + } else if $3 != nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $6) + } else { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6) + } + + // save comments + if $1 != nil { + yylex.(*Parser).MoveFreeFloating($1, $$) + } + if $2 != nil { + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Tokens) + } + if $3 != nil { + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) + } + yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) + + // normalize + if $3 == nil { + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $$.GetNode().Tokens[token.Variadic]); delete($$.GetNode().Tokens, token.Variadic) + } + if $2 == nil { + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $$.GetNode().Tokens[token.Ampersand]); delete($$.GetNode().Tokens, token.Ampersand) + } + if $1 == nil { + yylex.(*Parser).setFreeFloating($$, token.Start, $$.GetNode().Tokens[token.OptionalType]); delete($$.GetNode().Tokens, token.OptionalType) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +optional_type: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | type_expr + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +type_expr: + type + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '?' type + { + $$ = &ast.Nullable{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +type: + T_ARRAY + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_CALLABLE + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | name + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +return_type: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | ':' type_expr + { + $$ = $2; + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Colon, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +argument_list: + '(' ')' + { + $$ = &ast.ArgumentList{ast.Node{}, nil} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '(' non_empty_argument_list possible_comma ')' + { + $$ = &ast.ArgumentList{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + if $3 != nil { + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, append($3.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($3), $4.Tokens...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $4.Tokens) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +non_empty_argument_list: + argument + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | non_empty_argument_list ',' argument + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +argument: + expr + { + $$ = &ast.Argument{ast.Node{}, false, false, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_ELLIPSIS expr + { + $$ = &ast.Argument{ast.Node{}, true, false, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +global_var_list: + global_var_list ',' global_var + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | global_var + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +global_var: + simple_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +static_var_list: + static_var_list ',' static_var + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | static_var + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +static_var: + T_VARIABLE + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.StmtStaticVar{ast.Node{}, variable, nil} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_VARIABLE '=' expr + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.StmtStaticVar{ast.Node{}, variable, $3} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +class_statement_list: + class_statement_list class_statement + { + $$ = append($1, $2) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | /* empty */ + { + $$ = []ast.Vertex{} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +class_statement: + variable_modifiers optional_type property_list ';' + { + $$ = &ast.StmtPropertyList{ast.Node{}, $1, $2, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1[0], $$) + yylex.(*Parser).setFreeFloating($$, token.PropertyList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | method_modifiers T_CONST class_const_list ';' + { + $$ = &ast.StmtClassConstList{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $4) + + // save comments + if len($1) > 0 { + yylex.(*Parser).MoveFreeFloating($1[0], $$) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) + } else { + yylex.(*Parser).setFreeFloating($$, token.Start, $2.Tokens) + } + yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_USE name_list trait_adaptations + { + $$ = &ast.StmtTraitUse{ast.Node{}, $2, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | method_modifiers T_FUNCTION returns_ref identifier backup_doc_comment '(' parameter_list ')' return_type method_body + { + name := &ast.Identifier{ast.Node{}, $4.Value} + $$ = &ast.StmtClassMethod{ast.Node{}, $3 != nil, name, $1, $7, $9, $10} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + if $1 == nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $10) + } else { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListNodePosition($1, $10) + } + + // save comments + if len($1) > 0 { + yylex.(*Parser).MoveFreeFloating($1[0], $$) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) + } else { + yylex.(*Parser).setFreeFloating($$, token.Start, $2.Tokens) + } + if $3 == nil { + yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) + } else { + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) + } + yylex.(*Parser).setFreeFloating($$, token.Name, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $8.Tokens) + if $9 != nil { + yylex.(*Parser).setFreeFloating($$, token.Params, $9.GetNode().Tokens[token.Colon]); delete($9.GetNode().Tokens, token.Colon) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +name_list: + name + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | name_list ',' name + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +trait_adaptations: + ';' + { + $$ = &ast.StmtNop{ast.Node{}, } + + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) + + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '{' '}' + { + $$ = &ast.StmtTraitAdaptationList{ast.Node{}, nil} + + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '{' trait_adaptation_list '}' + { + $$ = &ast.StmtTraitAdaptationList{ast.Node{}, $2} + + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +trait_adaptation_list: + trait_adaptation + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | trait_adaptation_list trait_adaptation + { + $$ = append($1, $2) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +trait_adaptation: + trait_precedence ';' + { + $$ = $1; + + // save comments + yylex.(*Parser).setFreeFloating($$, token.NameList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | trait_alias ';' + { + $$ = $1; + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Alias, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +trait_precedence: + absolute_trait_method_reference T_INSTEADOF name_list + { + $$ = &ast.StmtTraitUsePrecedence{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +trait_alias: + trait_method_reference T_AS T_STRING + { + alias := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, nil, alias} + + // save position + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | trait_method_reference T_AS reserved_non_modifiers + { + alias := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, nil, alias} + + // save position + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | trait_method_reference T_AS member_modifier identifier + { + alias := &ast.Identifier{ast.Node{}, $4.Value} + $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, $3, alias} + + // save position + 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($$, token.Ref, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | trait_method_reference T_AS member_modifier + { + $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, $3, nil} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +trait_method_reference: + identifier + { + name := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.StmtTraitMethodRef{ast.Node{}, nil, name} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | absolute_trait_method_reference + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +absolute_trait_method_reference: + name T_PAAMAYIM_NEKUDOTAYIM identifier + { + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtTraitMethodRef{ast.Node{}, $1, target} + + // save position + 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($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +method_body: + ';' /* abstract method */ + { + $$ = &ast.StmtNop{ast.Node{}, } + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '{' inner_statement_list '}' + { + $$ = &ast.StmtStmtList{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +variable_modifiers: + non_empty_member_modifiers + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_VAR + { + modifier := &ast.Identifier{ast.Node{}, $1.Value} + $$ = []ast.Vertex{modifier} + + // save position + modifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +method_modifiers: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | non_empty_member_modifiers + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +non_empty_member_modifiers: + member_modifier + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | non_empty_member_modifiers member_modifier + { + $$ = append($1, $2) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +member_modifier: + T_PUBLIC + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_PROTECTED + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_PRIVATE + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_STATIC + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_ABSTRACT + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FINAL + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +property_list: + property_list ',' property + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | property + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +property: + T_VARIABLE backup_doc_comment + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.StmtProperty{ast.Node{}, variable, nil} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_VARIABLE '=' expr backup_doc_comment + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.StmtProperty{ast.Node{}, variable, $3} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +class_const_list: + class_const_list ',' class_const_decl + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | class_const_decl + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +class_const_decl: + identifier '=' expr backup_doc_comment + { + name := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.StmtConstant{ast.Node{}, name, $3} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +const_decl: + T_STRING '=' expr backup_doc_comment + { + name := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.StmtConstant{ast.Node{}, name, $3} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +echo_expr_list: + echo_expr_list ',' echo_expr + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | echo_expr + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +echo_expr: + expr + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +for_exprs: + /* empty */ + { + $$ = nil; + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | non_empty_for_exprs + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +non_empty_for_exprs: + non_empty_for_exprs ',' expr + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +anonymous_class: + T_CLASS ctor_arguments extends_from implements_list backup_doc_comment '{' class_statement_list '}' + { + if $2 != nil { + $$ = &ast.StmtClass{ast.Node{}, nil, nil, $2.(*ast.ArgumentList), $3, $4, $7} + } else { + $$ = &ast.StmtClass{ast.Node{}, nil, nil, nil, $3, $4, $7} + } + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +new_expr: + T_NEW class_name_reference ctor_arguments + { + if $3 != nil { + $$ = &ast.ExprNew{ast.Node{}, $2, $3.(*ast.ArgumentList)} + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + } else { + $$ = &ast.ExprNew{ast.Node{}, $2, nil} + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + } + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NEW anonymous_class + { + $$ = &ast.ExprNew{ast.Node{}, $2, nil} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +expr_without_variable: + T_LIST '(' array_pair_list ')' '=' expr + { + listNode := &ast.ExprList{ast.Node{}, $3} + $$ = &ast.ExprAssign{ast.Node{}, listNode, $6} + + // save position + listNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6) + + // save comments + 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) + } + | '[' array_pair_list ']' '=' expr + { + shortList := &ast.ExprShortList{ast.Node{}, $2} + $$ = &ast.ExprAssign{ast.Node{}, shortList, $5} + + // save position + shortList.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(shortList, token.ArrayPairList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable '=' expr + { + $$ = &ast.ExprAssign{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable '=' '&' expr + { + $$ = &ast.ExprAssignReference{ast.Node{}, $1, $4} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_CLONE expr + { + $$ = &ast.ExprClone{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_PLUS_EQUAL expr + { + $$ = &ast.ExprAssignPlus{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_MINUS_EQUAL expr + { + $$ = &ast.ExprAssignMinus{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_MUL_EQUAL expr + { + $$ = &ast.ExprAssignMul{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_POW_EQUAL expr + { + $$ = &ast.ExprAssignPow{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_DIV_EQUAL expr + { + $$ = &ast.ExprAssignDiv{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_CONCAT_EQUAL expr + { + $$ = &ast.ExprAssignConcat{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_MOD_EQUAL expr + { + $$ = &ast.ExprAssignMod{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_AND_EQUAL expr + { + $$ = &ast.ExprAssignBitwiseAnd{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_OR_EQUAL expr + { + $$ = &ast.ExprAssignBitwiseOr{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_XOR_EQUAL expr + { + $$ = &ast.ExprAssignBitwiseXor{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_SL_EQUAL expr + { + $$ = &ast.ExprAssignShiftLeft{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_SR_EQUAL expr + { + $$ = &ast.ExprAssignShiftRight{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_COALESCE_EQUAL expr + { + $$ = &ast.ExprAssignCoalesce{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_INC + { + $$ = &ast.ExprPostInc{ast.Node{}, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_INC variable + { + $$ = &ast.ExprPreInc{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_DEC + { + $$ = &ast.ExprPostDec{ast.Node{}, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_DEC variable + { + $$ = &ast.ExprPreDec{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_BOOLEAN_OR expr + { + $$ = &ast.ExprBinaryBooleanOr{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_BOOLEAN_AND expr + { + $$ = &ast.ExprBinaryBooleanAnd{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_LOGICAL_OR expr + { + $$ = &ast.ExprBinaryLogicalOr{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_LOGICAL_AND expr + { + $$ = &ast.ExprBinaryLogicalAnd{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_LOGICAL_XOR expr + { + $$ = &ast.ExprBinaryLogicalXor{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '|' expr + { + $$ = &ast.ExprBinaryBitwiseOr{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '&' expr + { + $$ = &ast.ExprBinaryBitwiseAnd{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '^' expr + { + $$ = &ast.ExprBinaryBitwiseXor{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '.' expr + { + $$ = &ast.ExprBinaryConcat{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '+' expr + { + $$ = &ast.ExprBinaryPlus{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '-' expr + { + $$ = &ast.ExprBinaryMinus{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '*' expr + { + $$ = &ast.ExprBinaryMul{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_POW expr + { + $$ = &ast.ExprBinaryPow{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '/' expr + { + $$ = &ast.ExprBinaryDiv{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '%' expr + { + $$ = &ast.ExprBinaryMod{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_SL expr + { + $$ = &ast.ExprBinaryShiftLeft{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_SR expr + { + $$ = &ast.ExprBinaryShiftRight{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '+' expr %prec T_INC + { + $$ = &ast.ExprUnaryPlus{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '-' expr %prec T_INC + { + $$ = &ast.ExprUnaryMinus{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '!' expr + { + $$ = &ast.ExprBooleanNot{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '~' expr + { + $$ = &ast.ExprBitwiseNot{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_IS_IDENTICAL expr + { + $$ = &ast.ExprBinaryIdentical{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_IS_NOT_IDENTICAL expr + { + $$ = &ast.ExprBinaryNotIdentical{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_IS_EQUAL expr + { + $$ = &ast.ExprBinaryEqual{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_IS_NOT_EQUAL expr + { + $$ = &ast.ExprBinaryNotEqual{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '<' expr + { + $$ = &ast.ExprBinarySmaller{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_IS_SMALLER_OR_EQUAL expr + { + $$ = &ast.ExprBinarySmallerOrEqual{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '>' expr + { + $$ = &ast.ExprBinaryGreater{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_IS_GREATER_OR_EQUAL expr + { + $$ = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_SPACESHIP expr + { + $$ = &ast.ExprBinarySpaceship{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_INSTANCEOF class_name_reference + { + $$ = &ast.ExprInstanceOf{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '(' expr ')' + { + $$ = $2; + + // save comments + 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) + } + | new_expr + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '?' expr ':' expr + { + $$ = &ast.ExprTernary{ast.Node{}, $1, $3, $5} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '?' ':' expr + { + $$ = &ast.ExprTernary{ast.Node{}, $1, nil, $4} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_COALESCE expr + { + $$ = &ast.ExprBinaryCoalesce{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | internal_functions_in_yacc + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_INT_CAST expr + { + $$ = &ast.ExprCastInt{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + 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 + { + $$ = &ast.ExprCastDouble{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + 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 + { + $$ = &ast.ExprCastString{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + 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 + { + $$ = &ast.ExprCastArray{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + 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 + { + $$ = &ast.ExprCastObject{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + 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 + { + $$ = &ast.ExprCastBool{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + 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 + { + $$ = &ast.ExprCastUnset{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + 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 + { + var e *ast.ExprExit; + if $2 != nil { + e = $2.(*ast.ExprExit) + } else { + e = &ast.ExprExit{ast.Node{}, false, nil} + } + + $$ = e + + if (bytes.EqualFold($1.Value, []byte("die"))) { + e.Die = true + } + + // save position + if $2 == nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + } else { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + } + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '@' expr + { + $$ = &ast.ExprErrorSuppress{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | scalar + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '`' backticks_expr '`' + { + $$ = &ast.ExprShellExec{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_PRINT expr + { + $$ = &ast.ExprPrint{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_YIELD + { + $$ = &ast.ExprYield{ast.Node{}, nil, nil} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_YIELD expr + { + $$ = &ast.ExprYield{ast.Node{}, nil, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_YIELD expr T_DOUBLE_ARROW expr + { + $$ = &ast.ExprYield{ast.Node{}, $2, $4} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_YIELD_FROM expr + { + $$ = &ast.ExprYieldFrom{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | inline_function + { + $$ = $1; + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_STATIC inline_function + { + $$ = $2; + + switch n := $$.(type) { + case *ast.ExprClosure : + n.Static = true; + case *ast.ExprArrowFunction : + n.Static = true; + }; + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Static, $$.GetNode().Tokens[token.Start]); delete($$.GetNode().Tokens, token.Start) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens); + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +inline_function: + T_FUNCTION returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars return_type '{' inner_statement_list '}' + { + $$ = &ast.ExprClosure{ast.Node{}, $2 != nil, false, $5, $7, $8, $10} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + if $2 == nil { + yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) + } else { + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) + } + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.Tokens) + if $8 != nil { + yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $8.GetNode().Tokens[token.Colon]); delete($8.GetNode().Tokens, token.Colon) + } + yylex.(*Parser).setFreeFloating($$, token.ReturnType, $9.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $11.Tokens) + + // normalize + if $8 == nil { + yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $$.GetNode().Tokens[token.ReturnType]); delete($$.GetNode().Tokens, token.ReturnType) + } + if $7 == nil { + yylex.(*Parser).setFreeFloating($$, token.Params, $$.GetNode().Tokens[token.LexicalVarList]); delete($$.GetNode().Tokens, token.LexicalVarList) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FN returns_ref '(' parameter_list ')' return_type backup_doc_comment T_DOUBLE_ARROW expr + { + $$ = &ast.ExprArrowFunction{ast.Node{}, $2 != nil, false, $4, $6, $9} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + if $2 == nil { + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) + } else { + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) + }; + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.Tokens) + if $6 != nil { + yylex.(*Parser).setFreeFloating($$, token.Params, $6.GetNode().Tokens[token.Colon]); delete($6.GetNode().Tokens, token.Colon) + }; + yylex.(*Parser).setFreeFloating($$, token.ReturnType, $8.Tokens) + + // normalize + if $6 == nil { + yylex.(*Parser).setFreeFloating($$, token.Params, $$.GetNode().Tokens[token.ReturnType]); delete($$.GetNode().Tokens, token.ReturnType) + }; + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +backup_doc_comment: + /* empty */ + { + $$ = yylex.(*Parser).Lexer.GetPhpDocComment() + yylex.(*Parser).Lexer.SetPhpDocComment("") + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +returns_ref: + /* empty */ + { + $$ = nil + } + | '&' + { + $$ = $1 + } +; + +lexical_vars: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_USE '(' lexical_var_list ')' + { + $$ = &ast.ExprClosureUse{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + 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) + } +; + +lexical_var_list: + lexical_var_list ',' lexical_var + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | lexical_var + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +lexical_var: + T_VARIABLE + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + $$ = &ast.ExprVariable{ast.Node{}, identifier} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '&' T_VARIABLE + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($2.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.ExprReference{ast.Node{}, variable} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +function_call: + name argument_list + { + $$ = &ast.ExprFunctionCall{ast.Node{}, $1, $2.(*ast.ArgumentList)} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list + { + $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list + { + $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | callable_expr argument_list + { + $$ = &ast.ExprFunctionCall{ast.Node{}, $1, $2.(*ast.ArgumentList)} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +class_name: + T_STATIC + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | name + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +class_name_reference: + class_name + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | new_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +exit_expr: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '(' optional_expr ')' + { + $$ = &ast.ExprExit{ast.Node{}, false, $2}; + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Exit, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +backticks_expr: + /* empty */ + { + $$ = []ast.Vertex{} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_ENCAPSED_AND_WHITESPACE + { + part := &ast.ScalarEncapsedStringPart{ast.Node{}, $1.Value} + $$ = []ast.Vertex{part} + + // save position + part.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | encaps_list + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +ctor_arguments: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | argument_list + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +dereferencable_scalar: + T_ARRAY '(' array_pair_list ')' + { + $$ = &ast.ExprArray{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + 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 ']' + { + $$ = &ast.ExprShortArray{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_CONSTANT_ENCAPSED_STRING + { + $$ = &ast.ScalarString{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +scalar: + T_LNUMBER + { + $$ = &ast.ScalarLnumber{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_DNUMBER + { + $$ = &ast.ScalarDnumber{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_LINE + { + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FILE + { + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_DIR + { + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_TRAIT_C + { + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_METHOD_C + { + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FUNC_C + { + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NS_C + { + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_CLASS_C + { + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC + { + encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, $2.Value} + $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, []ast.Vertex{encapsed}} + + // save position + encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_START_HEREDOC T_END_HEREDOC + { + $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, nil} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '"' encaps_list '"' + { + $$ = &ast.ScalarEncapsed{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_START_HEREDOC encaps_list T_END_HEREDOC + { + $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | dereferencable_scalar + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | constant + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +constant: + name + { + $$ = &ast.ExprConstFetch{ast.Node{}, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | class_name T_PAAMAYIM_NEKUDOTAYIM identifier + { + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} + + // save position + 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($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable_class_name T_PAAMAYIM_NEKUDOTAYIM identifier + { + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} + + // save position + 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($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +expr: + variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr_without_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +optional_expr: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +variable_class_name: + dereferencable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +dereferencable: + variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '(' expr ')' + { + $$ = $2; + + // save comments + 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) + } + | dereferencable_scalar + { + $$ = $1; + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +callable_expr: + callable_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '(' expr ')' + { + $$ = $2; + + // save comments + 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) + } + | dereferencable_scalar + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +callable_variable: + simple_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | dereferencable '[' optional_expr ']' + { + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + 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) + } + | constant '[' optional_expr ']' + { + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + 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) + } + | dereferencable '{' expr '}' + { + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + 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) + } + | dereferencable T_OBJECT_OPERATOR property_name argument_list + { + $$ = &ast.ExprMethodCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | function_call + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +variable: + callable_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | static_member + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | dereferencable T_OBJECT_OPERATOR property_name + { + $$ = &ast.ExprPropertyFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +simple_variable: + T_VARIABLE + { + name := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + $$ = &ast.ExprVariable{ast.Node{}, name} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '$' '{' expr '}' + { + $$ = &ast.ExprVariable{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + 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) + } + | '$' simple_variable + { + $$ = &ast.ExprVariable{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +static_member: + class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable + { + $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable + { + $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +new_variable: + simple_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | new_variable '[' optional_expr ']' + { + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + 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) + } + | new_variable '{' expr '}' + { + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + 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) + } + | new_variable T_OBJECT_OPERATOR property_name + { + $$ = &ast.ExprPropertyFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable + { + $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable + { + $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +member_name: + identifier + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '{' expr '}' + { + $$ = $2; + + // save comments + 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) + } + | simple_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +property_name: + T_STRING + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '{' expr '}' + { + $$ = $2; + + // save comments + 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) + } + | simple_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +array_pair_list: + non_empty_array_pair_list + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +possible_array_pair: + /* empty */ + { + $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, nil} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | array_pair + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +non_empty_array_pair_list: + non_empty_array_pair_list ',' possible_array_pair + { + if len($1) == 0 { + $1 = []ast.Vertex{&ast.ExprArrayItem{ast.Node{}, false, nil, nil}} + } + + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | possible_array_pair + { + if $1.(*ast.ExprArrayItem).Key == nil && $1.(*ast.ExprArrayItem).Val == nil { + $$ = []ast.Vertex{} + } else { + $$ = []ast.Vertex{$1} + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +array_pair: + expr T_DOUBLE_ARROW expr + { + $$ = &ast.ExprArrayItem{ast.Node{}, false, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr + { + $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_DOUBLE_ARROW '&' variable + { + reference := &ast.ExprReference{ast.Node{}, $4} + $$ = &ast.ExprArrayItem{ast.Node{}, false, $1, reference} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '&' variable + { + reference := &ast.ExprReference{ast.Node{}, $2} + $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, reference} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_ELLIPSIS expr + { + $$ = &ast.ExprArrayItem{ast.Node{}, true, nil, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_DOUBLE_ARROW T_LIST '(' array_pair_list ')' + { + // TODO: Cannot use list() as standalone expression + listNode := &ast.ExprList{ast.Node{}, $5} + $$ = &ast.ExprArrayItem{ast.Node{}, false, $1, listNode} + + // save position + listNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($3, $6) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $4.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $6.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_LIST '(' array_pair_list ')' + { + // TODO: Cannot use list() as standalone expression + listNode := &ast.ExprList{ast.Node{}, $3} + $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, listNode} + + // save position + listNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + 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) + } +; + +encaps_list: + encaps_list encaps_var + { + $$ = append($1, $2) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | encaps_list T_ENCAPSED_AND_WHITESPACE + { + encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, $2.Value} + $$ = append($1, encapsed) + + // save position + encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + + // save comments + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | encaps_var + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_ENCAPSED_AND_WHITESPACE encaps_var + { + encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, $1.Value} + $$ = []ast.Vertex{encapsed, $2} + + // save position + encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +encaps_var: + T_VARIABLE + { + name := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + $$ = &ast.ExprVariable{ast.Node{}, name} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_VARIABLE '[' encaps_var_offset ']' + { + 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.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).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 := &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.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).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 := &ast.ExprVariable{ast.Node{}, $2} + + $$ = variable + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + 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 := &ast.Identifier{ast.Node{}, $2.Value} + variable := &ast.ExprVariable{ast.Node{}, name} + + $$ = variable + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + 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 := &ast.Identifier{ast.Node{}, $2.Value} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.ExprArrayDimFetch{ast.Node{}, variable, $4} + + // save position + 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($$, 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) + } + | T_CURLY_OPEN variable '}' + { + $$ = $2; + + // save comments + 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) + } +; + +encaps_var_offset: + T_STRING + { + $$ = &ast.ScalarString{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + 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(string($1.Value)); err == nil { + $$ = &ast.ScalarLnumber{ast.Node{}, $1.Value} + } else { + $$ = &ast.ScalarString{ast.Node{}, $1.Value} + } + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '-' T_NUM_STRING + { + var lnumber *ast.ScalarLnumber + // TODO: add option to handle 64 bit integer + _, err := strconv.Atoi(string($2.Value)); + isInt := err == nil + + if isInt { + lnumber = &ast.ScalarLnumber{ast.Node{}, $2.Value} + $$ = &ast.ExprUnaryMinus{ast.Node{}, lnumber} + } else { + $2.Value = append([]byte("-"), $2.Value...) + $$ = &ast.ScalarString{ast.Node{}, $2.Value} + } + + // save position + if isInt { + lnumber.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + } + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_VARIABLE + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + $$ = &ast.ExprVariable{ast.Node{}, identifier} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +internal_functions_in_yacc: + T_ISSET '(' isset_variables possible_comma ')' + { + $$ = &ast.ExprIsset{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Isset, $2.Tokens) + if $4 == nil { + yylex.(*Parser).setFreeFloating($$, token.VarList, $5.Tokens) + } else { + yylex.(*Parser).setFreeFloating($$, token.VarList, append($4.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($4), $5.Tokens...)...)) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_EMPTY '(' expr ')' + { + $$ = &ast.ExprEmpty{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + 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 + { + $$ = &ast.ExprInclude{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_INCLUDE_ONCE expr + { + $$ = &ast.ExprIncludeOnce{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_EVAL '(' expr ')' + { + $$ = &ast.ExprEval{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + 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 + { + $$ = &ast.ExprRequire{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_REQUIRE_ONCE expr + { + $$ = &ast.ExprRequireOnce{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +isset_variables: + isset_variable + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | isset_variables ',' isset_variable + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +isset_variable: + expr + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +///////////////////////////////////////////////////////////////////////// + +%% diff --git a/php7/php7_bench_test.go b/internal/php7/php7_bench_test.go similarity index 99% rename from php7/php7_bench_test.go rename to internal/php7/php7_bench_test.go index c7acc29..a5a9aee 100644 --- a/php7/php7_bench_test.go +++ b/internal/php7/php7_bench_test.go @@ -3,7 +3,7 @@ package php7_test import ( "testing" - "github.com/z7zmey/php-parser/php7" + "github.com/z7zmey/php-parser/internal/php7" ) func BenchmarkPhp7(b *testing.B) { diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go new file mode 100644 index 0000000..5e0268a --- /dev/null +++ b/internal/php7/php7_test.go @@ -0,0 +1,20023 @@ +package php7_test + +import ( + "testing" + + "gotest.tools/assert" + + "github.com/z7zmey/php-parser/internal/php7" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/errors" + "github.com/z7zmey/php-parser/pkg/position" +) + +func TestPhp7(t *testing.T) { + src := `bar($a, ...$b); + foo::bar($a, ...$b); + $foo::bar($a, ...$b); + new foo($a, ...$b); + /** anonymous class */ + new class ($a, ...$b) {}; + new class {}; + new $foo; + new $foo[1]; + new $foo{$bar}; + new $foo->bar; + new $foo::$bar; + new static::$bar; + + function foo(?bar $bar=null, baz &...$baz) {} + class foo {public function foo(?bar $bar=null, baz &...$baz) {}} + function(?bar $bar=null, baz &...$baz) {}; + static function(?bar $bar=null, baz &...$baz) {}; + + 1234567890123456789; + 12345678901234567890; + 0.; + 0b0111111111111111111111111111111111111111111111111111111111111111; + 0b1111111111111111111111111111111111111111111111111111111111111111; + 0x007111111111111111; + 0x8111111111111111; + __CLASS__; + __DIR__; + __FILE__; + __FUNCTION__; + __LINE__; + __NAMESPACE__; + __METHOD__; + __TRAIT__; + + "test $var"; + "test $var[1]"; + "test $var[-1]"; + "test $var[1234567890123456789012345678901234567890]"; + "test $var[-1234567890123456789012345678901234567890]"; + "test $var[bar]"; + "test $var[$bar]"; + "$foo $bar"; + "test $foo->bar()"; + "test ${foo}"; + "test ${foo[0]}"; + "test ${$foo}"; + "test {$foo->bar()}"; + + if ($a) : + endif; + if ($a) : + elseif ($b): + endif; + if ($a) : + else: + endif; + if ($a) : + elseif ($b): + elseif ($c): + else: + endif; + + while (1) { break; } + while (1) { break 2; } + while (1) : break(3); endwhile; + class foo{ public const FOO = 1, BAR = 2; } + class foo{ const FOO = 1, BAR = 2; } + class foo{ function bar() {} } + class foo{ public static function &bar() {} } + class foo{ public static function &bar(): void {} } + abstract class foo{ } + final class foo extends bar { } + final class foo implements bar { } + final class foo implements bar, baz { } + new class() extends foo implements bar, baz { }; + + const FOO = 1, BAR = 2; + while (1) { continue; } + while (1) { continue 2; } + while (1) { continue(3); } + declare(ticks=1); + declare(ticks=1) {} + declare(ticks=1): enddeclare; + do {} while(1); + echo $a, 1; + echo($a); + for($i = 0; $i < 10; $i++, $i++) {} + for(; $i < 10; $i++, $i++) : endfor; + foreach ($a as $v) {} + foreach ($a as $v) : endforeach; + foreach ($a as $k => $v) {} + foreach ($a as $k => &$v) {} + foreach ($a as $k => list($v)) {} + foreach ($a as $k => [$v]) {} + function foo() {} + function foo() {return;} + function &foo() {return 1;} + function &foo(): void {} + global $a, $b; + a: + goto a; + if ($a) {} + if ($a) {} elseif ($b) {} + if ($a) {} else {} + if ($a) {} elseif ($b) {} elseif ($c) {} else {} + if ($a) {} elseif ($b) {} else if ($c) {} else {} + ?>
1, &$b,); + ~$a; + !$a; + + Foo::Bar; + $foo::Bar; + clone($a); + clone $a; + function(){}; + function($a, $b) use ($c, &$d) {}; + function(): void {}; + foo; + namespace\foo; + \foo; + + empty($a); + @$a; + eval($a); + exit; + exit($a); + die; + die($a); + foo(); + namespace\foo(); + \foo(); + $foo(); + + $a--; + $a++; + --$a; + ++$a; + + include $a; + include_once $a; + require $a; + require_once $a; + + $a instanceof Foo; + $a instanceof namespace\Foo; + $a instanceof \Foo; + + isset($a, $b); + list($a) = $b; + list($a[]) = $b; + list(list($a)) = $b; + + $a->foo(); + new Foo(); + new namespace\Foo(); + new \Foo(); + new class ($a, ...$b) {}; + print($a); + $a->foo; + ` + "`cmd $a`;" + ` + ` + "`cmd`;" + ` + ` + "``;" + ` + []; + [1]; + [1=>1, &$b,]; + + [$a] = $b; + [$a[]] = $b; + [list($a)] = $b; + Foo::bar(); + namespace\Foo::bar(); + \Foo::bar(); + Foo::$bar; + $foo::$bar; + namespace\Foo::$bar; + \Foo::$bar; + $a ? $b : $c; + $a ? : $c; + $a ? $b ? $c : $d : $e; + $a ? $b : $c ? $d : $e; + -$a; + +$a; + $$a; + yield; + yield $a; + yield $a => $b; + yield from $a; + + (array)$a; + (boolean)$a; + (bool)$a; + (double)$a; + (float)$a; + (integer)$a; + (int)$a; + (object)$a; + (string)$a; + (unset)$a; + + $a & $b; + $a | $b; + $a ^ $b; + $a && $b; + $a || $b; + $a ?? $b; + $a . $b; + $a / $b; + $a == $b; + $a >= $b; + $a > $b; + $a === $b; + $a and $b; + $a or $b; + $a xor $b; + $a - $b; + $a % $b; + $a * $b; + $a != $b; + $a !== $b; + $a + $b; + $a ** $b; + $a << $b; + $a >> $b; + $a <= $b; + $a < $b; + $a <=> $b; + + $a =& $b; + $a = $b; + $a &= $b; + $a |= $b; + $a ^= $b; + $a .= $b; + $a /= $b; + $a -= $b; + $a %= $b; + $a *= $b; + $a += $b; + $a **= $b; + $a <<= $b; + $a >>= $b; + + class foo {public function class() {} } + \foo\bar(); + + function foo(&$a, ...$b) { + + function bar() {} + class Baz {} + trait Quux{} + interface Quuux {} + } + + function foo(&$a = 1, ...$b = 1, $c = 1) {} + function foo(array $a, callable $b) {} + abstract final class foo { abstract protected static function bar(); final private function baz() {} } + + (new Foo)->bar; + (new Foo)(); + [$foo][0](); + foo[1](); + "foo"(); + [1]{$foo}(); + ${foo()}; + + Foo::$bar(); + Foo::{$bar[0]}(); + + $foo->$bar; + $foo->{$bar[0]}; + + [1=>&$a, 2=>list($b)]; + + __halt_compiler(); + + parsing process must be terminated + ` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 348, + StartPos: 5, + EndPos: 6319, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 20, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 19, + }, + }, + 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: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 8, + EndPos: 19, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 9, + EndPos: 11, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 9, + EndPos: 11, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 9, + EndPos: 11, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 13, + EndPos: 18, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 16, + EndPos: 18, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 16, + EndPos: 18, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 23, + EndPos: 39, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 23, + EndPos: 38, + }, + }, + Function: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 23, + EndPos: 27, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 23, + EndPos: 27, + }, + }, + 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, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 28, + EndPos: 30, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 28, + EndPos: 30, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 32, + EndPos: 37, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 35, + EndPos: 37, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 35, + EndPos: 37, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 42, + EndPos: 63, + }, + }, + Expr: &ast.ExprMethodCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 42, + EndPos: 62, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 42, + EndPos: 46, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 42, + EndPos: 46, + }, + }, + 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, + }, + }, + IsReference: false, + Variadic: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 52, + EndPos: 54, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 52, + EndPos: 54, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 56, + EndPos: 61, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 59, + EndPos: 61, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 59, + EndPos: 61, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 66, + EndPos: 86, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 66, + EndPos: 85, + }, + }, + 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: []byte("foo"), + }, + }, + }, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 71, + EndPos: 74, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 74, + EndPos: 85, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 75, + EndPos: 77, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 75, + EndPos: 77, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 75, + EndPos: 77, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 79, + EndPos: 84, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 82, + EndPos: 84, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 82, + EndPos: 84, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 89, + EndPos: 110, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 89, + EndPos: 109, + }, + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 89, + EndPos: 93, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 89, + EndPos: 93, + }, + }, + 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, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 99, + EndPos: 101, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 99, + EndPos: 101, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 103, + EndPos: 108, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 106, + EndPos: 108, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 106, + EndPos: 108, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 113, + EndPos: 132, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 113, + EndPos: 131, + }, + }, + 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: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 120, + EndPos: 131, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 123, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 123, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 123, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 125, + EndPos: 130, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 128, + EndPos: 130, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 128, + EndPos: 130, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 160, + EndPos: 185, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 160, + EndPos: 184, + }, + }, + Class: &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 164, + EndPos: 184, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 170, + EndPos: 181, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 171, + EndPos: 173, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 171, + EndPos: 173, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 171, + EndPos: 173, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 175, + EndPos: 180, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 178, + EndPos: 180, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 178, + EndPos: 180, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 188, + EndPos: 201, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 188, + EndPos: 200, + }, + }, + Class: &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 192, + EndPos: 200, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 204, + EndPos: 213, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 204, + EndPos: 212, + }, + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 208, + EndPos: 212, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 208, + EndPos: 212, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 216, + EndPos: 228, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 216, + EndPos: 227, + }, + }, + Class: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 220, + EndPos: 227, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 220, + EndPos: 224, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 220, + EndPos: 224, + }, + }, + Value: []byte("foo"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 225, + EndPos: 226, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 231, + EndPos: 246, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 231, + EndPos: 245, + }, + }, + Class: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 235, + EndPos: 245, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 235, + EndPos: 239, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 235, + EndPos: 239, + }, + }, + Value: []byte("foo"), + }, + }, + Dim: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 240, + EndPos: 244, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 240, + EndPos: 244, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 249, + EndPos: 263, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 249, + EndPos: 262, + }, + }, + Class: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 253, + EndPos: 262, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 253, + EndPos: 257, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 253, + EndPos: 257, + }, + }, + Value: []byte("foo"), + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 259, + EndPos: 262, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 266, + EndPos: 281, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 266, + EndPos: 280, + }, + }, + Class: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 270, + EndPos: 280, + }, + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 270, + EndPos: 274, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 270, + EndPos: 274, + }, + }, + Value: []byte("foo"), + }, + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 276, + EndPos: 280, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 276, + EndPos: 280, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 284, + EndPos: 301, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 284, + EndPos: 300, + }, + }, + Class: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 288, + EndPos: 300, + }, + }, + Class: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 288, + EndPos: 294, + }, + }, + Value: []byte("static"), + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 296, + EndPos: 300, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 296, + EndPos: 300, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + }, + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 305, + EndPos: 350, + }, + }, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 314, + EndPos: 317, + }, + }, + Value: []byte("foo"), + }, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 318, + EndPos: 332, + }, + }, + ByRef: false, + Variadic: false, + Type: &ast.Nullable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 318, + EndPos: 322, + }, + }, + Expr: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 319, + EndPos: 322, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 319, + EndPos: 322, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 323, + EndPos: 327, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 323, + EndPos: 327, + }, + }, + Value: []byte("bar"), + }, + }, + DefaultValue: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 328, + EndPos: 332, + }, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 328, + EndPos: 332, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 328, + EndPos: 332, + }, + }, + Value: []byte("null"), + }, + }, + }, + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 334, + EndPos: 346, + }, + }, + Variadic: true, + ByRef: true, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 334, + EndPos: 337, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 334, + EndPos: 337, + }, + }, + Value: []byte("baz"), + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 342, + EndPos: 346, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 342, + EndPos: 346, + }, + }, + Value: []byte("baz"), + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 353, + EndPos: 417, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 359, + EndPos: 362, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 364, + EndPos: 416, + }, + }, + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 380, + EndPos: 383, + }, + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 364, + EndPos: 370, + }, + }, + Value: []byte("public"), + }, + }, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 384, + EndPos: 398, + }, + }, + ByRef: false, + Variadic: false, + Type: &ast.Nullable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 384, + EndPos: 388, + }, + }, + Expr: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 385, + EndPos: 388, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 385, + EndPos: 388, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 389, + EndPos: 393, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 389, + EndPos: 393, + }, + }, + Value: []byte("bar"), + }, + }, + DefaultValue: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 394, + EndPos: 398, + }, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 394, + EndPos: 398, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 394, + EndPos: 398, + }, + }, + Value: []byte("null"), + }, + }, + }, + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 400, + EndPos: 412, + }, + }, + ByRef: true, + Variadic: true, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 400, + EndPos: 403, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 400, + EndPos: 403, + }, + }, + Value: []byte("baz"), + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 408, + EndPos: 412, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 408, + EndPos: 412, + }, + }, + Value: []byte("baz"), + }, + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 414, + EndPos: 416, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 420, + EndPos: 462, + }, + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 420, + EndPos: 461, + }, + }, + ReturnsRef: false, + Static: false, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 429, + EndPos: 443, + }, + }, + ByRef: false, + Variadic: false, + Type: &ast.Nullable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 429, + EndPos: 433, + }, + }, + Expr: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 430, + EndPos: 433, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 430, + EndPos: 433, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 434, + EndPos: 438, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 434, + EndPos: 438, + }, + }, + Value: []byte("bar"), + }, + }, + DefaultValue: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 439, + EndPos: 443, + }, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 439, + EndPos: 443, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 439, + EndPos: 443, + }, + }, + Value: []byte("null"), + }, + }, + }, + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 445, + EndPos: 457, + }, + }, + ByRef: true, + Variadic: true, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 445, + EndPos: 448, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 445, + EndPos: 448, + }, + }, + Value: []byte("baz"), + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 453, + EndPos: 457, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 453, + EndPos: 457, + }, + }, + Value: []byte("baz"), + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 465, + EndPos: 514, + }, + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 465, + EndPos: 513, + }, + }, + ReturnsRef: false, + Static: true, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 481, + EndPos: 495, + }, + }, + ByRef: false, + Variadic: false, + Type: &ast.Nullable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 481, + EndPos: 485, + }, + }, + Expr: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 482, + EndPos: 485, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 482, + EndPos: 485, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 486, + EndPos: 490, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 486, + EndPos: 490, + }, + }, + Value: []byte("bar"), + }, + }, + DefaultValue: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 491, + EndPos: 495, + }, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 491, + EndPos: 495, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 491, + EndPos: 495, + }, + }, + Value: []byte("null"), + }, + }, + }, + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 497, + EndPos: 509, + }, + }, + ByRef: true, + Variadic: true, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 497, + EndPos: 500, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 497, + EndPos: 500, + }, + }, + Value: []byte("baz"), + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 505, + EndPos: 509, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 505, + EndPos: 509, + }, + }, + Value: []byte("baz"), + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 23, + EndLine: 23, + StartPos: 518, + EndPos: 538, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 23, + EndLine: 23, + StartPos: 518, + EndPos: 537, + }, + }, + Value: []byte("1234567890123456789"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 541, + EndPos: 562, + }, + }, + Expr: &ast.ScalarDnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 541, + EndPos: 561, + }, + }, + Value: []byte("12345678901234567890"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 565, + EndPos: 568, + }, + }, + Expr: &ast.ScalarDnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 565, + EndPos: 567, + }, + }, + Value: []byte("0."), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 26, + EndLine: 26, + StartPos: 571, + EndPos: 638, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 26, + EndLine: 26, + StartPos: 571, + EndPos: 637, + }, + }, + Value: []byte("0b0111111111111111111111111111111111111111111111111111111111111111"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 27, + EndLine: 27, + StartPos: 641, + EndPos: 708, + }, + }, + Expr: &ast.ScalarDnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 27, + EndLine: 27, + StartPos: 641, + EndPos: 707, + }, + }, + Value: []byte("0b1111111111111111111111111111111111111111111111111111111111111111"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 711, + EndPos: 732, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 711, + EndPos: 731, + }, + }, + Value: []byte("0x007111111111111111"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 29, + EndLine: 29, + StartPos: 735, + EndPos: 754, + }, + }, + Expr: &ast.ScalarDnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 29, + EndLine: 29, + StartPos: 735, + EndPos: 753, + }, + }, + Value: []byte("0x8111111111111111"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 30, + EndLine: 30, + StartPos: 757, + EndPos: 767, + }, + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 30, + EndLine: 30, + StartPos: 757, + EndPos: 766, + }, + }, + Value: []byte("__CLASS__"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 770, + EndPos: 778, + }, + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 770, + EndPos: 777, + }, + }, + Value: []byte("__DIR__"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 781, + EndPos: 790, + }, + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 781, + EndPos: 789, + }, + }, + Value: []byte("__FILE__"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 793, + EndPos: 806, + }, + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 793, + EndPos: 805, + }, + }, + Value: []byte("__FUNCTION__"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 809, + EndPos: 818, + }, + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 809, + EndPos: 817, + }, + }, + Value: []byte("__LINE__"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 821, + EndPos: 835, + }, + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 821, + EndPos: 834, + }, + }, + Value: []byte("__NAMESPACE__"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 838, + EndPos: 849, + }, + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 838, + EndPos: 848, + }, + }, + Value: []byte("__METHOD__"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 37, + EndLine: 37, + StartPos: 852, + EndPos: 862, + }, + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 37, + EndLine: 37, + StartPos: 852, + EndPos: 861, + }, + }, + Value: []byte("__TRAIT__"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 866, + EndPos: 878, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 866, + EndPos: 877, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 867, + EndPos: 872, + }, + }, + Value: []byte("test "), + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 872, + EndPos: 876, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 872, + EndPos: 876, + }, + }, + Value: []byte("var"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 881, + EndPos: 896, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 881, + EndPos: 895, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 882, + EndPos: 887, + }, + }, + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 887, + EndPos: 894, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 887, + EndPos: 891, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 887, + EndPos: 891, + }, + }, + Value: []byte("var"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 892, + EndPos: 893, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 899, + EndPos: 915, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 899, + EndPos: 914, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 900, + EndPos: 905, + }, + }, + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 905, + EndPos: 913, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 905, + EndPos: 909, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 905, + EndPos: 909, + }, + }, + Value: []byte("var"), + }, + }, + Dim: &ast.ExprUnaryMinus{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 910, + EndPos: 912, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 910, + EndPos: 912, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 918, + EndPos: 972, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 918, + EndPos: 971, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 919, + EndPos: 924, + }, + }, + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 924, + EndPos: 970, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 924, + EndPos: 928, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 924, + EndPos: 928, + }, + }, + Value: []byte("var"), + }, + }, + Dim: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 929, + EndPos: 969, + }, + }, + Value: []byte("1234567890123456789012345678901234567890"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 975, + EndPos: 1030, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 975, + EndPos: 1029, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 976, + EndPos: 981, + }, + }, + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 981, + EndPos: 1028, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 981, + EndPos: 985, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 981, + EndPos: 985, + }, + }, + Value: []byte("var"), + }, + }, + Dim: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 986, + EndPos: 1027, + }, + }, + Value: []byte("-1234567890123456789012345678901234567890"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1033, + EndPos: 1050, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1033, + EndPos: 1049, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1034, + EndPos: 1039, + }, + }, + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1039, + EndPos: 1048, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1039, + EndPos: 1043, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1039, + EndPos: 1043, + }, + }, + Value: []byte("var"), + }, + }, + Dim: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1044, + EndPos: 1047, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1053, + EndPos: 1071, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1053, + EndPos: 1070, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1054, + EndPos: 1059, + }, + }, + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1059, + EndPos: 1069, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1059, + EndPos: 1063, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1059, + EndPos: 1063, + }, + }, + Value: []byte("var"), + }, + }, + Dim: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1064, + EndPos: 1068, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1064, + EndPos: 1068, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1074, + EndPos: 1086, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1074, + EndPos: 1085, + }, + }, + Parts: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1075, + EndPos: 1079, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1075, + EndPos: 1079, + }, + }, + Value: []byte("foo"), + }, + }, + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1079, + EndPos: 1080, + }, + }, + Value: []byte(" "), + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1080, + EndPos: 1084, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1080, + EndPos: 1084, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1089, + EndPos: 1108, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1089, + EndPos: 1107, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1090, + EndPos: 1095, + }, + }, + Value: []byte("test "), + }, + &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1095, + EndPos: 1104, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1095, + EndPos: 1099, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1095, + EndPos: 1099, + }, + }, + Value: []byte("foo"), + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1101, + EndPos: 1104, + }, + }, + Value: []byte("bar"), + }, + }, + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1104, + EndPos: 1106, + }, + }, + Value: []byte("()"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 48, + EndLine: 48, + StartPos: 1111, + EndPos: 1125, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 48, + EndLine: 48, + StartPos: 1111, + EndPos: 1124, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 48, + EndLine: 48, + StartPos: 1112, + EndPos: 1117, + }, + }, + Value: []byte("test "), + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 48, + EndLine: 48, + StartPos: 1117, + EndPos: 1123, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 48, + EndLine: 48, + StartPos: 1119, + EndPos: 1122, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1128, + EndPos: 1145, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1128, + EndPos: 1144, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1129, + EndPos: 1134, + }, + }, + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1134, + EndPos: 1143, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1136, + EndPos: 1139, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1136, + EndPos: 1139, + }, + }, + Value: []byte("foo"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1140, + EndPos: 1141, + }, + }, + Value: []byte("0"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1148, + EndPos: 1163, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1148, + EndPos: 1162, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1149, + EndPos: 1154, + }, + }, + Value: []byte("test "), + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1154, + EndPos: 1161, + }, + }, + VarName: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1156, + EndPos: 1160, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1156, + EndPos: 1160, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1166, + EndPos: 1187, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1166, + EndPos: 1186, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1167, + EndPos: 1172, + }, + }, + Value: []byte("test "), + }, + &ast.ExprMethodCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1173, + EndPos: 1184, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1173, + EndPos: 1177, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1173, + EndPos: 1177, + }, + }, + Value: []byte("foo"), + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1179, + EndPos: 1182, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1182, + EndPos: 1184, + }, + }, + }, + }, + }, + }, + }, + &ast.StmtAltIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 53, + EndLine: 54, + StartPos: 1191, + EndPos: 1209, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 53, + EndLine: 53, + StartPos: 1195, + EndPos: 1197, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 53, + EndLine: 53, + StartPos: 1195, + EndPos: 1197, + }, + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtAltIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 55, + EndLine: 57, + StartPos: 1212, + EndPos: 1245, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 55, + EndLine: 55, + StartPos: 1216, + EndPos: 1218, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 55, + EndLine: 55, + StartPos: 1216, + EndPos: 1218, + }, + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtAltElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 56, + EndLine: -1, + StartPos: 1224, + EndPos: -1, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 56, + EndLine: 56, + StartPos: 1232, + EndPos: 1234, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 56, + EndLine: 56, + StartPos: 1232, + EndPos: 1234, + }, + }, + Value: []byte("b"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtAltIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 58, + EndLine: 60, + StartPos: 1248, + EndPos: 1274, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1252, + EndPos: 1254, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1252, + EndPos: 1254, + }, + }, + Value: []byte("a"), + }, + }, + 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: 59, + EndLine: -1, + StartPos: 1260, + EndPos: -1, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtAltIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 65, + StartPos: 1277, + EndPos: 1333, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1281, + EndPos: 1283, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1281, + EndPos: 1283, + }, + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtAltElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 62, + EndLine: -1, + StartPos: 1289, + EndPos: -1, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1297, + EndPos: 1299, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1297, + EndPos: 1299, + }, + }, + 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: 63, + EndLine: -1, + StartPos: 1304, + EndPos: -1, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1312, + EndPos: 1314, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1312, + EndPos: 1314, + }, + }, + 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: 64, + EndLine: -1, + StartPos: 1319, + EndPos: -1, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtWhile{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1337, + EndPos: 1357, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1344, + EndPos: 1345, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1347, + EndPos: 1357, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1349, + EndPos: 1355, + }, + }, + }, + }, + }, + }, + &ast.StmtWhile{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1360, + EndPos: 1382, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1367, + EndPos: 1368, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1370, + EndPos: 1382, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1372, + EndPos: 1380, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1378, + EndPos: 1379, + }, + }, + Value: []byte("2"), + }, + }, + }, + }, + }, + &ast.StmtAltWhile{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1385, + EndPos: 1416, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1392, + EndPos: 1393, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1397, + EndPos: 1406, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1397, + EndPos: 1406, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1403, + EndPos: 1404, + }, + }, + Value: []byte("3"), + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1419, + EndPos: 1462, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1425, + EndPos: 1428, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassConstList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1430, + EndPos: 1460, + }, + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1430, + EndPos: 1436, + }, + }, + Value: []byte("public"), + }, + }, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1443, + EndPos: 1450, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1443, + EndPos: 1446, + }, + }, + Value: []byte("FOO"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1449, + EndPos: 1450, + }, + }, + Value: []byte("1"), + }, + }, + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1452, + EndPos: 1459, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1452, + EndPos: 1455, + }, + }, + Value: []byte("BAR"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1458, + EndPos: 1459, + }, + }, + Value: []byte("2"), + }, + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1465, + EndPos: 1501, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1471, + EndPos: 1474, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassConstList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1476, + EndPos: 1499, + }, + }, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1482, + EndPos: 1489, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1482, + EndPos: 1485, + }, + }, + Value: []byte("FOO"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1488, + EndPos: 1489, + }, + }, + Value: []byte("1"), + }, + }, + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1491, + EndPos: 1498, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1491, + EndPos: 1494, + }, + }, + Value: []byte("BAR"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1497, + EndPos: 1498, + }, + }, + Value: []byte("2"), + }, + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1504, + EndPos: 1534, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1510, + EndPos: 1513, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1515, + EndPos: 1532, + }, + }, + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1524, + EndPos: 1527, + }, + }, + Value: []byte("bar"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1530, + EndPos: 1532, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1537, + EndPos: 1582, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1543, + EndPos: 1546, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1548, + EndPos: 1580, + }, + }, + ReturnsRef: true, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1572, + EndPos: 1575, + }, + }, + Value: []byte("bar"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1548, + EndPos: 1554, + }, + }, + Value: []byte("public"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1555, + EndPos: 1561, + }, + }, + Value: []byte("static"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1578, + EndPos: 1580, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1585, + EndPos: 1636, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1591, + EndPos: 1594, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1596, + EndPos: 1634, + }, + }, + ReturnsRef: true, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1620, + EndPos: 1623, + }, + }, + Value: []byte("bar"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1596, + EndPos: 1602, + }, + }, + Value: []byte("public"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1603, + EndPos: 1609, + }, + }, + Value: []byte("static"), + }, + }, + ReturnType: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1627, + EndPos: 1631, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1627, + EndPos: 1631, + }, + }, + Value: []byte("void"), + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1632, + EndPos: 1634, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1639, + EndPos: 1660, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1654, + EndPos: 1657, + }, + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1639, + EndPos: 1647, + }, + }, + Value: []byte("abstract"), + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1663, + EndPos: 1694, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1675, + EndPos: 1678, + }, + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1663, + EndPos: 1668, + }, + }, + Value: []byte("final"), + }, + }, + Extends: &ast.StmtClassExtends{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1679, + EndPos: 1690, + }, + }, + ClassName: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1687, + EndPos: 1690, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1687, + EndPos: 1690, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1697, + EndPos: 1731, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1709, + EndPos: 1712, + }, + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1697, + EndPos: 1702, + }, + }, + Value: []byte("final"), + }, + }, + Implements: &ast.StmtClassImplements{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1713, + EndPos: 1727, + }, + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1724, + EndPos: 1727, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1724, + EndPos: 1727, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1734, + EndPos: 1773, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1746, + EndPos: 1749, + }, + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1734, + EndPos: 1739, + }, + }, + Value: []byte("final"), + }, + }, + Implements: &ast.StmtClassImplements{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1750, + EndPos: 1769, + }, + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1761, + EndPos: 1764, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1761, + EndPos: 1764, + }, + }, + Value: []byte("bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1766, + EndPos: 1769, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1766, + EndPos: 1769, + }, + }, + Value: []byte("baz"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1776, + EndPos: 1824, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1776, + EndPos: 1823, + }, + }, + Class: &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1780, + EndPos: 1823, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1785, + EndPos: 1787, + }, + }, + }, + Extends: &ast.StmtClassExtends{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1788, + EndPos: 1799, + }, + }, + ClassName: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1796, + EndPos: 1799, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1796, + EndPos: 1799, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + Implements: &ast.StmtClassImplements{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1800, + EndPos: 1819, + }, + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1811, + EndPos: 1814, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1811, + EndPos: 1814, + }, + }, + Value: []byte("bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1816, + EndPos: 1819, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1816, + EndPos: 1819, + }, + }, + Value: []byte("baz"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtConstList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1828, + EndPos: 1851, + }, + }, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1834, + EndPos: 1841, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1834, + EndPos: 1837, + }, + }, + Value: []byte("FOO"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1840, + EndPos: 1841, + }, + }, + Value: []byte("1"), + }, + }, + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1843, + EndPos: 1850, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1843, + EndPos: 1846, + }, + }, + Value: []byte("BAR"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1849, + EndPos: 1850, + }, + }, + Value: []byte("2"), + }, + }, + }, + }, + &ast.StmtWhile{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1854, + EndPos: 1877, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1861, + EndPos: 1862, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1864, + EndPos: 1877, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtContinue{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1866, + EndPos: 1875, + }, + }, + }, + }, + }, + }, + &ast.StmtWhile{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1880, + EndPos: 1905, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1887, + EndPos: 1888, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1890, + EndPos: 1905, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtContinue{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1892, + EndPos: 1903, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1901, + EndPos: 1902, + }, + }, + Value: []byte("2"), + }, + }, + }, + }, + }, + &ast.StmtWhile{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1908, + EndPos: 1934, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1915, + EndPos: 1916, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1918, + EndPos: 1934, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtContinue{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1920, + EndPos: 1932, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1929, + EndPos: 1930, + }, + }, + Value: []byte("3"), + }, + }, + }, + }, + }, + &ast.StmtDeclare{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 1937, + EndPos: 1954, + }, + }, + Alt: false, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 1945, + EndPos: 1952, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 1945, + EndPos: 1950, + }, + }, + Value: []byte("ticks"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 1951, + EndPos: 1952, + }, + }, + Value: []byte("1"), + }, + }, + }, + Stmt: &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 1953, + EndPos: 1954, + }, + }, + }, + }, + &ast.StmtDeclare{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 1957, + EndPos: 1976, + }, + }, + Alt: false, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 1965, + EndPos: 1972, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 1965, + EndPos: 1970, + }, + }, + Value: []byte("ticks"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 1971, + EndPos: 1972, + }, + }, + Value: []byte("1"), + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 1974, + EndPos: 1976, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtDeclare{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 87, + EndLine: 87, + StartPos: 1979, + EndPos: 2008, + }, + }, + Alt: true, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 87, + EndLine: 87, + StartPos: 1987, + EndPos: 1994, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 87, + EndLine: 87, + StartPos: 1987, + EndPos: 1992, + }, + }, + Value: []byte("ticks"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 87, + EndLine: 87, + StartPos: 1993, + EndPos: 1994, + }, + }, + Value: []byte("1"), + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtDo{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 88, + EndLine: 88, + StartPos: 2011, + EndPos: 2026, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 88, + EndLine: 88, + StartPos: 2014, + EndPos: 2016, + }, + }, + Stmts: []ast.Vertex{}, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 88, + EndLine: 88, + StartPos: 2023, + EndPos: 2024, + }, + }, + Value: []byte("1"), + }, + }, + &ast.StmtEcho{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 89, + EndLine: 89, + StartPos: 2029, + EndPos: 2040, + }, + }, + Exprs: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 89, + EndLine: 89, + StartPos: 2034, + EndPos: 2036, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 89, + EndLine: 89, + StartPos: 2034, + EndPos: 2036, + }, + }, + Value: []byte("a"), + }, + }, + &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 89, + EndLine: 89, + StartPos: 2038, + EndPos: 2039, + }, + }, + Value: []byte("1"), + }, + }, + }, + &ast.StmtEcho{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 90, + EndLine: 90, + StartPos: 2043, + EndPos: 2052, + }, + }, + Exprs: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 90, + EndLine: 90, + StartPos: 2048, + EndPos: 2050, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 90, + EndLine: 90, + StartPos: 2048, + EndPos: 2050, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtFor{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2055, + EndPos: 2090, + }, + }, + Init: []ast.Vertex{ + &ast.ExprAssign{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2059, + EndPos: 2065, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2059, + EndPos: 2061, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2059, + EndPos: 2061, + }, + }, + Value: []byte("i"), + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2064, + EndPos: 2065, + }, + }, + Value: []byte("0"), + }, + }, + }, + Cond: []ast.Vertex{ + &ast.ExprBinarySmaller{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2067, + EndPos: 2074, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2067, + EndPos: 2069, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2067, + EndPos: 2069, + }, + }, + Value: []byte("i"), + }, + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2072, + EndPos: 2074, + }, + }, + Value: []byte("10"), + }, + }, + }, + Loop: []ast.Vertex{ + &ast.ExprPostInc{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2076, + EndPos: 2080, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2076, + EndPos: 2078, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2076, + EndPos: 2078, + }, + }, + Value: []byte("i"), + }, + }, + }, + &ast.ExprPostInc{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2082, + EndPos: 2086, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2082, + EndPos: 2084, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2082, + EndPos: 2084, + }, + }, + Value: []byte("i"), + }, + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2088, + EndPos: 2090, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtAltFor{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2093, + EndPos: 2129, + }, + }, + Cond: []ast.Vertex{ + &ast.ExprBinarySmaller{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2099, + EndPos: 2106, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2099, + EndPos: 2101, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2099, + EndPos: 2101, + }, + }, + Value: []byte("i"), + }, + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2104, + EndPos: 2106, + }, + }, + Value: []byte("10"), + }, + }, + }, + Loop: []ast.Vertex{ + &ast.ExprPostInc{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2108, + EndPos: 2112, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2108, + EndPos: 2110, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2108, + EndPos: 2110, + }, + }, + Value: []byte("i"), + }, + }, + }, + &ast.ExprPostInc{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2114, + EndPos: 2118, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2114, + EndPos: 2116, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2114, + EndPos: 2116, + }, + }, + Value: []byte("i"), + }, + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2132, + EndPos: 2153, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2141, + EndPos: 2143, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2141, + EndPos: 2143, + }, + }, + Value: []byte("a"), + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2147, + EndPos: 2149, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2147, + EndPos: 2149, + }, + }, + Value: []byte("v"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2151, + EndPos: 2153, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtAltForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2156, + EndPos: 2188, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2165, + EndPos: 2167, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2165, + EndPos: 2167, + }, + }, + Value: []byte("a"), + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2171, + EndPos: 2173, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2171, + EndPos: 2173, + }, + }, + Value: []byte("v"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2191, + EndPos: 2218, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2200, + EndPos: 2202, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2200, + EndPos: 2202, + }, + }, + Value: []byte("a"), + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2206, + EndPos: 2208, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2206, + EndPos: 2208, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2212, + EndPos: 2214, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2212, + EndPos: 2214, + }, + }, + Value: []byte("v"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2216, + EndPos: 2218, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2221, + EndPos: 2249, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2230, + EndPos: 2232, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2230, + EndPos: 2232, + }, + }, + Value: []byte("a"), + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2236, + EndPos: 2238, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2236, + EndPos: 2238, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2242, + EndPos: 2245, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2243, + EndPos: 2245, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2243, + EndPos: 2245, + }, + }, + Value: []byte("v"), + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2247, + EndPos: 2249, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2252, + EndPos: 2285, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2261, + EndPos: 2263, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2261, + EndPos: 2263, + }, + }, + Value: []byte("a"), + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2267, + EndPos: 2269, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2267, + EndPos: 2269, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2273, + EndPos: 2281, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2278, + EndPos: 2280, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2278, + EndPos: 2280, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2278, + EndPos: 2280, + }, + }, + Value: []byte("v"), + }, + }, + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2283, + EndPos: 2285, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2288, + EndPos: 2317, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2297, + EndPos: 2299, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2297, + EndPos: 2299, + }, + }, + Value: []byte("a"), + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2303, + EndPos: 2305, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2303, + EndPos: 2305, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprShortList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2309, + EndPos: 2313, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2310, + EndPos: 2312, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2310, + EndPos: 2312, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2310, + EndPos: 2312, + }, + }, + Value: []byte("v"), + }, + }, + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2315, + EndPos: 2317, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 99, + EndLine: 99, + StartPos: 2320, + EndPos: 2337, + }, + }, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 99, + EndLine: 99, + StartPos: 2329, + EndPos: 2332, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 100, + EndLine: 100, + StartPos: 2340, + EndPos: 2364, + }, + }, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 100, + EndLine: 100, + StartPos: 2349, + EndPos: 2352, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtReturn{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 100, + EndLine: 100, + StartPos: 2356, + EndPos: 2363, + }, + }, + }, + }, + }, + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2367, + EndPos: 2394, + }, + }, + ReturnsRef: true, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2377, + EndPos: 2380, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtReturn{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2384, + EndPos: 2393, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2391, + EndPos: 2392, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2397, + EndPos: 2421, + }, + }, + ReturnsRef: true, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2407, + EndPos: 2410, + }, + }, + Value: []byte("foo"), + }, + ReturnType: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2414, + EndPos: 2418, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2414, + EndPos: 2418, + }, + }, + Value: []byte("void"), + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtGlobal{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2424, + EndPos: 2438, + }, + }, + Vars: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2431, + EndPos: 2433, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2431, + EndPos: 2433, + }, + }, + Value: []byte("a"), + }, + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2435, + EndPos: 2437, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2435, + EndPos: 2437, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtLabel{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2441, + EndPos: 2443, + }, + }, + LabelName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2441, + EndPos: 2442, + }, + }, + Value: []byte("a"), + }, + }, + &ast.StmtGoto{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2447, + EndPos: 2454, + }, + }, + Label: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2452, + EndPos: 2453, + }, + }, + Value: []byte("a"), + }, + }, + &ast.StmtIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2457, + EndPos: 2467, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2461, + EndPos: 2463, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2461, + EndPos: 2463, + }, + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2465, + EndPos: 2467, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2470, + EndPos: 2495, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2474, + EndPos: 2476, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2474, + EndPos: 2476, + }, + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2478, + EndPos: 2480, + }, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2481, + EndPos: 2495, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2489, + EndPos: 2491, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2489, + EndPos: 2491, + }, + }, + Value: []byte("b"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2493, + EndPos: 2495, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2498, + EndPos: 2516, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2502, + EndPos: 2504, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2502, + EndPos: 2504, + }, + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2506, + EndPos: 2508, + }, + }, + Stmts: []ast.Vertex{}, + }, + Else: &ast.StmtElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2509, + EndPos: 2516, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2514, + EndPos: 2516, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2519, + EndPos: 2567, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2523, + EndPos: 2525, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2523, + EndPos: 2525, + }, + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2527, + EndPos: 2529, + }, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2530, + EndPos: 2544, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2538, + EndPos: 2540, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2538, + EndPos: 2540, + }, + }, + Value: []byte("b"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2542, + EndPos: 2544, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2545, + EndPos: 2559, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2553, + EndPos: 2555, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2553, + EndPos: 2555, + }, + }, + Value: []byte("c"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2557, + EndPos: 2559, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + Else: &ast.StmtElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2560, + EndPos: 2567, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2565, + EndPos: 2567, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2570, + EndPos: 2619, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2574, + EndPos: 2576, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2574, + EndPos: 2576, + }, + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2578, + EndPos: 2580, + }, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2581, + EndPos: 2595, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2589, + EndPos: 2591, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2589, + EndPos: 2591, + }, + }, + Value: []byte("b"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2593, + EndPos: 2595, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + Else: &ast.StmtElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2596, + EndPos: 2619, + }, + }, + Stmt: &ast.StmtIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2601, + EndPos: 2619, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2605, + EndPos: 2607, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2605, + EndPos: 2607, + }, + }, + Value: []byte("c"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2609, + EndPos: 2611, + }, + }, + Stmts: []ast.Vertex{}, + }, + Else: &ast.StmtElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2612, + EndPos: 2619, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2617, + EndPos: 2619, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + }, + &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2622, + EndPos: 2624, + }, + }, + }, + &ast.StmtInlineHtml{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2624, + EndPos: 2637, + }, + }, + Value: []byte("
"), + }, + &ast.StmtInterface{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 112, + EndLine: 112, + StartPos: 2642, + EndPos: 2658, + }, + }, + InterfaceName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 112, + EndLine: 112, + StartPos: 2652, + EndPos: 2655, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtInterface{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2661, + EndPos: 2689, + }, + }, + InterfaceName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2671, + EndPos: 2674, + }, + }, + Value: []byte("Foo"), + }, + Extends: &ast.StmtInterfaceExtends{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2675, + EndPos: 2686, + }, + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2683, + EndPos: 2686, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2683, + EndPos: 2686, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtInterface{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2692, + EndPos: 2725, + }, + }, + InterfaceName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2702, + EndPos: 2705, + }, + }, + Value: []byte("Foo"), + }, + Extends: &ast.StmtInterfaceExtends{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2706, + EndPos: 2722, + }, + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2714, + EndPos: 2717, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2714, + EndPos: 2717, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2719, + EndPos: 2722, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2719, + EndPos: 2722, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtNamespace{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2728, + EndPos: 2742, + }, + }, + NamespaceName: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2738, + EndPos: 2741, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2738, + EndPos: 2741, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + &ast.StmtNamespace{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2745, + EndPos: 2761, + }, + }, + NamespaceName: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2755, + EndPos: 2758, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2755, + EndPos: 2758, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtNamespace{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 117, + EndLine: 117, + StartPos: 2764, + EndPos: 2776, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2779, + EndPos: 2798, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2785, + EndPos: 2788, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtPropertyList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2790, + EndPos: 2797, + }, + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2790, + EndPos: 2793, + }, + }, + Value: []byte("var"), + }, + }, + Properties: []ast.Vertex{ + &ast.StmtProperty{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2794, + EndPos: 2796, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2794, + EndPos: 2796, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2794, + EndPos: 2796, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2801, + EndPos: 2838, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2807, + EndPos: 2810, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtPropertyList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2812, + EndPos: 2837, + }, + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2812, + EndPos: 2818, + }, + }, + Value: []byte("public"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2819, + EndPos: 2825, + }, + }, + Value: []byte("static"), + }, + }, + Properties: []ast.Vertex{ + &ast.StmtProperty{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2826, + EndPos: 2828, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2826, + EndPos: 2828, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2826, + EndPos: 2828, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.StmtProperty{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2830, + EndPos: 2836, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2830, + EndPos: 2832, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2830, + EndPos: 2832, + }, + }, + Value: []byte("b"), + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2835, + EndPos: 2836, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + }, + }, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2841, + EndPos: 2859, + }, + }, + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2848, + EndPos: 2850, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2848, + EndPos: 2850, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2848, + EndPos: 2850, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.StmtStaticVar{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2852, + EndPos: 2858, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2852, + EndPos: 2854, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2852, + EndPos: 2854, + }, + }, + Value: []byte("b"), + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2857, + EndPos: 2858, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + &ast.StmtAltSwitch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 122, + EndLine: 126, + StartPos: 2863, + EndPos: 2922, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 122, + EndLine: 122, + StartPos: 2871, + EndPos: 2872, + }, + }, + Value: []byte("1"), + }, + CaseList: &ast.StmtCaseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 123, + EndLine: -1, + StartPos: 2879, + EndPos: -1, + }, + }, + Cases: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 123, + EndLine: -1, + StartPos: 2879, + EndPos: -1, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 123, + EndLine: 123, + StartPos: 2884, + EndPos: 2885, + }, + }, + Value: []byte("1"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtDefault{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 124, + EndLine: -1, + StartPos: 2890, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 125, + EndLine: -1, + StartPos: 2902, + EndPos: -1, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 125, + EndLine: 125, + StartPos: 2907, + EndPos: 2908, + }, + }, + Value: []byte("2"), + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtAltSwitch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 128, + EndLine: 131, + StartPos: 2926, + EndPos: 2974, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 128, + EndLine: 128, + StartPos: 2934, + EndPos: 2935, + }, + }, + Value: []byte("1"), + }, + CaseList: &ast.StmtCaseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 129, + EndLine: -1, + StartPos: 2943, + EndPos: -1, + }, + }, + Cases: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 129, + EndLine: -1, + StartPos: 2943, + EndPos: -1, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 129, + EndLine: 129, + StartPos: 2948, + EndPos: 2949, + }, + }, + Value: []byte("1"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 130, + EndLine: -1, + StartPos: 2954, + EndPos: -1, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 130, + EndLine: 130, + StartPos: 2959, + EndPos: 2960, + }, + }, + Value: []byte("2"), + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtSwitch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 133, + EndLine: 136, + StartPos: 2980, + EndPos: 3032, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 133, + EndLine: 133, + StartPos: 2988, + EndPos: 2989, + }, + }, + Value: []byte("1"), + }, + CaseList: &ast.StmtCaseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 133, + EndLine: 136, + StartPos: 2991, + EndPos: 3032, + }, + }, + Cases: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 134, + EndLine: 134, + StartPos: 2996, + EndPos: 3010, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 134, + EndLine: 134, + StartPos: 3001, + EndPos: 3002, + }, + }, + Value: []byte("1"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 134, + EndLine: 134, + StartPos: 3004, + EndPos: 3010, + }, + }, + }, + }, + }, + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 135, + EndLine: 135, + StartPos: 3014, + EndPos: 3028, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 135, + EndLine: 135, + StartPos: 3019, + EndPos: 3020, + }, + }, + Value: []byte("2"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 135, + EndLine: 135, + StartPos: 3022, + EndPos: 3028, + }, + }, + }, + }, + }, + }, + }, + }, + &ast.StmtSwitch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 138, + EndLine: 141, + StartPos: 3038, + EndPos: 3091, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 138, + EndLine: 138, + StartPos: 3046, + EndPos: 3047, + }, + }, + Value: []byte("1"), + }, + CaseList: &ast.StmtCaseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 138, + EndLine: 141, + StartPos: 3049, + EndPos: 3091, + }, + }, + Cases: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 139, + EndLine: 139, + StartPos: 3055, + EndPos: 3069, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 139, + EndLine: 139, + StartPos: 3060, + EndPos: 3061, + }, + }, + Value: []byte("1"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 139, + EndLine: 139, + StartPos: 3063, + EndPos: 3069, + }, + }, + }, + }, + }, + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3073, + EndPos: 3087, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3078, + EndPos: 3079, + }, + }, + Value: []byte("2"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3081, + EndPos: 3087, + }, + }, + }, + }, + }, + }, + }, + }, + &ast.StmtThrow{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3095, + EndPos: 3104, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3101, + EndPos: 3103, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3101, + EndPos: 3103, + }, + }, + Value: []byte("e"), + }, + }, + }, + &ast.StmtTrait{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 145, + EndLine: 145, + StartPos: 3108, + EndPos: 3120, + }, + }, + TraitName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 145, + EndLine: 145, + StartPos: 3114, + EndPos: 3117, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3123, + EndPos: 3145, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3129, + EndPos: 3132, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3135, + EndPos: 3143, + }, + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3139, + EndPos: 3142, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3139, + EndPos: 3142, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3142, + EndPos: 3143, + }, + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3148, + EndPos: 3177, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3154, + EndPos: 3157, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3160, + EndPos: 3175, + }, + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3164, + EndPos: 3167, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3164, + EndPos: 3167, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3169, + EndPos: 3172, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3169, + EndPos: 3172, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3173, + EndPos: 3175, + }, + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3180, + EndPos: 3226, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3186, + EndPos: 3189, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3192, + EndPos: 3224, + }, + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3196, + EndPos: 3199, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3196, + EndPos: 3199, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3201, + EndPos: 3204, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3201, + EndPos: 3204, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3205, + EndPos: 3224, + }, + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3207, + EndPos: 3221, + }, + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3207, + EndPos: 3210, + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3207, + EndPos: 3210, + }, + }, + Value: []byte("one"), + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3214, + EndPos: 3221, + }, + }, + Value: []byte("include"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3229, + EndPos: 3274, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3235, + EndPos: 3238, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3241, + EndPos: 3272, + }, + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3245, + EndPos: 3248, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3245, + EndPos: 3248, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3250, + EndPos: 3253, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3250, + EndPos: 3253, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3254, + EndPos: 3272, + }, + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3256, + EndPos: 3269, + }, + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3256, + EndPos: 3259, + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3256, + EndPos: 3259, + }, + }, + Value: []byte("one"), + }, + }, + Modifier: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3263, + EndPos: 3269, + }, + }, + Value: []byte("public"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3277, + EndPos: 3326, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3283, + EndPos: 3286, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3289, + EndPos: 3324, + }, + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3293, + EndPos: 3296, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3293, + EndPos: 3296, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3298, + EndPos: 3301, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3298, + EndPos: 3301, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3302, + EndPos: 3324, + }, + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3304, + EndPos: 3321, + }, + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3304, + EndPos: 3307, + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3304, + EndPos: 3307, + }, + }, + Value: []byte("one"), + }, + }, + Modifier: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3311, + EndPos: 3317, + }, + }, + Value: []byte("public"), + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3318, + EndPos: 3321, + }, + }, + Value: []byte("two"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3329, + EndPos: 3406, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3335, + EndPos: 3338, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3341, + EndPos: 3404, + }, + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3345, + EndPos: 3348, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3345, + EndPos: 3348, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3350, + EndPos: 3353, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3350, + EndPos: 3353, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3354, + EndPos: 3404, + }, + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUsePrecedence{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3356, + EndPos: 3384, + }, + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3356, + EndPos: 3364, + }, + }, + Trait: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3356, + EndPos: 3359, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3356, + EndPos: 3359, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3361, + EndPos: 3364, + }, + }, + Value: []byte("one"), + }, + }, + Insteadof: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3375, + EndPos: 3378, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3375, + EndPos: 3378, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3380, + EndPos: 3384, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3380, + EndPos: 3384, + }, + }, + Value: []byte("Quux"), + }, + }, + }, + }, + }, + &ast.StmtTraitUseAlias{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3386, + EndPos: 3401, + }, + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3386, + EndPos: 3394, + }, + }, + Trait: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3386, + EndPos: 3389, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3386, + EndPos: 3389, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3391, + EndPos: 3394, + }, + }, + Value: []byte("one"), + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3398, + EndPos: 3401, + }, + }, + Value: []byte("two"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 153, + EndLine: -1, + StartPos: 3410, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{}, + }, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3419, + EndPos: 3449, + }, + }, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3426, + EndPos: 3449, + }, + }, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3433, + EndPos: 3442, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3433, + EndPos: 3442, + }, + }, + Value: []byte("Exception"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3443, + EndPos: 3445, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3443, + EndPos: 3445, + }, + }, + Value: []byte("e"), + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3452, + EndPos: 3499, + }, + }, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3459, + EndPos: 3499, + }, + }, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3466, + EndPos: 3475, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3466, + EndPos: 3475, + }, + }, + Value: []byte("Exception"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3476, + EndPos: 3492, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3476, + EndPos: 3492, + }, + }, + Value: []byte("RuntimeException"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3493, + EndPos: 3495, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3493, + EndPos: 3495, + }, + }, + Value: []byte("e"), + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3502, + EndPos: 3563, + }, + }, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3509, + EndPos: 3532, + }, + }, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3516, + EndPos: 3525, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3516, + EndPos: 3525, + }, + }, + Value: []byte("Exception"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3526, + EndPos: 3528, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3526, + EndPos: 3528, + }, + }, + Value: []byte("e"), + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3533, + EndPos: 3563, + }, + }, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3540, + EndPos: 3556, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3540, + EndPos: 3556, + }, + }, + Value: []byte("RuntimeException"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3557, + EndPos: 3559, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3557, + EndPos: 3559, + }, + }, + Value: []byte("e"), + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3566, + EndPos: 3607, + }, + }, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3573, + EndPos: 3596, + }, + }, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3580, + EndPos: 3589, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3580, + EndPos: 3589, + }, + }, + Value: []byte("Exception"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3590, + EndPos: 3592, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3590, + EndPos: 3592, + }, + }, + Value: []byte("e"), + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + Finally: &ast.StmtFinally{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3597, + EndPos: 3607, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtUnset{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3611, + EndPos: 3626, + }, + }, + Vars: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3617, + EndPos: 3619, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3617, + EndPos: 3619, + }, + }, + Value: []byte("a"), + }, + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3621, + EndPos: 3623, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3621, + EndPos: 3623, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3630, + EndPos: 3638, + }, + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3634, + EndPos: 3637, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3634, + EndPos: 3637, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3634, + EndPos: 3637, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3641, + EndPos: 3650, + }, + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3646, + EndPos: 3649, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3646, + EndPos: 3649, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3646, + EndPos: 3649, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3653, + EndPos: 3669, + }, + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3658, + EndPos: 3668, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3658, + EndPos: 3661, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3658, + EndPos: 3661, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3665, + EndPos: 3668, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3672, + EndPos: 3685, + }, + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3676, + EndPos: 3679, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3676, + EndPos: 3679, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3676, + EndPos: 3679, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3681, + EndPos: 3684, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3681, + EndPos: 3684, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3681, + EndPos: 3684, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3688, + EndPos: 3708, + }, + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3692, + EndPos: 3695, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3692, + EndPos: 3695, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3692, + EndPos: 3695, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3697, + EndPos: 3707, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3697, + EndPos: 3700, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3697, + EndPos: 3700, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3704, + EndPos: 3707, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3711, + EndPos: 3734, + }, + }, + UseType: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3715, + EndPos: 3723, + }, + }, + Value: []byte("function"), + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3724, + EndPos: 3727, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3724, + EndPos: 3727, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3724, + EndPos: 3727, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3730, + EndPos: 3733, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3730, + EndPos: 3733, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3730, + EndPos: 3733, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3737, + EndPos: 3774, + }, + }, + UseType: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3741, + EndPos: 3749, + }, + }, + Value: []byte("function"), + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3750, + EndPos: 3760, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3750, + EndPos: 3753, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3750, + EndPos: 3753, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3757, + EndPos: 3760, + }, + }, + Value: []byte("foo"), + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3763, + EndPos: 3773, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3763, + EndPos: 3766, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3763, + EndPos: 3766, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3770, + EndPos: 3773, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3777, + EndPos: 3797, + }, + }, + UseType: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3781, + EndPos: 3786, + }, + }, + Value: []byte("const"), + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3787, + EndPos: 3790, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3787, + EndPos: 3790, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3787, + EndPos: 3790, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3793, + EndPos: 3796, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3793, + EndPos: 3796, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3793, + EndPos: 3796, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3800, + EndPos: 3834, + }, + }, + UseType: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3804, + EndPos: 3809, + }, + }, + Value: []byte("const"), + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3810, + EndPos: 3820, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3810, + EndPos: 3813, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3810, + EndPos: 3813, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3817, + EndPos: 3820, + }, + }, + Value: []byte("foo"), + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3823, + EndPos: 3833, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3823, + EndPos: 3826, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3823, + EndPos: 3826, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3830, + EndPos: 3833, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + &ast.StmtGroupUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3838, + EndPos: 3858, + }, + }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3843, + EndPos: 3846, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3843, + EndPos: 3846, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + UseList: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3848, + EndPos: 3851, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3848, + EndPos: 3851, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3848, + EndPos: 3851, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3853, + EndPos: 3856, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3853, + EndPos: 3856, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3853, + EndPos: 3856, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + }, + }, + &ast.StmtGroupUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3861, + EndPos: 3888, + }, + }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3865, + EndPos: 3868, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3865, + EndPos: 3868, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + UseList: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3870, + EndPos: 3873, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3870, + EndPos: 3873, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3870, + EndPos: 3873, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3875, + EndPos: 3886, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3875, + EndPos: 3878, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3875, + EndPos: 3878, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3882, + EndPos: 3886, + }, + }, + Value: []byte("quux"), + }, + }, + }, + }, + &ast.StmtGroupUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3891, + EndPos: 3919, + }, + }, + UseType: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3895, + EndPos: 3903, + }, + }, + Value: []byte("function"), + }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3904, + EndPos: 3907, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3904, + EndPos: 3907, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + UseList: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3909, + EndPos: 3912, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3909, + EndPos: 3912, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3909, + EndPos: 3912, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3914, + EndPos: 3917, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3914, + EndPos: 3917, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3914, + EndPos: 3917, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + }, + }, + &ast.StmtGroupUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3922, + EndPos: 3948, + }, + }, + UseType: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3926, + EndPos: 3931, + }, + }, + Value: []byte("const"), + }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3933, + EndPos: 3936, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3933, + EndPos: 3936, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + UseList: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3938, + EndPos: 3941, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3938, + EndPos: 3941, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3938, + EndPos: 3941, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3943, + EndPos: 3946, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3943, + EndPos: 3946, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3943, + EndPos: 3946, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + }, + }, + &ast.StmtGroupUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3951, + EndPos: 3985, + }, + }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3955, + EndPos: 3958, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3955, + EndPos: 3958, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + UseList: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3966, + EndPos: 3969, + }, + }, + UseType: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3960, + EndPos: 3965, + }, + }, + Value: []byte("const"), + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3966, + EndPos: 3969, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3966, + EndPos: 3969, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3980, + EndPos: 3983, + }, + }, + UseType: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3971, + EndPos: 3979, + }, + }, + Value: []byte("function"), + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3980, + EndPos: 3983, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3980, + EndPos: 3983, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 177, + EndLine: 177, + StartPos: 3989, + EndPos: 3995, + }, + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 177, + EndLine: 177, + StartPos: 3989, + EndPos: 3994, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 177, + EndLine: 177, + StartPos: 3989, + EndPos: 3991, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 177, + EndLine: 177, + StartPos: 3989, + EndPos: 3991, + }, + }, + Value: []byte("a"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 177, + EndLine: 177, + StartPos: 3992, + EndPos: 3993, + }, + }, + Value: []byte("1"), + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3998, + EndPos: 4007, + }, + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3998, + EndPos: 4006, + }, + }, + Var: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3998, + EndPos: 4003, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3998, + EndPos: 4000, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3998, + EndPos: 4000, + }, + }, + Value: []byte("a"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 4001, + EndPos: 4002, + }, + }, + Value: []byte("1"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 4004, + EndPos: 4005, + }, + }, + Value: []byte("2"), + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 4010, + EndPos: 4018, + }, + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 4010, + EndPos: 4017, + }, + }, + Items: []ast.Vertex{}, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 4021, + EndPos: 4030, + }, + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 4021, + EndPos: 4029, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 4027, + EndPos: 4028, + }, + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 4027, + EndPos: 4028, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4033, + EndPos: 4051, + }, + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4033, + EndPos: 4050, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4039, + EndPos: 4043, + }, + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4039, + EndPos: 4040, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4042, + EndPos: 4043, + }, + }, + Value: []byte("1"), + }, + }, + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4045, + EndPos: 4048, + }, + }, + Val: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4045, + EndPos: 4048, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4046, + EndPos: 4048, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4046, + EndPos: 4048, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.ExprArrayItem{}, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4054, + EndPos: 4058, + }, + }, + Expr: &ast.ExprBitwiseNot{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4054, + EndPos: 4057, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4055, + EndPos: 4057, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4055, + EndPos: 4057, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4061, + EndPos: 4065, + }, + }, + Expr: &ast.ExprBooleanNot{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4061, + EndPos: 4064, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4062, + EndPos: 4064, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4062, + EndPos: 4064, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 185, + EndLine: 185, + StartPos: 4069, + EndPos: 4078, + }, + }, + Expr: &ast.ExprClassConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 185, + EndLine: 185, + StartPos: 4069, + EndPos: 4077, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 185, + EndLine: 185, + StartPos: 4069, + EndPos: 4072, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 185, + EndLine: 185, + StartPos: 4069, + EndPos: 4072, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 185, + EndLine: 185, + StartPos: 4074, + EndPos: 4077, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4081, + EndPos: 4091, + }, + }, + Expr: &ast.ExprClassConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4081, + EndPos: 4090, + }, + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4081, + EndPos: 4085, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4081, + EndPos: 4085, + }, + }, + Value: []byte("foo"), + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4087, + EndPos: 4090, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4094, + EndPos: 4104, + }, + }, + Expr: &ast.ExprClone{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4094, + EndPos: 4102, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4100, + EndPos: 4102, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4100, + EndPos: 4102, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4107, + EndPos: 4116, + }, + }, + Expr: &ast.ExprClone{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4107, + EndPos: 4115, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4113, + EndPos: 4115, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4113, + EndPos: 4115, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 189, + EndLine: 189, + StartPos: 4119, + EndPos: 4132, + }, + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 189, + EndLine: 189, + StartPos: 4119, + EndPos: 4131, + }, + }, + ReturnsRef: false, + Static: false, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4135, + EndPos: 4169, + }, + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4135, + EndPos: 4168, + }, + }, + Static: false, + ReturnsRef: false, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4144, + EndPos: 4146, + }, + }, + ByRef: false, + Variadic: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4144, + EndPos: 4146, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4144, + EndPos: 4146, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4148, + EndPos: 4150, + }, + }, + ByRef: false, + Variadic: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4148, + EndPos: 4150, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4148, + EndPos: 4150, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + ClosureUse: &ast.ExprClosureUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4152, + EndPos: 4165, + }, + }, + Uses: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4157, + EndPos: 4159, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4157, + EndPos: 4159, + }, + }, + Value: []byte("c"), + }, + }, + &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4161, + EndPos: 4164, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4162, + EndPos: 4164, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4162, + EndPos: 4164, + }, + }, + Value: []byte("d"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4172, + EndPos: 4192, + }, + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4172, + EndPos: 4191, + }, + }, + ReturnsRef: false, + Static: false, + ReturnType: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4184, + EndPos: 4188, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4184, + EndPos: 4188, + }, + }, + Value: []byte("void"), + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4195, + EndPos: 4199, + }, + }, + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4195, + EndPos: 4198, + }, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4195, + EndPos: 4198, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4195, + EndPos: 4198, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4202, + EndPos: 4216, + }, + }, + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4202, + EndPos: 4215, + }, + }, + Const: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4202, + EndPos: 4215, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4212, + EndPos: 4215, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4219, + EndPos: 4224, + }, + }, + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4219, + EndPos: 4223, + }, + }, + Const: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4219, + EndPos: 4223, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4220, + EndPos: 4223, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4228, + EndPos: 4238, + }, + }, + Expr: &ast.ExprEmpty{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4228, + EndPos: 4237, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4234, + EndPos: 4236, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4234, + EndPos: 4236, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4241, + EndPos: 4245, + }, + }, + Expr: &ast.ExprErrorSuppress{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4241, + EndPos: 4244, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4242, + EndPos: 4244, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4242, + EndPos: 4244, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4248, + EndPos: 4257, + }, + }, + Expr: &ast.ExprEval{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4248, + EndPos: 4256, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4253, + EndPos: 4255, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4253, + EndPos: 4255, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 199, + EndLine: 199, + StartPos: 4260, + EndPos: 4265, + }, + }, + Expr: &ast.ExprExit{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 199, + EndLine: 199, + StartPos: 4260, + EndPos: 4264, + }, + }, + Die: false, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 200, + EndLine: 200, + StartPos: 4268, + EndPos: 4277, + }, + }, + Expr: &ast.ExprExit{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 200, + EndLine: 200, + StartPos: 4268, + EndPos: 4276, + }, + }, + Die: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 200, + EndLine: 200, + StartPos: 4273, + EndPos: 4275, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 200, + EndLine: 200, + StartPos: 4273, + EndPos: 4275, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 201, + EndLine: 201, + StartPos: 4280, + EndPos: 4284, + }, + }, + Expr: &ast.ExprExit{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 201, + EndLine: 201, + StartPos: 4280, + EndPos: 4283, + }, + }, + Die: true, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 202, + EndLine: 202, + StartPos: 4287, + EndPos: 4295, + }, + }, + Expr: &ast.ExprExit{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 202, + EndLine: 202, + StartPos: 4287, + EndPos: 4294, + }, + }, + Die: true, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 202, + EndLine: 202, + StartPos: 4291, + EndPos: 4293, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 202, + EndLine: 202, + StartPos: 4291, + EndPos: 4293, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4298, + EndPos: 4304, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4298, + EndPos: 4303, + }, + }, + Function: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4298, + EndPos: 4301, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4298, + EndPos: 4301, + }, + }, + Value: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4301, + EndPos: 4303, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 204, + EndLine: 204, + StartPos: 4307, + EndPos: 4323, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 204, + EndLine: 204, + StartPos: 4307, + EndPos: 4322, + }, + }, + Function: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 204, + EndLine: 204, + StartPos: 4307, + EndPos: 4320, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 204, + EndLine: 204, + StartPos: 4317, + EndPos: 4320, + }, + }, + Value: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 204, + EndLine: 204, + StartPos: 4320, + EndPos: 4322, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4326, + EndPos: 4333, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4326, + EndPos: 4332, + }, + }, + Function: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4326, + EndPos: 4330, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4327, + EndPos: 4330, + }, + }, + Value: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4330, + EndPos: 4332, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4336, + EndPos: 4343, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4336, + EndPos: 4342, + }, + }, + Function: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4336, + EndPos: 4340, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4336, + EndPos: 4340, + }, + }, + Value: []byte("foo"), + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4340, + EndPos: 4342, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 208, + EndLine: 208, + StartPos: 4347, + EndPos: 4352, + }, + }, + Expr: &ast.ExprPostDec{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 208, + EndLine: 208, + StartPos: 4347, + EndPos: 4351, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 208, + EndLine: 208, + StartPos: 4347, + EndPos: 4349, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 208, + EndLine: 208, + StartPos: 4347, + EndPos: 4349, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 209, + EndLine: 209, + StartPos: 4355, + EndPos: 4360, + }, + }, + Expr: &ast.ExprPostInc{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 209, + EndLine: 209, + StartPos: 4355, + EndPos: 4359, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 209, + EndLine: 209, + StartPos: 4355, + EndPos: 4357, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 209, + EndLine: 209, + StartPos: 4355, + EndPos: 4357, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4363, + EndPos: 4368, + }, + }, + Expr: &ast.ExprPreDec{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4363, + EndPos: 4367, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4365, + EndPos: 4367, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4365, + EndPos: 4367, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4371, + EndPos: 4376, + }, + }, + Expr: &ast.ExprPreInc{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4371, + EndPos: 4375, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4373, + EndPos: 4375, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4373, + EndPos: 4375, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 213, + EndLine: 213, + StartPos: 4380, + EndPos: 4391, + }, + }, + Expr: &ast.ExprInclude{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 213, + EndLine: 213, + StartPos: 4380, + EndPos: 4390, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 213, + EndLine: 213, + StartPos: 4388, + EndPos: 4390, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 213, + EndLine: 213, + StartPos: 4388, + EndPos: 4390, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4394, + EndPos: 4410, + }, + }, + Expr: &ast.ExprIncludeOnce{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4394, + EndPos: 4409, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4407, + EndPos: 4409, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4407, + EndPos: 4409, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4413, + EndPos: 4424, + }, + }, + Expr: &ast.ExprRequire{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4413, + EndPos: 4423, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4421, + EndPos: 4423, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4421, + EndPos: 4423, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4427, + EndPos: 4443, + }, + }, + Expr: &ast.ExprRequireOnce{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4427, + EndPos: 4442, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4440, + EndPos: 4442, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4440, + EndPos: 4442, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4447, + EndPos: 4465, + }, + }, + Expr: &ast.ExprInstanceOf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4447, + EndPos: 4464, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4447, + EndPos: 4449, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4447, + EndPos: 4449, + }, + }, + Value: []byte("a"), + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4461, + EndPos: 4464, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4461, + EndPos: 4464, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4468, + EndPos: 4496, + }, + }, + Expr: &ast.ExprInstanceOf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4468, + EndPos: 4495, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4468, + EndPos: 4470, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4468, + EndPos: 4470, + }, + }, + Value: []byte("a"), + }, + }, + Class: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4482, + EndPos: 4495, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4492, + EndPos: 4495, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4499, + EndPos: 4518, + }, + }, + Expr: &ast.ExprInstanceOf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4499, + EndPos: 4517, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4499, + EndPos: 4501, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4499, + EndPos: 4501, + }, + }, + Value: []byte("a"), + }, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4513, + EndPos: 4517, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4514, + EndPos: 4517, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4522, + EndPos: 4536, + }, + }, + Expr: &ast.ExprIsset{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4522, + EndPos: 4535, + }, + }, + Vars: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4528, + EndPos: 4530, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4528, + EndPos: 4530, + }, + }, + Value: []byte("a"), + }, + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4532, + EndPos: 4534, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4532, + EndPos: 4534, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4539, + EndPos: 4553, + }, + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4539, + EndPos: 4552, + }, + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4539, + EndPos: 4547, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4544, + EndPos: 4546, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4544, + EndPos: 4546, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4544, + EndPos: 4546, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4550, + EndPos: 4552, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4550, + EndPos: 4552, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4556, + EndPos: 4572, + }, + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4556, + EndPos: 4571, + }, + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4556, + EndPos: 4566, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4561, + EndPos: 4565, + }, + }, + Val: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4561, + EndPos: 4565, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4561, + EndPos: 4563, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4561, + EndPos: 4563, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4569, + EndPos: 4571, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4569, + EndPos: 4571, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4575, + EndPos: 4595, + }, + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4575, + EndPos: 4594, + }, + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4575, + EndPos: 4589, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4580, + EndPos: 4588, + }, + }, + Val: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4580, + EndPos: 4588, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4585, + EndPos: 4587, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4585, + EndPos: 4587, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4585, + EndPos: 4587, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4592, + EndPos: 4594, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4592, + EndPos: 4594, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4599, + EndPos: 4609, + }, + }, + Expr: &ast.ExprMethodCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4599, + EndPos: 4608, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4599, + EndPos: 4601, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4599, + EndPos: 4601, + }, + }, + Value: []byte("a"), + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4603, + EndPos: 4606, + }, + }, + Value: []byte("foo"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4606, + EndPos: 4608, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4612, + EndPos: 4622, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4612, + EndPos: 4621, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4616, + EndPos: 4619, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4616, + EndPos: 4619, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4619, + EndPos: 4621, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4625, + EndPos: 4645, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4625, + EndPos: 4644, + }, + }, + Class: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4629, + EndPos: 4642, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4639, + EndPos: 4642, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4642, + EndPos: 4644, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4648, + EndPos: 4659, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4648, + EndPos: 4658, + }, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4652, + EndPos: 4656, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4653, + EndPos: 4656, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4656, + EndPos: 4658, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4662, + EndPos: 4687, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4662, + EndPos: 4686, + }, + }, + Class: &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4666, + EndPos: 4686, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4672, + EndPos: 4683, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4673, + EndPos: 4675, + }, + }, + IsReference: false, + Variadic: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4673, + EndPos: 4675, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4673, + EndPos: 4675, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4677, + EndPos: 4682, + }, + }, + IsReference: false, + Variadic: true, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4680, + EndPos: 4682, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4680, + EndPos: 4682, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4690, + EndPos: 4700, + }, + }, + Expr: &ast.ExprPrint{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4690, + EndPos: 4698, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4696, + EndPos: 4698, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4696, + EndPos: 4698, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4703, + EndPos: 4711, + }, + }, + Expr: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4703, + EndPos: 4710, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4703, + EndPos: 4705, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4703, + EndPos: 4705, + }, + }, + Value: []byte("a"), + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4707, + EndPos: 4710, + }, + }, + Value: []byte("foo"), + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4714, + EndPos: 4723, + }, + }, + Expr: &ast.ExprShellExec{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4714, + EndPos: 4722, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4715, + EndPos: 4719, + }, + }, + Value: []byte("cmd "), + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4719, + EndPos: 4721, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4719, + EndPos: 4721, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4726, + EndPos: 4732, + }, + }, + Expr: &ast.ExprShellExec{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4726, + EndPos: 4731, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4727, + EndPos: 4730, + }, + }, + Value: []byte("cmd"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 236, + EndLine: 236, + StartPos: 4735, + EndPos: 4738, + }, + }, + Expr: &ast.ExprShellExec{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 236, + EndLine: 236, + StartPos: 4735, + EndPos: 4737, + }, + }, + Parts: []ast.Vertex{}, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4741, + EndPos: 4744, + }, + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4741, + EndPos: 4743, + }, + }, + Items: []ast.Vertex{}, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4747, + EndPos: 4751, + }, + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4747, + EndPos: 4750, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4748, + EndPos: 4749, + }, + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4748, + EndPos: 4749, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4754, + EndPos: 4767, + }, + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4754, + EndPos: 4766, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4755, + EndPos: 4759, + }, + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4755, + EndPos: 4756, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4758, + EndPos: 4759, + }, + }, + Value: []byte("1"), + }, + }, + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4761, + EndPos: 4764, + }, + }, + Val: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4761, + EndPos: 4764, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4762, + EndPos: 4764, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4762, + EndPos: 4764, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.ExprArrayItem{}, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4771, + EndPos: 4781, + }, + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4771, + EndPos: 4780, + }, + }, + Var: &ast.ExprShortList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4771, + EndPos: 4775, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4772, + EndPos: 4774, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4772, + EndPos: 4774, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4772, + EndPos: 4774, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4778, + EndPos: 4780, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4778, + EndPos: 4780, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4784, + EndPos: 4796, + }, + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4784, + EndPos: 4795, + }, + }, + Var: &ast.ExprShortList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4784, + EndPos: 4790, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4785, + EndPos: 4789, + }, + }, + Val: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4785, + EndPos: 4789, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4785, + EndPos: 4787, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4785, + EndPos: 4787, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4793, + EndPos: 4795, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4793, + EndPos: 4795, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4799, + EndPos: 4815, + }, + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4799, + EndPos: 4814, + }, + }, + Var: &ast.ExprShortList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4799, + EndPos: 4809, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4800, + EndPos: 4808, + }, + }, + Val: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4800, + EndPos: 4808, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4805, + EndPos: 4807, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4805, + EndPos: 4807, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4805, + EndPos: 4807, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4812, + EndPos: 4814, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4812, + EndPos: 4814, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4818, + EndPos: 4829, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4818, + EndPos: 4828, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4818, + EndPos: 4821, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4818, + EndPos: 4821, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4823, + EndPos: 4826, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4826, + EndPos: 4828, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4832, + EndPos: 4853, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4832, + EndPos: 4852, + }, + }, + Class: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4832, + EndPos: 4845, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4842, + EndPos: 4845, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4847, + EndPos: 4850, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4850, + EndPos: 4852, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4856, + EndPos: 4868, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4856, + EndPos: 4867, + }, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4856, + EndPos: 4860, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4857, + EndPos: 4860, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4862, + EndPos: 4865, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4865, + EndPos: 4867, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4871, + EndPos: 4881, + }, + }, + Expr: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4871, + EndPos: 4880, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4871, + EndPos: 4874, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4871, + EndPos: 4874, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4876, + EndPos: 4880, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4876, + EndPos: 4880, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4884, + EndPos: 4895, + }, + }, + Expr: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4884, + EndPos: 4894, + }, + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4884, + EndPos: 4888, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4884, + EndPos: 4888, + }, + }, + Value: []byte("foo"), + }, + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4890, + EndPos: 4894, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4890, + EndPos: 4894, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4898, + EndPos: 4918, + }, + }, + Expr: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4898, + EndPos: 4917, + }, + }, + Class: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4898, + EndPos: 4911, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4908, + EndPos: 4911, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4913, + EndPos: 4917, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4913, + EndPos: 4917, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4921, + EndPos: 4932, + }, + }, + Expr: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4921, + EndPos: 4931, + }, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4921, + EndPos: 4925, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4922, + EndPos: 4925, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4927, + EndPos: 4931, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4927, + EndPos: 4931, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4935, + EndPos: 4948, + }, + }, + Expr: &ast.ExprTernary{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4935, + EndPos: 4947, + }, + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4935, + EndPos: 4937, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4935, + EndPos: 4937, + }, + }, + Value: []byte("a"), + }, + }, + IfTrue: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4940, + EndPos: 4942, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4940, + EndPos: 4942, + }, + }, + Value: []byte("b"), + }, + }, + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4945, + EndPos: 4947, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4945, + EndPos: 4947, + }, + }, + Value: []byte("c"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4951, + EndPos: 4961, + }, + }, + Expr: &ast.ExprTernary{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4951, + EndPos: 4960, + }, + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4951, + EndPos: 4953, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4951, + EndPos: 4953, + }, + }, + Value: []byte("a"), + }, + }, + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4958, + EndPos: 4960, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4958, + EndPos: 4960, + }, + }, + Value: []byte("c"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4964, + EndPos: 4987, + }, + }, + Expr: &ast.ExprTernary{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4964, + EndPos: 4986, + }, + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4964, + EndPos: 4966, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4964, + EndPos: 4966, + }, + }, + Value: []byte("a"), + }, + }, + IfTrue: &ast.ExprTernary{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4969, + EndPos: 4981, + }, + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4969, + EndPos: 4971, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4969, + EndPos: 4971, + }, + }, + Value: []byte("b"), + }, + }, + IfTrue: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4974, + EndPos: 4976, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4974, + EndPos: 4976, + }, + }, + Value: []byte("c"), + }, + }, + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4979, + EndPos: 4981, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4979, + EndPos: 4981, + }, + }, + Value: []byte("d"), + }, + }, + }, + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4984, + EndPos: 4986, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4984, + EndPos: 4986, + }, + }, + Value: []byte("e"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4990, + EndPos: 5013, + }, + }, + Expr: &ast.ExprTernary{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4990, + EndPos: 5012, + }, + }, + Condition: &ast.ExprTernary{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4990, + EndPos: 5002, + }, + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4990, + EndPos: 4992, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4990, + EndPos: 4992, + }, + }, + Value: []byte("a"), + }, + }, + IfTrue: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4995, + EndPos: 4997, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4995, + EndPos: 4997, + }, + }, + Value: []byte("b"), + }, + }, + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 5000, + EndPos: 5002, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 5000, + EndPos: 5002, + }, + }, + Value: []byte("c"), + }, + }, + }, + IfTrue: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 5005, + EndPos: 5007, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 5005, + EndPos: 5007, + }, + }, + Value: []byte("d"), + }, + }, + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 5010, + EndPos: 5012, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 5010, + EndPos: 5012, + }, + }, + Value: []byte("e"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5016, + EndPos: 5020, + }, + }, + Expr: &ast.ExprUnaryMinus{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5016, + EndPos: 5019, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5017, + EndPos: 5019, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5017, + EndPos: 5019, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5023, + EndPos: 5027, + }, + }, + Expr: &ast.ExprUnaryPlus{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5023, + EndPos: 5026, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5024, + EndPos: 5026, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5024, + EndPos: 5026, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5030, + EndPos: 5034, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5030, + EndPos: 5033, + }, + }, + VarName: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5031, + EndPos: 5033, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5031, + EndPos: 5033, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 258, + EndLine: 258, + StartPos: 5037, + EndPos: 5043, + }, + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 258, + EndLine: 258, + StartPos: 5037, + EndPos: 5042, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 259, + EndLine: 259, + StartPos: 5046, + EndPos: 5055, + }, + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 259, + EndLine: 259, + StartPos: 5046, + EndPos: 5054, + }, + }, + Value: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 259, + EndLine: 259, + StartPos: 5052, + EndPos: 5054, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 259, + EndLine: 259, + StartPos: 5052, + EndPos: 5054, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5058, + EndPos: 5073, + }, + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5058, + EndPos: 5072, + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5064, + EndPos: 5066, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5064, + EndPos: 5066, + }, + }, + Value: []byte("a"), + }, + }, + Value: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5070, + EndPos: 5072, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5070, + EndPos: 5072, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5076, + EndPos: 5090, + }, + }, + Expr: &ast.ExprYieldFrom{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5076, + EndPos: 5089, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5087, + EndPos: 5089, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5087, + EndPos: 5089, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 263, + EndLine: 263, + StartPos: 5096, + EndPos: 5106, + }, + }, + Expr: &ast.ExprCastArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 263, + EndLine: 263, + StartPos: 5096, + EndPos: 5105, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 263, + EndLine: 263, + StartPos: 5103, + EndPos: 5105, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 263, + EndLine: 263, + StartPos: 5103, + EndPos: 5105, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5109, + EndPos: 5121, + }, + }, + Expr: &ast.ExprCastBool{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5109, + EndPos: 5120, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5118, + EndPos: 5120, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5118, + EndPos: 5120, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5124, + EndPos: 5133, + }, + }, + Expr: &ast.ExprCastBool{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5124, + EndPos: 5132, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5130, + EndPos: 5132, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5130, + EndPos: 5132, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5136, + EndPos: 5147, + }, + }, + Expr: &ast.ExprCastDouble{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5136, + EndPos: 5146, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5144, + EndPos: 5146, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5144, + EndPos: 5146, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 267, + EndLine: 267, + StartPos: 5150, + EndPos: 5160, + }, + }, + Expr: &ast.ExprCastDouble{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 267, + EndLine: 267, + StartPos: 5150, + EndPos: 5159, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 267, + EndLine: 267, + StartPos: 5157, + EndPos: 5159, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 267, + EndLine: 267, + StartPos: 5157, + EndPos: 5159, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5163, + EndPos: 5175, + }, + }, + Expr: &ast.ExprCastInt{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5163, + EndPos: 5174, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5172, + EndPos: 5174, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5172, + EndPos: 5174, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 269, + EndLine: 269, + StartPos: 5178, + EndPos: 5186, + }, + }, + Expr: &ast.ExprCastInt{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 269, + EndLine: 269, + StartPos: 5178, + EndPos: 5185, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 269, + EndLine: 269, + StartPos: 5183, + EndPos: 5185, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 269, + EndLine: 269, + StartPos: 5183, + EndPos: 5185, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5189, + EndPos: 5200, + }, + }, + Expr: &ast.ExprCastObject{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5189, + EndPos: 5199, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5197, + EndPos: 5199, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5197, + EndPos: 5199, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5203, + EndPos: 5214, + }, + }, + Expr: &ast.ExprCastString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5203, + EndPos: 5213, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5211, + EndPos: 5213, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5211, + EndPos: 5213, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5217, + EndPos: 5227, + }, + }, + Expr: &ast.ExprCastUnset{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5217, + EndPos: 5226, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5224, + EndPos: 5226, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5224, + EndPos: 5226, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5231, + EndPos: 5239, + }, + }, + Expr: &ast.ExprBinaryBitwiseAnd{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5231, + EndPos: 5238, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5231, + EndPos: 5233, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5231, + EndPos: 5233, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5236, + EndPos: 5238, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5236, + EndPos: 5238, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5242, + EndPos: 5250, + }, + }, + Expr: &ast.ExprBinaryBitwiseOr{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5242, + EndPos: 5249, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5242, + EndPos: 5244, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5242, + EndPos: 5244, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5247, + EndPos: 5249, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5247, + EndPos: 5249, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5253, + EndPos: 5261, + }, + }, + Expr: &ast.ExprBinaryBitwiseXor{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5253, + EndPos: 5260, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5253, + EndPos: 5255, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5253, + EndPos: 5255, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5258, + EndPos: 5260, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5258, + EndPos: 5260, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5264, + EndPos: 5273, + }, + }, + Expr: &ast.ExprBinaryBooleanAnd{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5264, + EndPos: 5272, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5264, + EndPos: 5266, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5264, + EndPos: 5266, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5270, + EndPos: 5272, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5270, + EndPos: 5272, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5276, + EndPos: 5285, + }, + }, + Expr: &ast.ExprBinaryBooleanOr{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5276, + EndPos: 5284, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5276, + EndPos: 5278, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5276, + EndPos: 5278, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5282, + EndPos: 5284, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5282, + EndPos: 5284, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5288, + EndPos: 5297, + }, + }, + Expr: &ast.ExprBinaryCoalesce{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5288, + EndPos: 5296, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5288, + EndPos: 5290, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5288, + EndPos: 5290, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5294, + EndPos: 5296, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5294, + EndPos: 5296, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5300, + EndPos: 5308, + }, + }, + Expr: &ast.ExprBinaryConcat{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5300, + EndPos: 5307, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5300, + EndPos: 5302, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5300, + EndPos: 5302, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5305, + EndPos: 5307, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5305, + EndPos: 5307, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5311, + EndPos: 5319, + }, + }, + Expr: &ast.ExprBinaryDiv{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5311, + EndPos: 5318, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5311, + EndPos: 5313, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5311, + EndPos: 5313, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5316, + EndPos: 5318, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5316, + EndPos: 5318, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5322, + EndPos: 5331, + }, + }, + Expr: &ast.ExprBinaryEqual{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5322, + EndPos: 5330, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5322, + EndPos: 5324, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5322, + EndPos: 5324, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5328, + EndPos: 5330, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5328, + EndPos: 5330, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5334, + EndPos: 5343, + }, + }, + Expr: &ast.ExprBinaryGreaterOrEqual{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5334, + EndPos: 5342, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5334, + EndPos: 5336, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5334, + EndPos: 5336, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5340, + EndPos: 5342, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5340, + EndPos: 5342, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5346, + EndPos: 5354, + }, + }, + Expr: &ast.ExprBinaryGreater{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5346, + EndPos: 5353, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5346, + EndPos: 5348, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5346, + EndPos: 5348, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5351, + EndPos: 5353, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5351, + EndPos: 5353, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5357, + EndPos: 5367, + }, + }, + Expr: &ast.ExprBinaryIdentical{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5357, + EndPos: 5366, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5357, + EndPos: 5359, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5357, + EndPos: 5359, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5364, + EndPos: 5366, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5364, + EndPos: 5366, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5370, + EndPos: 5380, + }, + }, + Expr: &ast.ExprBinaryLogicalAnd{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5370, + EndPos: 5379, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5370, + EndPos: 5372, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5370, + EndPos: 5372, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5377, + EndPos: 5379, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5377, + EndPos: 5379, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5383, + EndPos: 5392, + }, + }, + Expr: &ast.ExprBinaryLogicalOr{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5383, + EndPos: 5391, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5383, + EndPos: 5385, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5383, + EndPos: 5385, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5389, + EndPos: 5391, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5389, + EndPos: 5391, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5395, + EndPos: 5405, + }, + }, + Expr: &ast.ExprBinaryLogicalXor{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5395, + EndPos: 5404, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5395, + EndPos: 5397, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5395, + EndPos: 5397, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5402, + EndPos: 5404, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5402, + EndPos: 5404, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5408, + EndPos: 5416, + }, + }, + Expr: &ast.ExprBinaryMinus{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5408, + EndPos: 5415, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5408, + EndPos: 5410, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5408, + EndPos: 5410, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5413, + EndPos: 5415, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5413, + EndPos: 5415, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5419, + EndPos: 5427, + }, + }, + Expr: &ast.ExprBinaryMod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5419, + EndPos: 5426, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5419, + EndPos: 5421, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5419, + EndPos: 5421, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5424, + EndPos: 5426, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5424, + EndPos: 5426, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5430, + EndPos: 5438, + }, + }, + Expr: &ast.ExprBinaryMul{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5430, + EndPos: 5437, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5430, + EndPos: 5432, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5430, + EndPos: 5432, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5435, + EndPos: 5437, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5435, + EndPos: 5437, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5441, + EndPos: 5450, + }, + }, + Expr: &ast.ExprBinaryNotEqual{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5441, + EndPos: 5449, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5441, + EndPos: 5443, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5441, + EndPos: 5443, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5447, + EndPos: 5449, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5447, + EndPos: 5449, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5453, + EndPos: 5463, + }, + }, + Expr: &ast.ExprBinaryNotIdentical{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5453, + EndPos: 5462, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5453, + EndPos: 5455, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5453, + EndPos: 5455, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5460, + EndPos: 5462, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5460, + EndPos: 5462, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5466, + EndPos: 5474, + }, + }, + Expr: &ast.ExprBinaryPlus{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5466, + EndPos: 5473, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5466, + EndPos: 5468, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5466, + EndPos: 5468, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5471, + EndPos: 5473, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5471, + EndPos: 5473, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5477, + EndPos: 5486, + }, + }, + Expr: &ast.ExprBinaryPow{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5477, + EndPos: 5485, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5477, + EndPos: 5479, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5477, + EndPos: 5479, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5483, + EndPos: 5485, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5483, + EndPos: 5485, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5489, + EndPos: 5498, + }, + }, + Expr: &ast.ExprBinaryShiftLeft{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5489, + EndPos: 5497, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5489, + EndPos: 5491, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5489, + EndPos: 5491, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5495, + EndPos: 5497, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5495, + EndPos: 5497, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5501, + EndPos: 5510, + }, + }, + Expr: &ast.ExprBinaryShiftRight{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5501, + EndPos: 5509, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5501, + EndPos: 5503, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5501, + EndPos: 5503, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5507, + EndPos: 5509, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5507, + EndPos: 5509, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5513, + EndPos: 5522, + }, + }, + Expr: &ast.ExprBinarySmallerOrEqual{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5513, + EndPos: 5521, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5513, + EndPos: 5515, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5513, + EndPos: 5515, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5519, + EndPos: 5521, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5519, + EndPos: 5521, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5525, + EndPos: 5533, + }, + }, + Expr: &ast.ExprBinarySmaller{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5525, + EndPos: 5532, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5525, + EndPos: 5527, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5525, + EndPos: 5527, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5530, + EndPos: 5532, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5530, + EndPos: 5532, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5536, + EndPos: 5546, + }, + }, + Expr: &ast.ExprBinarySpaceship{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5536, + EndPos: 5545, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5536, + EndPos: 5538, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5536, + EndPos: 5538, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5543, + EndPos: 5545, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5543, + EndPos: 5545, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5550, + EndPos: 5559, + }, + }, + Expr: &ast.ExprAssignReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5550, + EndPos: 5558, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5550, + EndPos: 5552, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5550, + EndPos: 5552, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5556, + EndPos: 5558, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5556, + EndPos: 5558, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5562, + EndPos: 5570, + }, + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5562, + EndPos: 5569, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5562, + EndPos: 5564, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5562, + EndPos: 5564, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5567, + EndPos: 5569, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5567, + EndPos: 5569, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5573, + EndPos: 5582, + }, + }, + Expr: &ast.ExprAssignBitwiseAnd{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5573, + EndPos: 5581, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5573, + EndPos: 5575, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5573, + EndPos: 5575, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5579, + EndPos: 5581, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5579, + EndPos: 5581, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5585, + EndPos: 5594, + }, + }, + Expr: &ast.ExprAssignBitwiseOr{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5585, + EndPos: 5593, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5585, + EndPos: 5587, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5585, + EndPos: 5587, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5591, + EndPos: 5593, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5591, + EndPos: 5593, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5597, + EndPos: 5606, + }, + }, + Expr: &ast.ExprAssignBitwiseXor{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5597, + EndPos: 5605, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5597, + EndPos: 5599, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5597, + EndPos: 5599, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5603, + EndPos: 5605, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5603, + EndPos: 5605, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5609, + EndPos: 5618, + }, + }, + Expr: &ast.ExprAssignConcat{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5609, + EndPos: 5617, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5609, + EndPos: 5611, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5609, + EndPos: 5611, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5615, + EndPos: 5617, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5615, + EndPos: 5617, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5621, + EndPos: 5630, + }, + }, + Expr: &ast.ExprAssignDiv{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5621, + EndPos: 5629, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5621, + EndPos: 5623, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5621, + EndPos: 5623, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5627, + EndPos: 5629, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5627, + EndPos: 5629, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5633, + EndPos: 5642, + }, + }, + Expr: &ast.ExprAssignMinus{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5633, + EndPos: 5641, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5633, + EndPos: 5635, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5633, + EndPos: 5635, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5639, + EndPos: 5641, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5639, + EndPos: 5641, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5645, + EndPos: 5654, + }, + }, + Expr: &ast.ExprAssignMod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5645, + EndPos: 5653, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5645, + EndPos: 5647, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5645, + EndPos: 5647, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5651, + EndPos: 5653, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5651, + EndPos: 5653, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5657, + EndPos: 5666, + }, + }, + Expr: &ast.ExprAssignMul{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5657, + EndPos: 5665, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5657, + EndPos: 5659, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5657, + EndPos: 5659, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5663, + EndPos: 5665, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5663, + EndPos: 5665, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5669, + EndPos: 5678, + }, + }, + Expr: &ast.ExprAssignPlus{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5669, + EndPos: 5677, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5669, + EndPos: 5671, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5669, + EndPos: 5671, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5675, + EndPos: 5677, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5675, + EndPos: 5677, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5681, + EndPos: 5691, + }, + }, + Expr: &ast.ExprAssignPow{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5681, + EndPos: 5690, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5681, + EndPos: 5683, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5681, + EndPos: 5683, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5688, + EndPos: 5690, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5688, + EndPos: 5690, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5694, + EndPos: 5704, + }, + }, + Expr: &ast.ExprAssignShiftLeft{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5694, + EndPos: 5703, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5694, + EndPos: 5696, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5694, + EndPos: 5696, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5701, + EndPos: 5703, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5701, + EndPos: 5703, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5707, + EndPos: 5717, + }, + }, + Expr: &ast.ExprAssignShiftRight{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5707, + EndPos: 5716, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5707, + EndPos: 5709, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5707, + EndPos: 5709, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5714, + EndPos: 5716, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5714, + EndPos: 5716, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5721, + EndPos: 5760, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5727, + EndPos: 5730, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5732, + EndPos: 5758, + }, + }, + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5748, + EndPos: 5753, + }, + }, + Value: []byte("class"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5732, + EndPos: 5738, + }, + }, + Value: []byte("public"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5756, + EndPos: 5758, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5763, + EndPos: 5774, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5763, + EndPos: 5773, + }, + }, + Function: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5763, + EndPos: 5771, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5764, + EndPos: 5767, + }, + }, + Value: []byte("foo"), + }, + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5768, + EndPos: 5771, + }, + }, + Value: []byte("bar"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5771, + EndPos: 5773, + }, + }, + }, + }, + }, + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 326, + StartPos: 5778, + EndPos: 5905, + }, + }, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5787, + EndPos: 5790, + }, + }, + Value: []byte("foo"), + }, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5791, + EndPos: 5794, + }, + }, + ByRef: true, + Variadic: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5792, + EndPos: 5794, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5792, + EndPos: 5794, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5796, + EndPos: 5801, + }, + }, + ByRef: false, + Variadic: true, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5799, + EndPos: 5801, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5799, + EndPos: 5801, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 322, + EndLine: 322, + StartPos: 5830, + EndPos: 5847, + }, + }, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 322, + EndLine: 322, + StartPos: 5839, + EndPos: 5842, + }, + }, + Value: []byte("bar"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 323, + EndLine: 323, + StartPos: 5851, + EndPos: 5863, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 323, + EndLine: 323, + StartPos: 5857, + EndPos: 5860, + }, + }, + Value: []byte("Baz"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtTrait{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5867, + EndPos: 5879, + }, + }, + TraitName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5873, + EndPos: 5877, + }, + }, + Value: []byte("Quux"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtInterface{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5883, + EndPos: 5901, + }, + }, + InterfaceName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5893, + EndPos: 5898, + }, + }, + Value: []byte("Quuux"), + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5911, + EndPos: 5954, + }, + }, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5920, + EndPos: 5923, + }, + }, + Value: []byte("foo"), + }, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5924, + EndPos: 5931, + }, + }, + ByRef: true, + Variadic: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5925, + EndPos: 5927, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5925, + EndPos: 5927, + }, + }, + Value: []byte("a"), + }, + }, + DefaultValue: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5930, + EndPos: 5931, + }, + }, + Value: []byte("1"), + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5933, + EndPos: 5942, + }, + }, + ByRef: false, + Variadic: true, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5936, + EndPos: 5938, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5936, + EndPos: 5938, + }, + }, + Value: []byte("b"), + }, + }, + DefaultValue: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5941, + EndPos: 5942, + }, + }, + Value: []byte("1"), + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5944, + EndPos: 5950, + }, + }, + ByRef: false, + Variadic: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5944, + EndPos: 5946, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5944, + EndPos: 5946, + }, + }, + Value: []byte("c"), + }, + }, + DefaultValue: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5949, + EndPos: 5950, + }, + }, + Value: []byte("1"), + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5957, + EndPos: 5995, + }, + }, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5966, + EndPos: 5969, + }, + }, + Value: []byte("foo"), + }, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5970, + EndPos: 5978, + }, + }, + ByRef: false, + Variadic: false, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5970, + EndPos: 5975, + }, + }, + Value: []byte("array"), + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5976, + EndPos: 5978, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5976, + EndPos: 5978, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5980, + EndPos: 5991, + }, + }, + Variadic: false, + ByRef: false, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5980, + EndPos: 5988, + }, + }, + Value: []byte("callable"), + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5989, + EndPos: 5991, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5989, + EndPos: 5991, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5998, + EndPos: 6100, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6019, + EndPos: 6022, + }, + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5998, + EndPos: 6006, + }, + }, + Value: []byte("abstract"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6007, + EndPos: 6012, + }, + }, + Value: []byte("final"), + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6025, + EndPos: 6066, + }, + }, + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6060, + EndPos: 6063, + }, + }, + Value: []byte("bar"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6025, + EndPos: 6033, + }, + }, + Value: []byte("abstract"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6034, + EndPos: 6043, + }, + }, + Value: []byte("protected"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6044, + EndPos: 6050, + }, + }, + Value: []byte("static"), + }, + }, + Stmt: &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6065, + EndPos: 6066, + }, + }, + }, + }, + &ast.StmtClassMethod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6067, + EndPos: 6098, + }, + }, + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6090, + EndPos: 6093, + }, + }, + Value: []byte("baz"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6067, + EndPos: 6072, + }, + }, + Value: []byte("final"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6073, + EndPos: 6080, + }, + }, + Value: []byte("private"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6096, + EndPos: 6098, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6105, + EndPos: 6119, + }, + }, + Expr: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6105, + EndPos: 6118, + }, + }, + Var: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6105, + EndPos: 6112, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6109, + EndPos: 6112, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6109, + EndPos: 6112, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6115, + EndPos: 6118, + }, + }, + Value: []byte("bar"), + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6123, + EndPos: 6134, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6123, + EndPos: 6133, + }, + }, + Function: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6123, + EndPos: 6130, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6127, + EndPos: 6130, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6127, + EndPos: 6130, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6131, + EndPos: 6133, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6137, + EndPos: 6149, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6137, + EndPos: 6148, + }, + }, + Function: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6137, + EndPos: 6146, + }, + }, + Var: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6137, + EndPos: 6143, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6138, + EndPos: 6142, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6138, + EndPos: 6142, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6138, + EndPos: 6142, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6144, + EndPos: 6145, + }, + }, + Value: []byte("0"), + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6146, + EndPos: 6148, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6152, + EndPos: 6161, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6152, + EndPos: 6160, + }, + }, + Function: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6152, + EndPos: 6158, + }, + }, + Var: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6152, + EndPos: 6155, + }, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6152, + EndPos: 6155, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6152, + EndPos: 6155, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6156, + EndPos: 6157, + }, + }, + Value: []byte("1"), + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6158, + EndPos: 6160, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6164, + EndPos: 6172, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6164, + EndPos: 6171, + }, + }, + Function: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6164, + EndPos: 6169, + }, + }, + Value: []byte("\"foo\""), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6169, + EndPos: 6171, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6175, + EndPos: 6187, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6175, + EndPos: 6186, + }, + }, + Function: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6175, + EndPos: 6184, + }, + }, + Var: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6175, + EndPos: 6178, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6176, + EndPos: 6177, + }, + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6176, + EndPos: 6177, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + Dim: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6179, + EndPos: 6183, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6179, + EndPos: 6183, + }, + }, + Value: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6184, + EndPos: 6186, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6190, + EndPos: 6199, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6190, + EndPos: 6198, + }, + }, + VarName: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6192, + EndPos: 6197, + }, + }, + Function: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6192, + EndPos: 6195, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6192, + EndPos: 6195, + }, + }, + Value: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6195, + EndPos: 6197, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6203, + EndPos: 6215, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6203, + EndPos: 6214, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6203, + EndPos: 6206, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6203, + EndPos: 6206, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Call: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6208, + EndPos: 6212, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6208, + EndPos: 6212, + }, + }, + Value: []byte("bar"), + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6212, + EndPos: 6214, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6218, + EndPos: 6235, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6218, + EndPos: 6234, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6218, + EndPos: 6221, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6218, + EndPos: 6221, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Call: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6224, + EndPos: 6231, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6224, + EndPos: 6228, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6224, + EndPos: 6228, + }, + }, + Value: []byte("bar"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6229, + EndPos: 6230, + }, + }, + Value: []byte("0"), + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6232, + EndPos: 6234, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6241, + EndPos: 6252, + }, + }, + Expr: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6241, + EndPos: 6251, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6241, + EndPos: 6245, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6241, + EndPos: 6245, + }, + }, + Value: []byte("foo"), + }, + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6247, + EndPos: 6251, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6247, + EndPos: 6251, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6255, + EndPos: 6271, + }, + }, + Expr: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6255, + EndPos: 6269, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6255, + EndPos: 6259, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6255, + EndPos: 6259, + }, + }, + Value: []byte("foo"), + }, + }, + Property: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6262, + EndPos: 6269, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6262, + EndPos: 6266, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6262, + EndPos: 6266, + }, + }, + Value: []byte("bar"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6267, + EndPos: 6268, + }, + }, + Value: []byte("0"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6275, + EndPos: 6297, + }, + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6275, + EndPos: 6296, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6276, + EndPos: 6282, + }, + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6276, + EndPos: 6277, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6279, + EndPos: 6282, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6280, + EndPos: 6282, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6280, + EndPos: 6282, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6284, + EndPos: 6295, + }, + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6284, + EndPos: 6285, + }, + }, + Value: []byte("2"), + }, + Val: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6287, + EndPos: 6295, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6292, + EndPos: 6294, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6292, + EndPos: 6294, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6292, + EndPos: 6294, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + &ast.StmtHaltCompiler{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 348, + EndLine: 348, + StartPos: 6301, + EndPos: 6319, + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestPhp5Strings(t *testing.T) { + src := `> newline => { - lex.addFreeFloating(freefloating.CommentType, lex.ts, lex.te) + lex.addToken(T_COMMENT, lex.ts, lex.te) }; any => { fnext html; @@ -152,12 +150,12 @@ func (lex *Lexer) Lex(lval Lval) int { fbreak; }; ' { - lex.addFreeFloating(freefloating.TokenType, lex.ts, lex.te) + lex.addToken(T_OPEN_TAG, lex.ts, lex.te) fnext php; }; ' { lex.ungetCnt(lex.te - lex.ts - 5) - lex.addFreeFloating(freefloating.TokenType, lex.ts, lex.ts+5) + lex.addToken(T_OPEN_TAG, lex.ts, lex.ts+5) fnext php; }; ' { @@ -169,7 +167,7 @@ func (lex *Lexer) Lex(lval Lval) int { *|; php := |* - whitespace_line* => {lex.addFreeFloating(freefloating.WhiteSpaceType, lex.ts, lex.te)}; + whitespace_line* => {lex.addToken(T_WHITESPACE, lex.ts, lex.te)}; '?>' newline? => {lex.setTokenPosition(token); tok = TokenID(int(';')); fnext html; fbreak;}; ';' whitespace_line* '?>' newline? => {lex.setTokenPosition(token); tok = TokenID(int(';')); fnext html; fbreak;}; @@ -329,17 +327,19 @@ func (lex *Lexer) Lex(lval Lval) int { ('#' | '//') any_line* when is_not_comment_end => { lex.ungetStr("?>") - lex.addFreeFloating(freefloating.CommentType, lex.ts, lex.te) + lex.addToken(T_COMMENT, lex.ts, lex.te) }; '/*' any_line* :>> '*/' { isDocComment := false; if lex.te - lex.ts > 4 && string(lex.data[lex.ts:lex.ts+3]) == "/**" { isDocComment = true; } - lex.addFreeFloating(freefloating.CommentType, lex.ts, lex.te) if isDocComment { lex.PhpDocComment = string(lex.data[lex.ts:lex.te]) + lex.addToken(T_DOC_COMMENT, lex.ts, lex.te) + } else { + lex.addToken(T_COMMENT, lex.ts, lex.te) } }; @@ -388,7 +388,7 @@ func (lex *Lexer) Lex(lval Lval) int { *|; property := |* - whitespace_line* => {lex.addFreeFloating(freefloating.WhiteSpaceType, lex.ts, lex.te)}; + whitespace_line* => {lex.addToken(T_WHITESPACE, lex.ts, lex.te)}; "->" => {lex.setTokenPosition(token); tok = T_OBJECT_OPERATOR; fbreak;}; varname => {lex.setTokenPosition(token); tok = T_STRING; fnext php; fbreak;}; any => {lex.ungetCnt(1); fgoto php;}; @@ -484,32 +484,32 @@ func (lex *Lexer) Lex(lval Lval) int { *|; halt_compiller_open_parenthesis := |* - whitespace_line* => {lex.addFreeFloating(freefloating.WhiteSpaceType, lex.ts, lex.te)}; + whitespace_line* => {lex.addToken(T_WHITESPACE, lex.ts, lex.te)}; "(" => {lex.setTokenPosition(token); tok = TokenID(int('(')); fnext halt_compiller_close_parenthesis; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_close_parenthesis := |* - whitespace_line* => {lex.addFreeFloating(freefloating.WhiteSpaceType, lex.ts, lex.te)}; + whitespace_line* => {lex.addToken(T_WHITESPACE, lex.ts, lex.te)}; ")" => {lex.setTokenPosition(token); tok = TokenID(int(')')); fnext halt_compiller_close_semicolon; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_close_semicolon := |* - whitespace_line* => {lex.addFreeFloating(freefloating.WhiteSpaceType, lex.ts, lex.te)}; + whitespace_line* => {lex.addToken(T_WHITESPACE, lex.ts, lex.te)}; ";" => {lex.setTokenPosition(token); tok = TokenID(int(';')); fnext halt_compiller_end; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_end := |* - any_line* => { lex.addFreeFloating(freefloating.TokenType, lex.ts, lex.te); }; + any_line* => { lex.addToken(T_HALT_COMPILER, lex.ts, lex.te); }; *|; write exec; }%% - token.FreeFloating = lex.FreeFloating - token.Value = string(lex.data[lex.ts:lex.te]) + token.Tokens = lex.Tokens + token.Value = lex.data[lex.ts:lex.te] lval.Token(token) diff --git a/scanner/scanner_test.go b/internal/scanner/scanner_test.go similarity index 76% rename from scanner/scanner_test.go rename to internal/scanner/scanner_test.go index eb496a2..71822c4 100644 --- a/scanner/scanner_test.go +++ b/internal/scanner/scanner_test.go @@ -3,8 +3,7 @@ package scanner import ( "testing" - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/position" + "github.com/z7zmey/php-parser/pkg/token" "gotest.tools/assert" ) @@ -361,7 +360,7 @@ func TestTokens(t *testing.T) { } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -390,15 +389,15 @@ func TestShebang(t *testing.T) { } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} token := lexer.Lex(lv) assert.Equal(t, token, int(T_DNUMBER)) - for _, tt := range lv.Tkn.FreeFloating { - actual = append(actual, tt.Value) + for _, tt := range lv.Tkn.Tokens { + actual = append(actual, string(tt.Value)) } assert.DeepEqual(t, expected, actual) @@ -411,12 +410,12 @@ func TestShebangHtml(t *testing.T) { ` lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} token := lexer.Lex(lv) assert.Equal(t, token, int(T_INLINE_HTML)) - assert.Equal(t, lv.Tkn.FreeFloating[0].Value, "#!/usr/bin/env php\n") + assert.Equal(t, string(lv.Tkn.Tokens[0].Value), "#!/usr/bin/env php\n") token = lexer.Lex(lv) assert.Equal(t, token, int(T_DNUMBER)) @@ -462,7 +461,7 @@ func TestNumberTokens(t *testing.T) { } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -520,7 +519,7 @@ func TestConstantStrings(t *testing.T) { } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -656,7 +655,7 @@ func TestTeplateStringTokens(t *testing.T) { } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -742,7 +741,7 @@ func TestBackquoteStringTokens(t *testing.T) { } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -837,7 +836,7 @@ CAT; } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -911,7 +910,7 @@ CAT } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -951,7 +950,7 @@ CAT; } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -983,7 +982,7 @@ func TestHereDocTokens73(t *testing.T) { } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -1015,7 +1014,7 @@ CAT;` lexer := NewLexer([]byte(src)) lexer.PHPVersion = "7.2" - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -1048,7 +1047,7 @@ func TestInlineHtmlNopTokens(t *testing.T) { } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -1094,7 +1093,7 @@ func TestStringTokensAfterVariable(t *testing.T) { break } - actualTokens = append(actualTokens, lv.Tkn.Value) + actualTokens = append(actualTokens, string(lv.Tkn.Value)) actual = append(actual, TokenID(token).String()) } @@ -1128,7 +1127,7 @@ func TestSlashAfterVariable(t *testing.T) { break } - actualTokens = append(actualTokens, lv.Tkn.Value) + actualTokens = append(actualTokens, string(lv.Tkn.Value)) actual = append(actual, TokenID(token).String()) } @@ -1139,31 +1138,29 @@ func TestSlashAfterVariable(t *testing.T) { func TestCommentEnd(t *testing.T) { src := ` test` - expected := []freefloating.String{ + expected := []token.Token{ { - Value: " bar ( '' ) ;` lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} - expected := []freefloating.String{ + expected := []token.Token{ { - Value: "\n") { - tlen = 3 - } - - phpCloseTag := []freefloating.String{} - 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, 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, - }, - }) - - l.setFreeFloating(htmlNode, freefloating.Start, append(phpCloseTag, (*htmlNode.GetFreeFloating())[freefloating.Start]...)) -} - -func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { - for i := 1; i < len(yyDollar); i++ { - if yyDollar[i].token != nil { - p.Lexer.ReturnTokenToPool(yyDollar[i].token) - } - yyDollar[i].token = nil - } - yyVAL.token = nil -} diff --git a/php7/php7.y b/php7/php7.y deleted file mode 100644 index e6634ff..0000000 --- a/php7/php7.y +++ /dev/null @@ -1,5666 +0,0 @@ -%{ -package php7 - -import ( - "strings" - "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" -) - -%} - -%union{ - node node.Node - token *scanner.Token - list []node.Node - str string - - ClassExtends *stmt.ClassExtends - ClassImplements *stmt.ClassImplements - InterfaceExtends *stmt.InterfaceExtends - ClosureUse *expr.ClosureUse -} - -%type $unk -%token T_INCLUDE -%token T_INCLUDE_ONCE -%token T_EXIT -%token T_IF -%token T_LNUMBER -%token T_DNUMBER -%token T_STRING -%token T_STRING_VARNAME -%token T_VARIABLE -%token T_NUM_STRING -%token T_INLINE_HTML -%token T_CHARACTER -%token T_BAD_CHARACTER -%token T_ENCAPSED_AND_WHITESPACE -%token T_CONSTANT_ENCAPSED_STRING -%token T_ECHO -%token T_DO -%token T_WHILE -%token T_ENDWHILE -%token T_FOR -%token T_ENDFOR -%token T_FOREACH -%token T_ENDFOREACH -%token T_DECLARE -%token T_ENDDECLARE -%token T_AS -%token T_SWITCH -%token T_ENDSWITCH -%token T_CASE -%token T_DEFAULT -%token T_BREAK -%token T_CONTINUE -%token T_GOTO -%token T_FUNCTION -%token T_FN -%token T_CONST -%token T_RETURN -%token T_TRY -%token T_CATCH -%token T_FINALLY -%token T_THROW -%token T_USE -%token T_INSTEADOF -%token T_GLOBAL -%token T_VAR -%token T_UNSET -%token T_ISSET -%token T_EMPTY -%token T_HALT_COMPILER -%token T_CLASS -%token T_TRAIT -%token T_INTERFACE -%token T_EXTENDS -%token T_IMPLEMENTS -%token T_OBJECT_OPERATOR -%token T_DOUBLE_ARROW -%token T_LIST -%token T_ARRAY -%token T_CALLABLE -%token T_CLASS_C -%token T_TRAIT_C -%token T_METHOD_C -%token T_FUNC_C -%token T_LINE -%token T_FILE -%token T_COMMENT -%token T_DOC_COMMENT -%token T_OPEN_TAG -%token T_OPEN_TAG_WITH_ECHO -%token T_CLOSE_TAG -%token T_WHITESPACE -%token T_START_HEREDOC -%token T_END_HEREDOC -%token T_DOLLAR_OPEN_CURLY_BRACES -%token T_CURLY_OPEN -%token T_PAAMAYIM_NEKUDOTAYIM -%token T_NAMESPACE -%token T_NS_C -%token T_DIR -%token T_NS_SEPARATOR -%token T_ELLIPSIS -%token T_EVAL -%token T_REQUIRE -%token T_REQUIRE_ONCE -%token T_LOGICAL_OR -%token T_LOGICAL_XOR -%token T_LOGICAL_AND -%token T_INSTANCEOF -%token T_NEW -%token T_CLONE -%token T_ELSEIF -%token T_ELSE -%token T_ENDIF -%token T_PRINT -%token T_YIELD -%token T_STATIC -%token T_ABSTRACT -%token T_FINAL -%token T_PRIVATE -%token T_PROTECTED -%token T_PUBLIC -%token T_INC -%token T_DEC -%token T_YIELD_FROM -%token T_INT_CAST -%token T_DOUBLE_CAST -%token T_STRING_CAST -%token T_ARRAY_CAST -%token T_OBJECT_CAST -%token T_BOOL_CAST -%token T_UNSET_CAST -%token T_COALESCE -%token T_SPACESHIP -%token T_NOELSE -%token T_PLUS_EQUAL -%token T_MINUS_EQUAL -%token T_MUL_EQUAL -%token T_POW_EQUAL -%token T_DIV_EQUAL -%token T_CONCAT_EQUAL -%token T_MOD_EQUAL -%token T_AND_EQUAL -%token T_OR_EQUAL -%token T_XOR_EQUAL -%token T_SL_EQUAL -%token T_SR_EQUAL -%token T_COALESCE_EQUAL -%token T_BOOLEAN_OR -%token T_BOOLEAN_AND -%token T_POW -%token T_SL -%token T_SR -%token T_IS_IDENTICAL -%token T_IS_NOT_IDENTICAL -%token T_IS_EQUAL -%token T_IS_NOT_EQUAL -%token T_IS_SMALLER_OR_EQUAL -%token T_IS_GREATER_OR_EQUAL -%token '"' -%token '`' -%token '{' -%token '}' -%token ';' -%token ':' -%token '(' -%token ')' -%token '[' -%token ']' -%token '?' -%token '&' -%token '-' -%token '+' -%token '!' -%token '~' -%token '@' -%token '$' -%token ',' -%token '|' -%token '=' -%token '^' -%token '*' -%token '/' -%token '%' -%token '<' -%token '>' -%token '.' - -%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE -%left ',' -%left T_LOGICAL_OR -%left T_LOGICAL_XOR -%left T_LOGICAL_AND -%right T_PRINT -%right T_YIELD -%right T_DOUBLE_ARROW -%right T_YIELD_FROM -%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL T_POW_EQUAL T_COALESCE_EQUAL -%left '?' ':' -%right T_COALESCE -%left T_BOOLEAN_OR -%left T_BOOLEAN_AND -%left '|' -%left '^' -%left '&' -%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL T_SPACESHIP -%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL -%left T_SL T_SR -%left '+' '-' '.' -%left '*' '/' '%' -%right '!' -%nonassoc T_INSTANCEOF -%right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@' -%right T_POW -%right '[' -%nonassoc T_NEW T_CLONE -%left T_NOELSE -%left T_ELSEIF -%left T_ELSE -%left T_ENDIF -%right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC - -%type is_reference is_variadic returns_ref - -%type reserved_non_modifiers -%type semi_reserved -%type identifier -%type possible_comma -%type case_separator - -%type top_statement name statement function_declaration_statement -%type class_declaration_statement trait_declaration_statement -%type interface_declaration_statement -%type group_use_declaration inline_use_declaration -%type mixed_group_use_declaration use_declaration unprefixed_use_declaration -%type const_decl inner_statement -%type expr optional_expr -%type declare_statement finally_statement unset_variable variable -%type parameter optional_type argument expr_without_variable global_var -%type static_var class_statement trait_adaptation trait_precedence trait_alias -%type absolute_trait_method_reference trait_method_reference property echo_expr -%type new_expr anonymous_class class_name class_name_reference simple_variable -%type internal_functions_in_yacc -%type exit_expr scalar lexical_var function_call member_name property_name -%type variable_class_name dereferencable_scalar constant dereferencable -%type callable_expr callable_variable static_member new_variable -%type encaps_var encaps_var_offset -%type if_stmt -%type alt_if_stmt -%type if_stmt_without_else -%type class_const_decl -%type alt_if_stmt_without_else -%type array_pair possible_array_pair -%type isset_variable type return_type type_expr -%type class_modifier -%type argument_list ctor_arguments -%type trait_adaptations -%type switch_case_list -%type method_body -%type foreach_statement for_statement while_statement -%type inline_function -%type extends_from -%type implements_list -%type interface_extends_list -%type lexical_vars - -%type member_modifier -%type use_type -%type foreach_variable - - -%type encaps_list backticks_expr namespace_name catch_name_list catch_list class_const_list -%type const_list echo_expr_list for_exprs non_empty_for_exprs global_var_list -%type unprefixed_use_declarations inline_use_declarations property_list static_var_list -%type case_list trait_adaptation_list unset_variables -%type use_declarations lexical_var_list isset_variables non_empty_array_pair_list -%type array_pair_list non_empty_argument_list top_statement_list -%type inner_statement_list parameter_list non_empty_parameter_list class_statement_list -%type method_modifiers variable_modifiers -%type non_empty_member_modifiers name_list class_modifiers - -%type backup_doc_comment - -%% - -///////////////////////////////////////////////////////////////////////// - -start: - top_statement_list - { - yylex.(*Parser).rootNode = node.NewRoot($1) - - // save position - yylex.(*Parser).rootNode.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - - yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, freefloating.End, yylex.(*Parser).currentToken.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -reserved_non_modifiers: - T_INCLUDE {$$=$1} | T_INCLUDE_ONCE {$$=$1} | T_EVAL {$$=$1} | T_REQUIRE {$$=$1} | T_REQUIRE_ONCE {$$=$1} | T_LOGICAL_OR {$$=$1} | T_LOGICAL_XOR {$$=$1} | T_LOGICAL_AND {$$=$1} - | T_INSTANCEOF {$$=$1} | T_NEW {$$=$1} | T_CLONE {$$=$1} | T_EXIT {$$=$1} | T_IF {$$=$1} | T_ELSEIF {$$=$1} | T_ELSE {$$=$1} | T_ENDIF {$$=$1} | T_ECHO {$$=$1} | T_DO {$$=$1} | T_WHILE {$$=$1} | T_ENDWHILE {$$=$1} - | T_FOR {$$=$1} | T_ENDFOR {$$=$1} | T_FOREACH {$$=$1} | T_ENDFOREACH {$$=$1} | T_DECLARE {$$=$1} | T_ENDDECLARE {$$=$1} | T_AS {$$=$1} | T_TRY {$$=$1} | T_CATCH {$$=$1} | T_FINALLY {$$=$1} - | T_THROW {$$=$1} | T_USE {$$=$1} | T_INSTEADOF {$$=$1} | T_GLOBAL {$$=$1} | T_VAR {$$=$1} | T_UNSET {$$=$1} | T_ISSET {$$=$1} | T_EMPTY {$$=$1} | T_CONTINUE {$$=$1} | T_GOTO {$$=$1} - | T_FUNCTION {$$=$1} | T_CONST {$$=$1} | T_RETURN {$$=$1} | T_PRINT {$$=$1} | T_YIELD {$$=$1} | T_LIST {$$=$1} | T_SWITCH {$$=$1} | T_ENDSWITCH {$$=$1} | T_CASE {$$=$1} | T_DEFAULT {$$=$1} | T_BREAK {$$=$1} - | T_ARRAY {$$=$1} | T_CALLABLE {$$=$1} | T_EXTENDS {$$=$1} | T_IMPLEMENTS {$$=$1} | T_NAMESPACE {$$=$1} | T_TRAIT {$$=$1} | T_INTERFACE {$$=$1} | T_CLASS {$$=$1} - | T_CLASS_C {$$=$1} | T_TRAIT_C {$$=$1} | T_FUNC_C {$$=$1} | T_METHOD_C {$$=$1} | T_LINE {$$=$1} | T_FILE {$$=$1} | T_DIR {$$=$1} | T_NS_C {$$=$1} | T_FN {$$=$1} -; - -semi_reserved: - reserved_non_modifiers - { - $$ = $1 - } - | T_STATIC {$$=$1} | T_ABSTRACT {$$=$1} | T_FINAL {$$=$1} | T_PRIVATE {$$=$1} | T_PROTECTED {$$=$1} | T_PUBLIC {$$=$1} -; - -identifier: - T_STRING - { - $$ = $1 - } - | semi_reserved - { - $$ = $1 - } -; - -top_statement_list: - top_statement_list top_statement - { - if inlineHtmlNode, ok := $2.(*stmt.InlineHtml); ok && len($1) > 0 { - prevNode := lastNode($1) - yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) - } - - if $2 != nil { - $$ = append($1, $2) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | /* empty */ - { - $$ = []node.Node{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -namespace_name: - T_STRING - { - namePart := name.NewNamePart($1.Value) - $$ = []node.Node{namePart} - - // save position - namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating(namePart, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | namespace_name T_NS_SEPARATOR T_STRING - { - namePart := name.NewNamePart($3.Value) - $$ = append($1, namePart) - - // save position - namePart.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } -; - -name: - namespace_name - { - $$ = name.NewName($1) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NAMESPACE T_NS_SEPARATOR namespace_name - { - $$ = name.NewRelative($3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Namespace, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NS_SEPARATOR namespace_name - { - $$ = name.NewFullyQualified($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -top_statement: - error - { - // error - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | function_declaration_statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | class_declaration_statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | trait_declaration_statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | interface_declaration_statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_HALT_COMPILER '(' ')' ';' - { - $$ = stmt.NewHaltCompiler() - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NAMESPACE namespace_name ';' - { - name := name.NewName($2) - $$ = stmt.NewNamespace(name, nil) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - 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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NAMESPACE namespace_name '{' top_statement_list '}' - { - name := name.NewName($2) - $$ = stmt.NewNamespace(name, $4) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $5.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NAMESPACE '{' top_statement_list '}' - { - $$ = stmt.NewNamespace(nil, $3) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_USE mixed_group_use_declaration ';' - { - $$ = $2 - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_USE use_type group_use_declaration ';' - { - $$ = $3.(*stmt.GroupUse).SetUseType($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_USE use_declarations ';' - { - $$ = stmt.NewUseList(nil, $2) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_USE use_type use_declarations ';' - { - $$ = stmt.NewUseList($2, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CONST const_list ';' - { - $$ = stmt.NewConstList($2) - - // save position - $$.SetPosition(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($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -use_type: - T_FUNCTION - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CONST - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -group_use_declaration: - namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' - { - name := name.NewName($1) - $$ = stmt.NewGroupUse(nil, name, $4) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, $3.FreeFloating) - if $5 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, append($5.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($5), $6.FreeFloating...)...)) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $6.FreeFloating) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' - { - name := name.NewName($2) - $$ = stmt.NewGroupUse(nil, name, $5) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.UseType, $1.FreeFloating) - yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, $4.FreeFloating) - if $6 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, append($6.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($6), $7.FreeFloating...)...)) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $7.FreeFloating) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -mixed_group_use_declaration: - namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' - { - name := name.NewName($1) - $$ = stmt.NewGroupUse(nil, name, $4) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, $3.FreeFloating) - if $5 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, append($5.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($5), $6.FreeFloating...)...)) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $6.FreeFloating) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' - { - name := name.NewName($2) - $$ = stmt.NewGroupUse(nil, name, $5) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Use, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, $4.FreeFloating) - if $6 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, append($6.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($6), $7.FreeFloating...)...)) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $7.FreeFloating) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -possible_comma: - /* empty */ - { - $$ = nil - } - | ',' - { - $$ = $1 - } -; - -inline_use_declarations: - inline_use_declarations ',' inline_use_declaration - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | inline_use_declaration - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -unprefixed_use_declarations: - unprefixed_use_declarations ',' unprefixed_use_declaration - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | unprefixed_use_declaration - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -use_declarations: - use_declarations ',' use_declaration - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | use_declaration - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -inline_use_declaration: - unprefixed_use_declaration - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | use_type unprefixed_use_declaration - { - $$ = $2.(*stmt.Use).SetUseType($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -unprefixed_use_declaration: - namespace_name - { - name := name.NewName($1) - $$ = stmt.NewUse(nil, name, nil) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], name) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | namespace_name T_AS T_STRING - { - name := name.NewName($1) - alias := node.NewIdentifier($3.Value) - $$ = stmt.NewUse(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)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -use_declaration: - unprefixed_use_declaration - { - $$ = $1 - - // save coments - yylex.(*Parser).MoveFreeFloating($1.(*stmt.Use).Use, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NS_SEPARATOR unprefixed_use_declaration - { - $$ = $2; - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) - - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -const_list: - const_list ',' const_decl - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | const_decl - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -inner_statement_list: - inner_statement_list inner_statement - { - if inlineHtmlNode, ok := $2.(*stmt.InlineHtml); ok && len($1) > 0 { - prevNode := lastNode($1) - yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) - } - - if $2 != nil { - $$ = append($1, $2) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | /* empty */ - { - $$ = []node.Node{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -inner_statement: - error - { - // error - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | function_declaration_statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | class_declaration_statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | trait_declaration_statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | interface_declaration_statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_HALT_COMPILER '(' ')' ';' - { - $$ = stmt.NewHaltCompiler() - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - -statement: - '{' inner_statement_list '}' - { - $$ = stmt.NewStmtList($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | if_stmt - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | alt_if_stmt - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_WHILE '(' expr ')' while_statement - { - switch n := $5.(type) { - case *stmt.While : - n.Cond = $3 - case *stmt.AltWhile : - n.Cond = $3 - } - - $$ = $5 - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.While, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_DO statement T_WHILE '(' expr ')' ';' - { - $$ = stmt.NewDo($2, $5) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.While, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $7.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($7)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement - { - switch n := $9.(type) { - case *stmt.For : - n.Init = $3 - n.Cond = $5 - n.Loop = $7 - case *stmt.AltFor : - n.Init = $3 - n.Cond = $5 - n.Loop = $7 - } - - $$ = $9 - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_SWITCH '(' expr ')' switch_case_list - { - switch n := $5.(type) { - case *stmt.Switch: - n.Cond = $3 - case *stmt.AltSwitch: - n.Cond = $3 - default: - panic("unexpected node type") - } - - $$ = $5 - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Switch, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_BREAK optional_expr ';' - { - $$ = stmt.NewBreak($2) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CONTINUE optional_expr ';' - { - $$ = stmt.NewContinue($2) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_RETURN optional_expr ';' - { - $$ = stmt.NewReturn($2) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_GLOBAL global_var_list ';' - { - $$ = stmt.NewGlobal($2) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_STATIC static_var_list ';' - { - $$ = stmt.NewStatic($2) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_ECHO echo_expr_list ';' - { - $$ = stmt.NewEcho($2) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_INLINE_HTML - { - $$ = stmt.NewInlineHtml($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr ';' - { - $$ = stmt.NewExpression($1) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_UNSET '(' unset_variables possible_comma ')' ';' - { - $$ = stmt.NewUnset($3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Unset, $2.FreeFloating) - if $4 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, append($4.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($4), $5.FreeFloating...)...)) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $5.FreeFloating) - } - yylex.(*Parser).setFreeFloating($$, freefloating.CloseParenthesisToken, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($6)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement - { - switch n := $7.(type) { - case *stmt.Foreach : - n.Expr = $3 - n.Variable = $5 - case *stmt.AltForeach : - n.Expr = $3 - n.Variable = $5 - } - - $$ = $7 - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7)) - - // 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($$, freefloating.Var, $6.FreeFloating) - - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement - { - switch n := $9.(type) { - case *stmt.Foreach : - n.Expr = $3 - n.Key = $5 - n.Variable = $7 - case *stmt.AltForeach : - n.Expr = $3 - n.Key = $5 - n.Variable = $7 - } - - $$ = $9 - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) - - // 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($$, freefloating.Key, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $8.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_DECLARE '(' const_list ')' declare_statement - { - $$ = $5 - $$.(*stmt.Declare).Consts = $3 - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | ';' - { - $$ = stmt.NewNop() - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_TRY '{' inner_statement_list '}' catch_list finally_statement - { - if $6 == nil { - $$ = stmt.NewTry($3, $5, $6) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $5)) - } else { - $$ = stmt.NewTry($3, $5, $6) - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_THROW expr ';' - { - $$ = stmt.NewThrow($2) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_GOTO T_STRING ';' - { - label := node.NewIdentifier($2.Value) - $$ = stmt.NewGoto(label) - - // save position - label.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_STRING ':' - { - label := node.NewIdentifier($1.Value) - $$ = stmt.NewLabel(label) - - // save position - label.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Label, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - -catch_list: - /* empty */ - { - $$ = []node.Node{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | catch_list T_CATCH '(' catch_name_list T_VARIABLE ')' '{' inner_statement_list '}' - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($5.Value, isDollar)) - variable := expr.NewVariable(identifier) - catch := stmt.NewCatch($4, variable, $8) - $$ = append($1, catch) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($5)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($5)) - catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($2, $9)) - - // save comments - yylex.(*Parser).setFreeFloating(catch, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(catch, freefloating.Catch, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $5.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(catch, freefloating.Var, $6.FreeFloating) - yylex.(*Parser).setFreeFloating(catch, freefloating.Cond, $7.FreeFloating) - yylex.(*Parser).setFreeFloating(catch, freefloating.Stmts, $9.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; -catch_name_list: - name - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | catch_name_list '|' name - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -finally_statement: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FINALLY '{' inner_statement_list '}' - { - $$ = stmt.NewFinally($3) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } -; - -unset_variables: - unset_variable - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | unset_variables ',' unset_variable - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -unset_variable: - variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -function_declaration_statement: - T_FUNCTION returns_ref T_STRING backup_doc_comment '(' parameter_list ')' return_type '{' inner_statement_list '}' - { - name := node.NewIdentifier($3.Value) - $$ = stmt.NewFunction(name, $2 != nil, $6, $8, $10, $4) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) - - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - if $2 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $3.FreeFloating) - } else { - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $3.FreeFloating) - } - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ParamList, $7.FreeFloating) - if $8 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$8.GetFreeFloating())[freefloating.Colon]); delete((*$8.GetFreeFloating()), freefloating.Colon) - } - yylex.(*Parser).setFreeFloating($$, freefloating.ReturnType, $9.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $11.FreeFloating) - - // normalize - if $8 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$$.GetFreeFloating())[freefloating.ReturnType]); delete((*$$.GetFreeFloating()), freefloating.ReturnType) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -is_reference: - /* empty */ - { - $$ = nil - } - | '&' - { - $$ = $1 - } -; - -is_variadic: - /* empty */ - { - $$ = nil - } - | T_ELLIPSIS - { - $$ = $1 - } -; - -class_declaration_statement: - class_modifiers T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' - { - name := node.NewIdentifier($3.Value) - $$ = stmt.NewClass(name, $1, nil, $4, $5, $8, $6) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $9)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $7.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $9.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' - { - name := node.NewIdentifier($2.Value) - $$ = stmt.NewClass(name, nil, nil, $3, $4, $7, $5) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $8.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -class_modifiers: - class_modifier - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | class_modifiers class_modifier - { - $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -class_modifier: - T_ABSTRACT - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FINAL - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -trait_declaration_statement: - T_TRAIT T_STRING backup_doc_comment '{' class_statement_list '}' - { - name := node.NewIdentifier($2.Value) - $$ = stmt.NewTrait(name, $5, $3) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } -; - -interface_declaration_statement: - T_INTERFACE T_STRING interface_extends_list backup_doc_comment '{' class_statement_list '}' - { - name := node.NewIdentifier($2.Value) - $$ = stmt.NewInterface(name, $3, $6, $4) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $7.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -extends_from: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_EXTENDS name - { - $$ = stmt.NewClassExtends($2); - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -interface_extends_list: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_EXTENDS name_list - { - $$ = stmt.NewInterfaceExtends($2); - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -implements_list: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_IMPLEMENTS name_list - { - $$ = stmt.NewClassImplements($2); - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -foreach_variable: - variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '&' variable - { - $$ = expr.NewReference($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_LIST '(' array_pair_list ')' - { - $$ = expr.NewList($3) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | '[' array_pair_list ']' - { - $$ = expr.NewShortList($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save commentsc - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -for_statement: - statement - { - $$ = stmt.NewFor(nil, nil, nil, $1) - - // save position - $$.SetPosition(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) - - // save position - stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } -; - -foreach_statement: - statement - { - $$ = stmt.NewForeach(nil, nil, nil, $1) - - // save position - $$.SetPosition(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) - - // save position - stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } -; - -declare_statement: - statement - { - $$ = stmt.NewDeclare(nil, $1, false) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | ':' inner_statement_list T_ENDDECLARE ';' - { - stmtList := stmt.NewStmtList($2) - $$ = stmt.NewDeclare(nil, stmtList, true) - - // save position - stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } -; - -switch_case_list: - '{' case_list '}' - { - caseList := stmt.NewCaseList($2) - $$ = stmt.NewSwitch(nil, caseList) - - // save position - caseList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | '{' ';' case_list '}' - { - caseList := stmt.NewCaseList($3) - $$ = stmt.NewSwitch(nil, caseList) - - // save position - caseList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | ':' case_list T_ENDSWITCH ';' - { - caseList := stmt.NewCaseList($2) - $$ = stmt.NewAltSwitch(nil, caseList) - - // save position - caseList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | ':' ';' case_list T_ENDSWITCH ';' - { - - caseList := stmt.NewCaseList($3) - $$ = stmt.NewAltSwitch(nil, caseList) - - // save position - caseList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($3)) - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } -; - -case_list: - /* empty */ - { - $$ = []node.Node{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | case_list T_CASE expr case_separator inner_statement_list - { - _case := stmt.NewCase($3, $5) - $$ = append($1, _case) - - // save position - _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) - - // save comments - yylex.(*Parser).setFreeFloating(_case, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(_case, freefloating.Expr, append($4.FreeFloating)) - yylex.(*Parser).setFreeFloating(_case, freefloating.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($4)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | case_list T_DEFAULT case_separator inner_statement_list - { - _default := stmt.NewDefault($4) - $$ = append($1, _default) - - // save position - _default.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } -; - -case_separator: - ':' - { - $$ = $1 - } - | ';' - { - $$ = $1 - } -; - -while_statement: - statement - { - $$ = stmt.NewWhile(nil, $1) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | ':' inner_statement_list T_ENDWHILE ';' - { - stmtList := stmt.NewStmtList($2) - $$ = stmt.NewAltWhile(nil, stmtList) - - // save position - stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } -; - -if_stmt_without_else: - T_IF '(' expr ')' statement - { - $$ = stmt.NewIf($3, $5, nil, nil) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.If, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | if_stmt_without_else T_ELSEIF '(' expr ')' statement - { - _elseIf := stmt.NewElseIf($4, $6) - $$ = $1.(*stmt.If).AddElseIf(_elseIf) - - // save position - _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) - - // save comments - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.ElseIf, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Expr, $5.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -if_stmt: - if_stmt_without_else %prec T_NOELSE - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | if_stmt_without_else T_ELSE statement - { - _else := stmt.NewElse($3) - $$ = $1.(*stmt.If).SetElse(_else) - - // save position - _else.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating(_else, freefloating.Start, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -alt_if_stmt_without_else: - T_IF '(' expr ')' ':' inner_statement_list - { - stmts := stmt.NewStmtList($6) - $$ = stmt.NewAltIf($3, stmts, nil, nil) - - // save position - stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($6)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $6)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.If, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $5.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | alt_if_stmt_without_else T_ELSEIF '(' expr ')' ':' inner_statement_list - { - stmts := stmt.NewStmtList($7) - _elseIf := stmt.NewAltElseIf($4, stmts) - $$ = $1.(*stmt.AltIf).AddElseIf(_elseIf) - - // save position - stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($7)) - _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $7)) - - // save comments - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.ElseIf, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Expr, $5.FreeFloating) - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Cond, $6.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -alt_if_stmt: - alt_if_stmt_without_else T_ENDIF ';' - { - $$ = $1 - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';' - { - stmts := stmt.NewStmtList($4) - _else := stmt.NewAltElse(stmts) - $$ = $1.(*stmt.AltIf).SetElse(_else) - - // save position - stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($4)) - _else.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) - - // save comments - yylex.(*Parser).setFreeFloating(_else, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(_else, freefloating.Else, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($6)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -parameter_list: - non_empty_parameter_list - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -non_empty_parameter_list: - parameter - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | non_empty_parameter_list ',' parameter - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -parameter: - optional_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) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - if $1 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - } else if $2 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($2, $4)) - } else if $3 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) - } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - } - - // save comments - if $1 != nil { - yylex.(*Parser).MoveFreeFloating($1, $$) - } - if $2 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, $2.FreeFloating) - } - if $3 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $3.FreeFloating) - } - yylex.(*Parser).setFreeFloating($$, freefloating.Variadic, $4.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - - // normalize - if $3 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, (*$$.GetFreeFloating())[freefloating.Variadic]); delete((*$$.GetFreeFloating()), freefloating.Variadic) - } - if $2 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, (*$$.GetFreeFloating())[freefloating.Ampersand]); delete((*$$.GetFreeFloating()), freefloating.Ampersand) - } - if $1 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Start, (*$$.GetFreeFloating())[freefloating.OptionalType]); delete((*$$.GetFreeFloating()), freefloating.OptionalType) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | optional_type is_reference is_variadic T_VARIABLE '=' expr - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($4.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = node.NewParameter($1, variable, $6, $2 != nil, $3 != nil) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - if $1 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) - } else if $2 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6)) - } else if $3 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $6)) - } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) - } - - // save comments - if $1 != nil { - yylex.(*Parser).MoveFreeFloating($1, $$) - } - if $2 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, $2.FreeFloating) - } - if $3 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $3.FreeFloating) - } - yylex.(*Parser).setFreeFloating($$, freefloating.Variadic, $4.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $5.FreeFloating) - - // normalize - if $3 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, (*$$.GetFreeFloating())[freefloating.Variadic]); delete((*$$.GetFreeFloating()), freefloating.Variadic) - } - if $2 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, (*$$.GetFreeFloating())[freefloating.Ampersand]); delete((*$$.GetFreeFloating()), freefloating.Ampersand) - } - if $1 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Start, (*$$.GetFreeFloating())[freefloating.OptionalType]); delete((*$$.GetFreeFloating()), freefloating.OptionalType) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -optional_type: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | type_expr - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -type_expr: - type - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '?' type - { - $$ = node.NewNullable($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -type: - T_ARRAY - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CALLABLE - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | name - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -return_type: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | ':' type_expr - { - $$ = $2; - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Colon, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -argument_list: - '(' ')' - { - $$ = node.NewArgumentList(nil) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '(' non_empty_argument_list possible_comma ')' - { - $$ = node.NewArgumentList($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - if $3 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, append($3.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($3), $4.FreeFloating...)...)) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, $4.FreeFloating) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -non_empty_argument_list: - argument - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | non_empty_argument_list ',' argument - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -argument: - expr - { - $$ = node.NewArgument($1, false, false) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_ELLIPSIS expr - { - $$ = node.NewArgument($2, true, false) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -global_var_list: - global_var_list ',' global_var - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | global_var - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -global_var: - simple_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -static_var_list: - static_var_list ',' static_var - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | static_var - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -static_var: - T_VARIABLE - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = stmt.NewStaticVar(variable, nil) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_VARIABLE '=' expr - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = stmt.NewStaticVar(variable, $3) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -class_statement_list: - class_statement_list class_statement - { - $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | /* empty */ - { - $$ = []node.Node{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -class_statement: - variable_modifiers optional_type property_list ';' - { - $$ = stmt.NewPropertyList($1, $2, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, freefloating.PropertyList, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | method_modifiers T_CONST class_const_list ';' - { - $$ = stmt.NewClassConstList($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $4)) - - // save comments - if len($1) > 0 { - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $2.FreeFloating) - } - yylex.(*Parser).setFreeFloating($$, freefloating.ConstList, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_USE name_list trait_adaptations - { - $$ = stmt.NewTraitUse($2, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | method_modifiers T_FUNCTION returns_ref identifier backup_doc_comment '(' parameter_list ')' return_type method_body - { - name := node.NewIdentifier($4.Value) - $$ = stmt.NewClassMethod(name, $1, $3 != nil, $7, $9, $10, $5) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - if $1 == nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $10)) - } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListNodePosition($1, $10)) - } - - // save comments - if len($1) > 0 { - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $2.FreeFloating) - } - if $3 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $4.FreeFloating) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $4.FreeFloating) - } - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $8.FreeFloating) - if $9 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$9.GetFreeFloating())[freefloating.Colon]); delete((*$9.GetFreeFloating()), freefloating.Colon) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -name_list: - name - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | name_list ',' name - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -trait_adaptations: - ';' - { - $$ = stmt.NewNop() - - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | '{' '}' - { - $$ = stmt.NewTraitAdaptationList(nil) - - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AdaptationList, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '{' trait_adaptation_list '}' - { - $$ = stmt.NewTraitAdaptationList($2) - - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AdaptationList, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -trait_adaptation_list: - trait_adaptation - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | trait_adaptation_list trait_adaptation - { - $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -trait_adaptation: - trait_precedence ';' - { - $$ = $1; - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.NameList, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | trait_alias ';' - { - $$ = $1; - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Alias, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -trait_precedence: - absolute_trait_method_reference T_INSTEADOF name_list - { - $$ = stmt.NewTraitUsePrecedence($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -trait_alias: - trait_method_reference T_AS T_STRING - { - alias := node.NewIdentifier($3.Value) - $$ = stmt.NewTraitUseAlias($1, nil, alias) - - // save position - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | trait_method_reference T_AS reserved_non_modifiers - { - alias := node.NewIdentifier($3.Value) - $$ = stmt.NewTraitUseAlias($1, nil, alias) - - // save position - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | trait_method_reference T_AS member_modifier identifier - { - alias := node.NewIdentifier($4.Value) - $$ = stmt.NewTraitUseAlias($1, $3, alias) - - // save position - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | trait_method_reference T_AS member_modifier - { - $$ = stmt.NewTraitUseAlias($1, $3, nil) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -trait_method_reference: - identifier - { - name := node.NewIdentifier($1.Value) - $$ = stmt.NewTraitMethodRef(nil, name) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | absolute_trait_method_reference - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -absolute_trait_method_reference: - name T_PAAMAYIM_NEKUDOTAYIM identifier - { - target := node.NewIdentifier($3.Value) - $$ = stmt.NewTraitMethodRef($1, target) - - // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } -; - -method_body: - ';' /* abstract method */ - { - $$ = stmt.NewNop() - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | '{' inner_statement_list '}' - { - $$ = stmt.NewStmtList($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -variable_modifiers: - non_empty_member_modifiers - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_VAR - { - modifier := node.NewIdentifier($1.Value) - $$ = []node.Node{modifier} - - // save position - modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating(modifier, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -method_modifiers: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | non_empty_member_modifiers - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -non_empty_member_modifiers: - member_modifier - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | non_empty_member_modifiers member_modifier - { - $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -member_modifier: - T_PUBLIC - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_PROTECTED - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_PRIVATE - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_STATIC - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_ABSTRACT - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FINAL - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -property_list: - property_list ',' property - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | property - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -property: - T_VARIABLE backup_doc_comment - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = stmt.NewProperty(variable, nil, $2) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_VARIABLE '=' expr backup_doc_comment - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = stmt.NewProperty(variable, $3, $4) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -class_const_list: - class_const_list ',' class_const_decl - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | class_const_decl - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -class_const_decl: - identifier '=' expr backup_doc_comment - { - name := node.NewIdentifier($1.Value) - $$ = stmt.NewConstant(name, $3, $4) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -const_decl: - T_STRING '=' expr backup_doc_comment - { - name := node.NewIdentifier($1.Value) - $$ = stmt.NewConstant(name, $3, $4) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -echo_expr_list: - echo_expr_list ',' echo_expr - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | echo_expr - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -echo_expr: - expr - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -for_exprs: - /* empty */ - { - $$ = nil; - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | non_empty_for_exprs - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -non_empty_for_exprs: - non_empty_for_exprs ',' expr - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -anonymous_class: - T_CLASS ctor_arguments extends_from implements_list backup_doc_comment '{' class_statement_list '}' - { - if $2 != nil { - $$ = stmt.NewClass(nil, nil, $2.(*node.ArgumentList), $3, $4, $7, $5) - } else { - $$ = stmt.NewClass(nil, nil, nil, $3, $4, $7, $5) - } - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $8.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -new_expr: - T_NEW class_name_reference ctor_arguments - { - if $3 != nil { - $$ = expr.NewNew($2, $3.(*node.ArgumentList)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - } else { - $$ = expr.NewNew($2, nil) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - } - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NEW anonymous_class - { - $$ = expr.NewNew($2, nil) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -expr_without_variable: - T_LIST '(' array_pair_list ')' '=' expr - { - listNode := expr.NewList($3) - $$ = assign.NewAssign(listNode, $6) - - // save position - listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | '[' array_pair_list ']' '=' expr - { - shortList := expr.NewShortList($2) - $$ = assign.NewAssign(shortList, $5) - - // save position - shortList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(shortList, freefloating.ArrayPairList, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable '=' expr - { - $$ = assign.NewAssign($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable '=' '&' expr - { - $$ = assign.NewReference($1, $4) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CLONE expr - { - $$ = expr.NewClone($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_PLUS_EQUAL expr - { - $$ = assign.NewPlus($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_MINUS_EQUAL expr - { - $$ = assign.NewMinus($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_MUL_EQUAL expr - { - $$ = assign.NewMul($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_POW_EQUAL expr - { - $$ = assign.NewPow($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_DIV_EQUAL expr - { - $$ = assign.NewDiv($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_CONCAT_EQUAL expr - { - $$ = assign.NewConcat($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_MOD_EQUAL expr - { - $$ = assign.NewMod($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_AND_EQUAL expr - { - $$ = assign.NewBitwiseAnd($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_OR_EQUAL expr - { - $$ = assign.NewBitwiseOr($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_XOR_EQUAL expr - { - $$ = assign.NewBitwiseXor($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_SL_EQUAL expr - { - $$ = assign.NewShiftLeft($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_SR_EQUAL expr - { - $$ = assign.NewShiftRight($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_COALESCE_EQUAL expr - { - $$ = assign.NewCoalesce($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_INC - { - $$ = expr.NewPostInc($1) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_INC variable - { - $$ = expr.NewPreInc($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_DEC - { - $$ = expr.NewPostDec($1) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_DEC variable - { - $$ = expr.NewPreDec($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_BOOLEAN_OR expr - { - $$ = binary.NewBooleanOr($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_BOOLEAN_AND expr - { - $$ = binary.NewBooleanAnd($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_LOGICAL_OR expr - { - $$ = binary.NewLogicalOr($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_LOGICAL_AND expr - { - $$ = binary.NewLogicalAnd($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_LOGICAL_XOR expr - { - $$ = binary.NewLogicalXor($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '|' expr - { - $$ = binary.NewBitwiseOr($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '&' expr - { - $$ = binary.NewBitwiseAnd($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '^' expr - { - $$ = binary.NewBitwiseXor($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '.' expr - { - $$ = binary.NewConcat($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '+' expr - { - $$ = binary.NewPlus($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '-' expr - { - $$ = binary.NewMinus($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '*' expr - { - $$ = binary.NewMul($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_POW expr - { - $$ = binary.NewPow($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '/' expr - { - $$ = binary.NewDiv($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '%' expr - { - $$ = binary.NewMod($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_SL expr - { - $$ = binary.NewShiftLeft($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_SR expr - { - $$ = binary.NewShiftRight($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '+' expr %prec T_INC - { - $$ = expr.NewUnaryPlus($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '-' expr %prec T_INC - { - $$ = expr.NewUnaryMinus($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '!' expr - { - $$ = expr.NewBooleanNot($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '~' expr - { - $$ = expr.NewBitwiseNot($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_IS_IDENTICAL expr - { - $$ = binary.NewIdentical($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_IS_NOT_IDENTICAL expr - { - $$ = binary.NewNotIdentical($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_IS_EQUAL expr - { - $$ = binary.NewEqual($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_IS_NOT_EQUAL expr - { - $$ = binary.NewNotEqual($1, $3) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '<' expr - { - $$ = binary.NewSmaller($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_IS_SMALLER_OR_EQUAL expr - { - $$ = binary.NewSmallerOrEqual($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '>' expr - { - $$ = binary.NewGreater($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_IS_GREATER_OR_EQUAL expr - { - $$ = binary.NewGreaterOrEqual($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_SPACESHIP expr - { - $$ = binary.NewSpaceship($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_INSTANCEOF class_name_reference - { - $$ = expr.NewInstanceOf($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '(' expr ')' - { - $$ = $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).returnTokenToPool(yyDollar, &yyVAL) - } - | new_expr - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '?' expr ':' expr - { - $$ = expr.NewTernary($1, $3, $5) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '?' ':' expr - { - $$ = expr.NewTernary($1, nil, $4) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_COALESCE expr - { - $$ = binary.NewCoalesce($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | internal_functions_in_yacc - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_INT_CAST expr - { - $$ = cast.NewInt($2) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_DOUBLE_CAST expr - { - $$ = cast.NewDouble($2) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_STRING_CAST expr - { - $$ = cast.NewString($2) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_ARRAY_CAST expr - { - $$ = cast.NewArray($2) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_OBJECT_CAST expr - { - $$ = cast.NewObject($2) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_BOOL_CAST expr - { - $$ = cast.NewBool($2) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_UNSET_CAST expr - { - $$ = cast.NewUnset($2) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_EXIT exit_expr - { - var e *expr.Exit; - if $2 != nil { - e = $2.(*expr.Exit) - } else { - e = expr.NewExit(nil) - } - - $$ = e - - if (strings.EqualFold($1.Value, "die")) { - e.Die = true - } - - // save position - if $2 == nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - } - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '@' expr - { - $$ = expr.NewErrorSuppress($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | scalar - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '`' backticks_expr '`' - { - $$ = expr.NewShellExec($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_PRINT expr - { - $$ = expr.NewPrint($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_YIELD - { - $$ = expr.NewYield(nil, nil) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_YIELD expr - { - $$ = expr.NewYield(nil, $2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_YIELD expr T_DOUBLE_ARROW expr - { - $$ = expr.NewYield($2, $4) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_YIELD_FROM expr - { - $$ = expr.NewYieldFrom($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | inline_function - { - $$ = $1; - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_STATIC inline_function - { - $$ = $2; - - switch n := $$.(type) { - case *expr.Closure : - n.Static = true; - case *expr.ArrowFunction : - n.Static = true; - }; - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Static, (*$$.GetFreeFloating())[freefloating.Start]); delete((*$$.GetFreeFloating()), freefloating.Start) - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating); - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -inline_function: - T_FUNCTION returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars return_type '{' inner_statement_list '}' - { - $$ = expr.NewClosure($5, $7, $8, $10, false, $2 != nil, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - if $2 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $4.FreeFloating) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $4.FreeFloating) - } - yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $6.FreeFloating) - if $8 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVars, (*$8.GetFreeFloating())[freefloating.Colon]); delete((*$8.GetFreeFloating()), freefloating.Colon) - } - yylex.(*Parser).setFreeFloating($$, freefloating.ReturnType, $9.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $11.FreeFloating) - - // normalize - if $8 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVars, (*$$.GetFreeFloating())[freefloating.ReturnType]); delete((*$$.GetFreeFloating()), freefloating.ReturnType) - } - if $7 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$$.GetFreeFloating())[freefloating.LexicalVarList]); delete((*$$.GetFreeFloating()), freefloating.LexicalVarList) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FN returns_ref '(' parameter_list ')' return_type backup_doc_comment T_DOUBLE_ARROW expr - { - $$ = expr.NewArrowFunction($4, $6, $9, false, $2 != nil, $7) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - if $2 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $3.FreeFloating) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $3.FreeFloating) - }; - yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $5.FreeFloating) - if $6 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$6.GetFreeFloating())[freefloating.Colon]); delete((*$6.GetFreeFloating()), freefloating.Colon) - }; - yylex.(*Parser).setFreeFloating($$, freefloating.ReturnType, $8.FreeFloating) - - // normalize - if $6 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$$.GetFreeFloating())[freefloating.ReturnType]); delete((*$$.GetFreeFloating()), freefloating.ReturnType) - }; - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -backup_doc_comment: - /* empty */ - { - $$ = yylex.(*Parser).Lexer.GetPhpDocComment() - yylex.(*Parser).Lexer.SetPhpDocComment("") - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -returns_ref: - /* empty */ - { - $$ = nil - } - | '&' - { - $$ = $1 - } -; - -lexical_vars: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_USE '(' lexical_var_list ')' - { - $$ = expr.NewClosureUse($3) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } -; - -lexical_var_list: - lexical_var_list ',' lexical_var - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | lexical_var - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -lexical_var: - T_VARIABLE - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - $$ = expr.NewVariable(identifier) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken($$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '&' T_VARIABLE - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($2.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = expr.NewReference(variable) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -function_call: - name argument_list - { - $$ = expr.NewFunctionCall($1, $2.(*node.ArgumentList)) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list - { - $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list - { - $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | callable_expr argument_list - { - $$ = expr.NewFunctionCall($1, $2.(*node.ArgumentList)) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -class_name: - T_STATIC - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | name - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -class_name_reference: - class_name - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | new_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -exit_expr: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '(' optional_expr ')' - { - $$ = expr.NewExit($2); - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Exit, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -backticks_expr: - /* empty */ - { - $$ = []node.Node{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_ENCAPSED_AND_WHITESPACE - { - part := scalar.NewEncapsedStringPart($1.Value) - $$ = []node.Node{part} - - // save position - part.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | encaps_list - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -ctor_arguments: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | argument_list - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -dereferencable_scalar: - T_ARRAY '(' array_pair_list ')' - { - $$ = expr.NewArray($3) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | '[' array_pair_list ']' - { - $$ = expr.NewShortArray($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CONSTANT_ENCAPSED_STRING - { - $$ = scalar.NewString($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -scalar: - T_LNUMBER - { - $$ = scalar.NewLnumber($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_DNUMBER - { - $$ = scalar.NewDnumber($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_LINE - { - $$ = scalar.NewMagicConstant($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FILE - { - $$ = scalar.NewMagicConstant($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_DIR - { - $$ = scalar.NewMagicConstant($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_TRAIT_C - { - $$ = scalar.NewMagicConstant($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_METHOD_C - { - $$ = scalar.NewMagicConstant($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FUNC_C - { - $$ = scalar.NewMagicConstant($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NS_C - { - $$ = scalar.NewMagicConstant($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CLASS_C - { - $$ = scalar.NewMagicConstant($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - 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}) - - // save position - encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_START_HEREDOC T_END_HEREDOC - { - $$ = scalar.NewHeredoc($1.Value, nil) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '"' encaps_list '"' - { - $$ = scalar.NewEncapsed($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_START_HEREDOC encaps_list T_END_HEREDOC - { - $$ = scalar.NewHeredoc($1.Value, $2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | dereferencable_scalar - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | constant - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -constant: - name - { - $$ = expr.NewConstFetch($1) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | class_name T_PAAMAYIM_NEKUDOTAYIM identifier - { - target := node.NewIdentifier($3.Value) - $$ = expr.NewClassConstFetch($1, target) - - // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | variable_class_name T_PAAMAYIM_NEKUDOTAYIM identifier - { - target := node.NewIdentifier($3.Value) - $$ = expr.NewClassConstFetch($1, target) - - // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } -; - -expr: - variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr_without_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -optional_expr: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -variable_class_name: - dereferencable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -dereferencable: - variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '(' expr ')' - { - $$ = $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).returnTokenToPool(yyDollar, &yyVAL) - } - | dereferencable_scalar - { - $$ = $1; - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -callable_expr: - callable_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '(' expr ')' - { - $$ = $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).returnTokenToPool(yyDollar, &yyVAL) - } - | dereferencable_scalar - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -callable_variable: - simple_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | dereferencable '[' optional_expr ']' - { - $$ = expr.NewArrayDimFetch($1, $3) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | constant '[' optional_expr ']' - { - $$ = expr.NewArrayDimFetch($1, $3) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | dereferencable '{' expr '}' - { - $$ = expr.NewArrayDimFetch($1, $3) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | dereferencable T_OBJECT_OPERATOR property_name argument_list - { - $$ = expr.NewMethodCall($1, $3, $4.(*node.ArgumentList)) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | function_call - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -variable: - callable_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | static_member - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | dereferencable T_OBJECT_OPERATOR property_name - { - $$ = expr.NewPropertyFetch($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -simple_variable: - T_VARIABLE - { - name := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - $$ = expr.NewVariable(name) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken($$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '$' '{' expr '}' - { - $$ = expr.NewVariable($3) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | '$' simple_variable - { - $$ = expr.NewVariable($2) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } -; - -static_member: - class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable - { - $$ = expr.NewStaticPropertyFetch($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable - { - $$ = expr.NewStaticPropertyFetch($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -new_variable: - simple_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | new_variable '[' optional_expr ']' - { - $$ = expr.NewArrayDimFetch($1, $3) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | new_variable '{' expr '}' - { - $$ = expr.NewArrayDimFetch($1, $3) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | new_variable T_OBJECT_OPERATOR property_name - { - $$ = expr.NewPropertyFetch($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable - { - $$ = expr.NewStaticPropertyFetch($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable - { - $$ = expr.NewStaticPropertyFetch($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -member_name: - identifier - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '{' expr '}' - { - $$ = $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).returnTokenToPool(yyDollar, &yyVAL) - } - | simple_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -property_name: - T_STRING - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '{' expr '}' - { - $$ = $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).returnTokenToPool(yyDollar, &yyVAL) - } - | simple_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -array_pair_list: - non_empty_array_pair_list - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -possible_array_pair: - /* empty */ - { - $$ = expr.NewArrayItem(nil, nil, false) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | array_pair - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -non_empty_array_pair_list: - non_empty_array_pair_list ',' possible_array_pair - { - if len($1) == 0 { - $1 = []node.Node{expr.NewArrayItem(nil, nil, false)} - } - - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | possible_array_pair - { - if $1.(*expr.ArrayItem).Key == nil && $1.(*expr.ArrayItem).Val == nil { - $$ = []node.Node{} - } else { - $$ = []node.Node{$1} - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -array_pair: - expr T_DOUBLE_ARROW expr - { - $$ = expr.NewArrayItem($1, $3, false) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr - { - $$ = expr.NewArrayItem(nil, $1, false) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_DOUBLE_ARROW '&' variable - { - reference := expr.NewReference($4) - $$ = expr.NewArrayItem($1, reference, false) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(reference, freefloating.Start, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '&' variable - { - reference := expr.NewReference($2) - $$ = expr.NewArrayItem(nil, reference, false) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_ELLIPSIS expr - { - $$ = expr.NewArrayItem(nil, $2, true) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_DOUBLE_ARROW T_LIST '(' array_pair_list ')' - { - // TODO: Cannot use list() as standalone expression - listNode := expr.NewList($5) - $$ = expr.NewArrayItem($1, listNode, false) - - // save position - listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $6)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.List, $4.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, $6.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_LIST '(' array_pair_list ')' - { - // TODO: Cannot use list() as standalone expression - listNode := expr.NewList($3) - $$ = expr.NewArrayItem(nil, listNode, false) - - // save position - listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // 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).returnTokenToPool(yyDollar, &yyVAL) - } -; - -encaps_list: - encaps_list encaps_var - { - $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | encaps_list T_ENCAPSED_AND_WHITESPACE - { - encapsed := scalar.NewEncapsedStringPart($2.Value) - $$ = append($1, encapsed) - - // save position - encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - - // save comments - yylex.(*Parser).setFreeFloating(encapsed, freefloating.Start, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | encaps_var - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_ENCAPSED_AND_WHITESPACE encaps_var - { - encapsed := scalar.NewEncapsedStringPart($1.Value) - $$ = []node.Node{encapsed, $2} - - // save position - encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating(encapsed, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -encaps_var: - T_VARIABLE - { - name := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - $$ = expr.NewVariable(name) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken($$) - - 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) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(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).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) - - // 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)) - - // save comments - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(fetch, freefloating.Start, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_DOLLAR_OPEN_CURLY_BRACES expr '}' - { - variable := expr.NewVariable($2) - - $$ = variable - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' - { - name := node.NewIdentifier($2.Value) - variable := expr.NewVariable(name) - - $$ = variable - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(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).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) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CURLY_OPEN variable '}' - { - $$ = $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).returnTokenToPool(yyDollar, &yyVAL) - } -; - -encaps_var_offset: - T_STRING - { - $$ = scalar.NewString($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - 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) - } else { - $$ = scalar.NewString($1.Value) - } - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '-' T_NUM_STRING - { - var lnumber *scalar.Lnumber - // TODO: add option to handle 64 bit integer - _, err := strconv.Atoi($2.Value); - isInt := err == nil - - if isInt { - lnumber = scalar.NewLnumber($2.Value) - $$ = expr.NewUnaryMinus(lnumber) - } else { - $2.Value = "-"+$2.Value - $$ = scalar.NewString($2.Value) - } - - // save position - if isInt { - lnumber.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - } - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_VARIABLE - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - $$ = expr.NewVariable(identifier) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken($$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -internal_functions_in_yacc: - T_ISSET '(' isset_variables possible_comma ')' - { - $$ = expr.NewIsset($3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Isset, $2.FreeFloating) - if $4 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $5.FreeFloating) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, append($4.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($4), $5.FreeFloating...)...)) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_EMPTY '(' expr ')' - { - $$ = expr.NewEmpty($3) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_INCLUDE expr - { - $$ = expr.NewInclude($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_INCLUDE_ONCE expr - { - $$ = expr.NewIncludeOnce($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_EVAL '(' expr ')' - { - $$ = expr.NewEval($3) - - // save position - $$.SetPosition(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).returnTokenToPool(yyDollar, &yyVAL) - } - | T_REQUIRE expr - { - $$ = expr.NewRequire($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_REQUIRE_ONCE expr - { - $$ = expr.NewRequireOnce($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -isset_variables: - isset_variable - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | isset_variables ',' isset_variable - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -isset_variable: - expr - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -///////////////////////////////////////////////////////////////////////// - -%% diff --git a/php7/php7_test.go b/php7/php7_test.go deleted file mode 100644 index 32b79c7..0000000 --- a/php7/php7_test.go +++ /dev/null @@ -1,16450 +0,0 @@ -package php7_test - -import ( - "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/php7" - "github.com/z7zmey/php-parser/position" -) - -func TestPhp7(t *testing.T) { - src := `bar($a, ...$b); - foo::bar($a, ...$b); - $foo::bar($a, ...$b); - new foo($a, ...$b); - /** anonymous class */ - new class ($a, ...$b) {}; - new class {}; - new $foo; - new $foo[1]; - new $foo{$bar}; - new $foo->bar; - new $foo::$bar; - new static::$bar; - - function foo(?bar $bar=null, baz &...$baz) {} - class foo {public function foo(?bar $bar=null, baz &...$baz) {}} - function(?bar $bar=null, baz &...$baz) {}; - static function(?bar $bar=null, baz &...$baz) {}; - - 1234567890123456789; - 12345678901234567890; - 0.; - 0b0111111111111111111111111111111111111111111111111111111111111111; - 0b1111111111111111111111111111111111111111111111111111111111111111; - 0x007111111111111111; - 0x8111111111111111; - __CLASS__; - __DIR__; - __FILE__; - __FUNCTION__; - __LINE__; - __NAMESPACE__; - __METHOD__; - __TRAIT__; - - "test $var"; - "test $var[1]"; - "test $var[-1]"; - "test $var[1234567890123456789012345678901234567890]"; - "test $var[-1234567890123456789012345678901234567890]"; - "test $var[bar]"; - "test $var[$bar]"; - "$foo $bar"; - "test $foo->bar()"; - "test ${foo}"; - "test ${foo[0]}"; - "test ${$foo}"; - "test {$foo->bar()}"; - - if ($a) : - endif; - if ($a) : - elseif ($b): - endif; - if ($a) : - else: - endif; - if ($a) : - elseif ($b): - elseif ($c): - else: - endif; - - while (1) { break; } - while (1) { break 2; } - while (1) : break(3); endwhile; - class foo{ public const FOO = 1, BAR = 2; } - class foo{ const FOO = 1, BAR = 2; } - class foo{ function bar() {} } - class foo{ public static function &bar() {} } - class foo{ public static function &bar(): void {} } - abstract class foo{ } - final class foo extends bar { } - final class foo implements bar { } - final class foo implements bar, baz { } - new class() extends foo implements bar, baz { }; - - const FOO = 1, BAR = 2; - while (1) { continue; } - while (1) { continue 2; } - while (1) { continue(3); } - declare(ticks=1); - declare(ticks=1) {} - declare(ticks=1): enddeclare; - do {} while(1); - echo $a, 1; - echo($a); - for($i = 0; $i < 10; $i++, $i++) {} - for(; $i < 10; $i++, $i++) : endfor; - foreach ($a as $v) {} - foreach ($a as $v) : endforeach; - foreach ($a as $k => $v) {} - foreach ($a as $k => &$v) {} - foreach ($a as $k => list($v)) {} - foreach ($a as $k => [$v]) {} - function foo() {} - function foo() {return;} - function &foo() {return 1;} - function &foo(): void {} - global $a, $b; - a: - goto a; - if ($a) {} - if ($a) {} elseif ($b) {} - if ($a) {} else {} - if ($a) {} elseif ($b) {} elseif ($c) {} else {} - if ($a) {} elseif ($b) {} else if ($c) {} else {} - ?>
1, &$b,); - ~$a; - !$a; - - Foo::Bar; - $foo::Bar; - clone($a); - clone $a; - function(){}; - function($a, $b) use ($c, &$d) {}; - function(): void {}; - foo; - namespace\foo; - \foo; - - empty($a); - @$a; - eval($a); - exit; - exit($a); - die; - die($a); - foo(); - namespace\foo(); - \foo(); - $foo(); - - $a--; - $a++; - --$a; - ++$a; - - include $a; - include_once $a; - require $a; - require_once $a; - - $a instanceof Foo; - $a instanceof namespace\Foo; - $a instanceof \Foo; - - isset($a, $b); - list($a) = $b; - list($a[]) = $b; - list(list($a)) = $b; - - $a->foo(); - new Foo(); - new namespace\Foo(); - new \Foo(); - new class ($a, ...$b) {}; - print($a); - $a->foo; - ` + "`cmd $a`;" + ` - ` + "`cmd`;" + ` - ` + "``;" + ` - []; - [1]; - [1=>1, &$b,]; - - [$a] = $b; - [$a[]] = $b; - [list($a)] = $b; - Foo::bar(); - namespace\Foo::bar(); - \Foo::bar(); - Foo::$bar; - $foo::$bar; - namespace\Foo::$bar; - \Foo::$bar; - $a ? $b : $c; - $a ? : $c; - $a ? $b ? $c : $d : $e; - $a ? $b : $c ? $d : $e; - -$a; - +$a; - $$a; - yield; - yield $a; - yield $a => $b; - yield from $a; - - (array)$a; - (boolean)$a; - (bool)$a; - (double)$a; - (float)$a; - (integer)$a; - (int)$a; - (object)$a; - (string)$a; - (unset)$a; - - $a & $b; - $a | $b; - $a ^ $b; - $a && $b; - $a || $b; - $a ?? $b; - $a . $b; - $a / $b; - $a == $b; - $a >= $b; - $a > $b; - $a === $b; - $a and $b; - $a or $b; - $a xor $b; - $a - $b; - $a % $b; - $a * $b; - $a != $b; - $a !== $b; - $a + $b; - $a ** $b; - $a << $b; - $a >> $b; - $a <= $b; - $a < $b; - $a <=> $b; - - $a =& $b; - $a = $b; - $a &= $b; - $a |= $b; - $a ^= $b; - $a .= $b; - $a /= $b; - $a -= $b; - $a %= $b; - $a *= $b; - $a += $b; - $a **= $b; - $a <<= $b; - $a >>= $b; - - class foo {public function class() {} } - \foo\bar(); - - function foo(&$a, ...$b) { - - function bar() {} - class Baz {} - trait Quux{} - interface Quuux {} - } - - function foo(&$a = 1, ...$b = 1, $c = 1) {} - function foo(array $a, callable $b) {} - abstract final class foo { abstract protected static function bar(); final private function baz() {} } - - (new Foo)->bar; - (new Foo)(); - [$foo][0](); - foo[1](); - "foo"(); - [1]{$foo}(); - ${foo()}; - - Foo::$bar(); - Foo::{$bar[0]}(); - - $foo->$bar; - $foo->{$bar[0]}; - - [1=>&$a, 2=>list($b)]; - - __halt_compiler(); - - parsing process must be terminated - ` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 2, - EndLine: 348, - StartPos: 5, - EndPos: 6319, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 5, - EndPos: 20, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 5, - EndPos: 19, - }, - Function: &name.Name{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 5, - EndPos: 8, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 5, - EndPos: 8, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - 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, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 11, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 11, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 13, - EndPos: 18, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 16, - EndPos: 18, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 16, - EndPos: 18, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 23, - EndPos: 39, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 23, - EndPos: 38, - }, - Function: &expr.Variable{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 23, - EndPos: 27, - }, - VarName: &node.Identifier{ - 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{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 28, - EndPos: 30, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 28, - EndPos: 30, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 28, - EndPos: 30, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 32, - EndPos: 37, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 35, - EndPos: 37, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 35, - EndPos: 37, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 42, - EndPos: 63, - }, - Expr: &expr.MethodCall{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 42, - EndPos: 62, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 42, - EndPos: 46, - }, - VarName: &node.Identifier{ - 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{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 52, - EndPos: 54, - }, - IsReference: false, - Variadic: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 52, - EndPos: 54, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 52, - EndPos: 54, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 56, - EndPos: 61, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 59, - EndPos: 61, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 59, - EndPos: 61, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 66, - EndPos: 86, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 66, - EndPos: 85, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 66, - EndPos: 69, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 66, - EndPos: 69, - }, - Value: "foo", - }, - }, - }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 71, - EndPos: 74, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - 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{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 75, - EndPos: 77, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 75, - EndPos: 77, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 79, - EndPos: 84, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 82, - EndPos: 84, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 82, - EndPos: 84, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 89, - EndPos: 110, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 89, - EndPos: 109, - }, - Class: &expr.Variable{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 89, - EndPos: 93, - }, - VarName: &node.Identifier{ - 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{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 99, - EndPos: 101, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 99, - EndPos: 101, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 99, - EndPos: 101, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 103, - EndPos: 108, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 106, - EndPos: 108, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 106, - EndPos: 108, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 113, - EndPos: 132, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 113, - EndPos: 131, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 117, - EndPos: 120, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 117, - EndPos: 120, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - 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, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 121, - EndPos: 123, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 121, - EndPos: 123, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 125, - EndPos: 130, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 128, - EndPos: 130, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 128, - EndPos: 130, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 160, - EndPos: 185, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 160, - EndPos: 184, - }, - Class: &stmt.Class{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 164, - EndPos: 184, - }, - PhpDocComment: "/** anonymous class */", - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 170, - EndPos: 181, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 171, - EndPos: 173, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 171, - EndPos: 173, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 171, - EndPos: 173, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 175, - EndPos: 180, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 178, - EndPos: 180, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 178, - EndPos: 180, - }, - Value: "b", - }, - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 188, - EndPos: 201, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 188, - EndPos: 200, - }, - Class: &stmt.Class{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 192, - EndPos: 200, - }, - PhpDocComment: "", - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 204, - EndPos: 213, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 204, - EndPos: 212, - }, - Class: &expr.Variable{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 208, - EndPos: 212, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 208, - EndPos: 212, - }, - Value: "foo", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 216, - EndPos: 228, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 216, - EndPos: 227, - }, - Class: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 220, - EndPos: 227, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 220, - EndPos: 224, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 220, - EndPos: 224, - }, - Value: "foo", - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 225, - EndPos: 226, - }, - Value: "1", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 231, - EndPos: 246, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 231, - EndPos: 245, - }, - Class: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 235, - EndPos: 245, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 235, - EndPos: 239, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 235, - EndPos: 239, - }, - Value: "foo", - }, - }, - Dim: &expr.Variable{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 240, - EndPos: 244, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 240, - EndPos: 244, - }, - Value: "bar", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 249, - EndPos: 263, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 249, - EndPos: 262, - }, - Class: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 253, - EndPos: 262, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 253, - EndPos: 257, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 253, - EndPos: 257, - }, - Value: "foo", - }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 259, - EndPos: 262, - }, - Value: "bar", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 266, - EndPos: 281, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 266, - EndPos: 280, - }, - Class: &expr.StaticPropertyFetch{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 270, - EndPos: 280, - }, - Class: &expr.Variable{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 270, - EndPos: 274, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 270, - EndPos: 274, - }, - Value: "foo", - }, - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 276, - EndPos: 280, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 276, - EndPos: 280, - }, - Value: "bar", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 284, - EndPos: 301, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 284, - EndPos: 300, - }, - Class: &expr.StaticPropertyFetch{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 288, - EndPos: 300, - }, - Class: &node.Identifier{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 288, - EndPos: 294, - }, - Value: "static", - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 296, - EndPos: 300, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 296, - EndPos: 300, - }, - Value: "bar", - }, - }, - }, - }, - }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 305, - EndPos: 350, - }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 314, - EndPos: 317, - }, - Value: "foo", - }, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 318, - EndPos: 332, - }, - ByRef: false, - Variadic: false, - VariableType: &node.Nullable{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 318, - EndPos: 322, - }, - Expr: &name.Name{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 319, - EndPos: 322, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 319, - EndPos: 322, - }, - Value: "bar", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 323, - EndPos: 327, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 323, - EndPos: 327, - }, - Value: "bar", - }, - }, - DefaultValue: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 328, - EndPos: 332, - }, - Constant: &name.Name{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 328, - EndPos: 332, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 328, - EndPos: 332, - }, - Value: "null", - }, - }, - }, - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 334, - EndPos: 346, - }, - Variadic: true, - ByRef: true, - VariableType: &name.Name{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 334, - EndPos: 337, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 334, - EndPos: 337, - }, - Value: "baz", - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 342, - EndPos: 346, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 342, - EndPos: 346, - }, - Value: "baz", - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 353, - EndPos: 417, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 359, - EndPos: 362, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 364, - EndPos: 416, - }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 380, - EndPos: 383, - }, - Value: "foo", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 364, - EndPos: 370, - }, - Value: "public", - }, - }, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 384, - EndPos: 398, - }, - ByRef: false, - Variadic: false, - VariableType: &node.Nullable{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 384, - EndPos: 388, - }, - Expr: &name.Name{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 385, - EndPos: 388, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 385, - EndPos: 388, - }, - Value: "bar", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 389, - EndPos: 393, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 389, - EndPos: 393, - }, - Value: "bar", - }, - }, - DefaultValue: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 394, - EndPos: 398, - }, - Constant: &name.Name{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 394, - EndPos: 398, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 394, - EndPos: 398, - }, - Value: "null", - }, - }, - }, - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 400, - EndPos: 412, - }, - ByRef: true, - Variadic: true, - VariableType: &name.Name{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 400, - EndPos: 403, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 400, - EndPos: 403, - }, - Value: "baz", - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 408, - EndPos: 412, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 408, - EndPos: 412, - }, - Value: "baz", - }, - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 414, - EndPos: 416, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 420, - EndPos: 462, - }, - Expr: &expr.Closure{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 420, - EndPos: 461, - }, - PhpDocComment: "", - ReturnsRef: false, - Static: false, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 429, - EndPos: 443, - }, - ByRef: false, - Variadic: false, - VariableType: &node.Nullable{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 429, - EndPos: 433, - }, - Expr: &name.Name{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 430, - EndPos: 433, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 430, - EndPos: 433, - }, - Value: "bar", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 434, - EndPos: 438, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 434, - EndPos: 438, - }, - Value: "bar", - }, - }, - DefaultValue: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 439, - EndPos: 443, - }, - Constant: &name.Name{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 439, - EndPos: 443, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 439, - EndPos: 443, - }, - Value: "null", - }, - }, - }, - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 445, - EndPos: 457, - }, - ByRef: true, - Variadic: true, - VariableType: &name.Name{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 445, - EndPos: 448, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 445, - EndPos: 448, - }, - Value: "baz", - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 453, - EndPos: 457, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 453, - EndPos: 457, - }, - Value: "baz", - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 465, - EndPos: 514, - }, - Expr: &expr.Closure{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 465, - EndPos: 513, - }, - PhpDocComment: "", - ReturnsRef: false, - Static: true, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 481, - EndPos: 495, - }, - ByRef: false, - Variadic: false, - VariableType: &node.Nullable{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 481, - EndPos: 485, - }, - Expr: &name.Name{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 482, - EndPos: 485, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 482, - EndPos: 485, - }, - Value: "bar", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 486, - EndPos: 490, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 486, - EndPos: 490, - }, - Value: "bar", - }, - }, - DefaultValue: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 491, - EndPos: 495, - }, - Constant: &name.Name{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 491, - EndPos: 495, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 491, - EndPos: 495, - }, - Value: "null", - }, - }, - }, - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 497, - EndPos: 509, - }, - ByRef: true, - Variadic: true, - VariableType: &name.Name{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 497, - EndPos: 500, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 497, - EndPos: 500, - }, - Value: "baz", - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 505, - EndPos: 509, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 505, - EndPos: 509, - }, - Value: "baz", - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 23, - EndLine: 23, - StartPos: 518, - EndPos: 538, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 23, - EndLine: 23, - StartPos: 518, - EndPos: 537, - }, - Value: "1234567890123456789", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 24, - EndLine: 24, - StartPos: 541, - EndPos: 562, - }, - Expr: &scalar.Dnumber{ - Position: &position.Position{ - StartLine: 24, - EndLine: 24, - StartPos: 541, - EndPos: 561, - }, - Value: "12345678901234567890", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 25, - EndLine: 25, - StartPos: 565, - EndPos: 568, - }, - Expr: &scalar.Dnumber{ - Position: &position.Position{ - StartLine: 25, - EndLine: 25, - StartPos: 565, - EndPos: 567, - }, - Value: "0.", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 26, - EndLine: 26, - StartPos: 571, - EndPos: 638, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 26, - EndLine: 26, - StartPos: 571, - EndPos: 637, - }, - Value: "0b0111111111111111111111111111111111111111111111111111111111111111", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 27, - EndLine: 27, - StartPos: 641, - EndPos: 708, - }, - Expr: &scalar.Dnumber{ - Position: &position.Position{ - StartLine: 27, - EndLine: 27, - StartPos: 641, - EndPos: 707, - }, - Value: "0b1111111111111111111111111111111111111111111111111111111111111111", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 28, - EndLine: 28, - StartPos: 711, - EndPos: 732, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 28, - EndLine: 28, - StartPos: 711, - EndPos: 731, - }, - Value: "0x007111111111111111", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 29, - EndLine: 29, - StartPos: 735, - EndPos: 754, - }, - Expr: &scalar.Dnumber{ - Position: &position.Position{ - StartLine: 29, - EndLine: 29, - StartPos: 735, - EndPos: 753, - }, - Value: "0x8111111111111111", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 30, - EndLine: 30, - StartPos: 757, - EndPos: 767, - }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 30, - EndLine: 30, - StartPos: 757, - EndPos: 766, - }, - Value: "__CLASS__", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 770, - EndPos: 778, - }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 770, - EndPos: 777, - }, - Value: "__DIR__", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 781, - EndPos: 790, - }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 781, - EndPos: 789, - }, - Value: "__FILE__", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 793, - EndPos: 806, - }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 793, - EndPos: 805, - }, - Value: "__FUNCTION__", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 809, - EndPos: 818, - }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 809, - EndPos: 817, - }, - Value: "__LINE__", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 821, - EndPos: 835, - }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 821, - EndPos: 834, - }, - Value: "__NAMESPACE__", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 838, - EndPos: 849, - }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 838, - EndPos: 848, - }, - Value: "__METHOD__", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 37, - EndLine: 37, - StartPos: 852, - EndPos: 862, - }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 37, - EndLine: 37, - StartPos: 852, - EndPos: 861, - }, - Value: "__TRAIT__", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 866, - EndPos: 878, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 866, - EndPos: 877, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 867, - EndPos: 872, - }, - Value: "test ", - }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 872, - EndPos: 876, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 872, - EndPos: 876, - }, - Value: "var", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 881, - EndPos: 896, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 881, - EndPos: 895, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 882, - EndPos: 887, - }, - Value: "test ", - }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 887, - EndPos: 894, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 887, - EndPos: 891, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 887, - EndPos: 891, - }, - Value: "var", - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 892, - EndPos: 893, - }, - Value: "1", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 899, - EndPos: 915, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 899, - EndPos: 914, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 900, - EndPos: 905, - }, - Value: "test ", - }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 905, - EndPos: 913, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 905, - EndPos: 909, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 905, - EndPos: 909, - }, - Value: "var", - }, - }, - Dim: &expr.UnaryMinus{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 910, - EndPos: 912, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 910, - EndPos: 912, - }, - Value: "1", - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 918, - EndPos: 972, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 918, - EndPos: 971, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 919, - EndPos: 924, - }, - Value: "test ", - }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 924, - EndPos: 970, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 924, - EndPos: 928, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 924, - EndPos: 928, - }, - Value: "var", - }, - }, - Dim: &scalar.String{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 929, - EndPos: 969, - }, - Value: "1234567890123456789012345678901234567890", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 975, - EndPos: 1030, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 975, - EndPos: 1029, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 976, - EndPos: 981, - }, - Value: "test ", - }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 981, - EndPos: 1028, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 981, - EndPos: 985, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 981, - EndPos: 985, - }, - Value: "var", - }, - }, - Dim: &scalar.String{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 986, - EndPos: 1027, - }, - Value: "-1234567890123456789012345678901234567890", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 1033, - EndPos: 1050, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 1033, - EndPos: 1049, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 1034, - EndPos: 1039, - }, - Value: "test ", - }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 1039, - EndPos: 1048, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 1039, - EndPos: 1043, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 1039, - EndPos: 1043, - }, - Value: "var", - }, - }, - Dim: &scalar.String{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 1044, - EndPos: 1047, - }, - Value: "bar", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 1053, - EndPos: 1071, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 1053, - EndPos: 1070, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 1054, - EndPos: 1059, - }, - Value: "test ", - }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 1059, - EndPos: 1069, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 1059, - EndPos: 1063, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 1059, - EndPos: 1063, - }, - Value: "var", - }, - }, - Dim: &expr.Variable{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 1064, - EndPos: 1068, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 1064, - EndPos: 1068, - }, - Value: "bar", - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 1074, - EndPos: 1086, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 1074, - EndPos: 1085, - }, - Parts: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 1075, - EndPos: 1079, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 1075, - EndPos: 1079, - }, - Value: "foo", - }, - }, - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 1079, - EndPos: 1080, - }, - Value: " ", - }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 1080, - EndPos: 1084, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 1080, - EndPos: 1084, - }, - Value: "bar", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1089, - EndPos: 1108, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1089, - EndPos: 1107, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1090, - EndPos: 1095, - }, - Value: "test ", - }, - &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1095, - EndPos: 1104, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1095, - EndPos: 1099, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1095, - EndPos: 1099, - }, - Value: "foo", - }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1101, - EndPos: 1104, - }, - Value: "bar", - }, - }, - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1104, - EndPos: 1106, - }, - Value: "()", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 48, - EndLine: 48, - StartPos: 1111, - EndPos: 1125, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 48, - EndLine: 48, - StartPos: 1111, - EndPos: 1124, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 48, - EndLine: 48, - StartPos: 1112, - EndPos: 1117, - }, - Value: "test ", - }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 48, - EndLine: 48, - StartPos: 1117, - EndPos: 1123, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 48, - EndLine: 48, - StartPos: 1119, - EndPos: 1122, - }, - Value: "foo", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1128, - EndPos: 1145, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1128, - EndPos: 1144, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1129, - EndPos: 1134, - }, - Value: "test ", - }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1134, - EndPos: 1143, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1136, - EndPos: 1139, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1136, - EndPos: 1139, - }, - Value: "foo", - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1140, - EndPos: 1141, - }, - Value: "0", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1148, - EndPos: 1163, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1148, - EndPos: 1162, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1149, - EndPos: 1154, - }, - Value: "test ", - }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1154, - EndPos: 1161, - }, - VarName: &expr.Variable{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1156, - EndPos: 1160, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1156, - EndPos: 1160, - }, - Value: "foo", - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1166, - EndPos: 1187, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1166, - EndPos: 1186, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1167, - EndPos: 1172, - }, - Value: "test ", - }, - &expr.MethodCall{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1173, - EndPos: 1184, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1173, - EndPos: 1177, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1173, - EndPos: 1177, - }, - Value: "foo", - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1179, - EndPos: 1182, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1182, - EndPos: 1184, - }, - }, - }, - }, - }, - }, - &stmt.AltIf{ - Position: &position.Position{ - StartLine: 53, - EndLine: 54, - StartPos: 1191, - EndPos: 1209, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 53, - EndLine: 53, - StartPos: 1195, - EndPos: 1197, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 53, - EndLine: 53, - StartPos: 1195, - EndPos: 1197, - }, - Value: "a", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.AltIf{ - Position: &position.Position{ - StartLine: 55, - EndLine: 57, - StartPos: 1212, - EndPos: 1245, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 55, - EndLine: 55, - StartPos: 1216, - EndPos: 1218, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 55, - EndLine: 55, - StartPos: 1216, - EndPos: 1218, - }, - Value: "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: 56, - EndLine: -1, - StartPos: 1224, - EndPos: -1, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 56, - EndLine: 56, - StartPos: 1232, - EndPos: 1234, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 56, - EndLine: 56, - StartPos: 1232, - EndPos: 1234, - }, - Value: "b", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.AltIf{ - Position: &position.Position{ - StartLine: 58, - EndLine: 60, - StartPos: 1248, - EndPos: 1274, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1252, - EndPos: 1254, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1252, - EndPos: 1254, - }, - Value: "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: 59, - EndLine: -1, - StartPos: 1260, - EndPos: -1, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.AltIf{ - Position: &position.Position{ - StartLine: 61, - EndLine: 65, - StartPos: 1277, - EndPos: 1333, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1281, - EndPos: 1283, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1281, - EndPos: 1283, - }, - Value: "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: 62, - EndLine: -1, - StartPos: 1289, - EndPos: -1, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1297, - EndPos: 1299, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1297, - EndPos: 1299, - }, - 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: 63, - EndLine: -1, - StartPos: 1304, - EndPos: -1, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1312, - EndPos: 1314, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1312, - EndPos: 1314, - }, - 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: 64, - EndLine: -1, - StartPos: 1319, - EndPos: -1, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.While{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1337, - EndPos: 1357, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1344, - EndPos: 1345, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1347, - EndPos: 1357, - }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1349, - EndPos: 1355, - }, - }, - }, - }, - }, - &stmt.While{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1360, - EndPos: 1382, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1367, - EndPos: 1368, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1370, - EndPos: 1382, - }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1372, - EndPos: 1380, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1378, - EndPos: 1379, - }, - Value: "2", - }, - }, - }, - }, - }, - &stmt.AltWhile{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1385, - EndPos: 1416, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1392, - EndPos: 1393, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1397, - EndPos: 1406, - }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1397, - EndPos: 1406, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1403, - EndPos: 1404, - }, - Value: "3", - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1419, - EndPos: 1462, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1425, - EndPos: 1428, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.ClassConstList{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1430, - EndPos: 1460, - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1430, - EndPos: 1436, - }, - Value: "public", - }, - }, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1443, - EndPos: 1450, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1443, - EndPos: 1446, - }, - Value: "FOO", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1449, - EndPos: 1450, - }, - Value: "1", - }, - }, - &stmt.Constant{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1452, - EndPos: 1459, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1452, - EndPos: 1455, - }, - Value: "BAR", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1458, - EndPos: 1459, - }, - Value: "2", - }, - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1465, - EndPos: 1501, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1471, - EndPos: 1474, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.ClassConstList{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1476, - EndPos: 1499, - }, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1482, - EndPos: 1489, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1482, - EndPos: 1485, - }, - Value: "FOO", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1488, - EndPos: 1489, - }, - Value: "1", - }, - }, - &stmt.Constant{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1491, - EndPos: 1498, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1491, - EndPos: 1494, - }, - Value: "BAR", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1497, - EndPos: 1498, - }, - Value: "2", - }, - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1504, - EndPos: 1534, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1510, - EndPos: 1513, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1515, - EndPos: 1532, - }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1524, - EndPos: 1527, - }, - Value: "bar", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1530, - EndPos: 1532, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1537, - EndPos: 1582, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1543, - EndPos: 1546, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1548, - EndPos: 1580, - }, - ReturnsRef: true, - PhpDocComment: "", - MethodName: &node.Identifier{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1572, - EndPos: 1575, - }, - Value: "bar", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1548, - EndPos: 1554, - }, - Value: "public", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1555, - EndPos: 1561, - }, - Value: "static", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1578, - EndPos: 1580, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1585, - EndPos: 1636, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1591, - EndPos: 1594, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1596, - EndPos: 1634, - }, - ReturnsRef: true, - PhpDocComment: "", - MethodName: &node.Identifier{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1620, - EndPos: 1623, - }, - Value: "bar", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1596, - EndPos: 1602, - }, - Value: "public", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1603, - EndPos: 1609, - }, - Value: "static", - }, - }, - ReturnType: &name.Name{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1627, - EndPos: 1631, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1627, - EndPos: 1631, - }, - Value: "void", - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1632, - EndPos: 1634, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1639, - EndPos: 1660, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1654, - EndPos: 1657, - }, - Value: "foo", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1639, - EndPos: 1647, - }, - Value: "abstract", - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1663, - EndPos: 1694, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1675, - EndPos: 1678, - }, - Value: "foo", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1663, - EndPos: 1668, - }, - Value: "final", - }, - }, - Extends: &stmt.ClassExtends{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1679, - EndPos: 1690, - }, - ClassName: &name.Name{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1687, - EndPos: 1690, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1687, - EndPos: 1690, - }, - Value: "bar", - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1697, - EndPos: 1731, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1709, - EndPos: 1712, - }, - Value: "foo", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1697, - EndPos: 1702, - }, - Value: "final", - }, - }, - Implements: &stmt.ClassImplements{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1713, - EndPos: 1727, - }, - InterfaceNames: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1724, - EndPos: 1727, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1724, - EndPos: 1727, - }, - Value: "bar", - }, - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1734, - EndPos: 1773, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1746, - EndPos: 1749, - }, - Value: "foo", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1734, - EndPos: 1739, - }, - Value: "final", - }, - }, - Implements: &stmt.ClassImplements{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1750, - EndPos: 1769, - }, - InterfaceNames: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1761, - EndPos: 1764, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1761, - EndPos: 1764, - }, - Value: "bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1766, - EndPos: 1769, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1766, - EndPos: 1769, - }, - Value: "baz", - }, - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1776, - EndPos: 1824, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1776, - EndPos: 1823, - }, - Class: &stmt.Class{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1780, - EndPos: 1823, - }, - PhpDocComment: "", - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1785, - EndPos: 1787, - }, - }, - Extends: &stmt.ClassExtends{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1788, - EndPos: 1799, - }, - ClassName: &name.Name{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1796, - EndPos: 1799, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1796, - EndPos: 1799, - }, - Value: "foo", - }, - }, - }, - }, - Implements: &stmt.ClassImplements{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1800, - EndPos: 1819, - }, - InterfaceNames: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1811, - EndPos: 1814, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1811, - EndPos: 1814, - }, - Value: "bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1816, - EndPos: 1819, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1816, - EndPos: 1819, - }, - Value: "baz", - }, - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.ConstList{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1828, - EndPos: 1851, - }, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1834, - EndPos: 1841, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1834, - EndPos: 1837, - }, - Value: "FOO", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1840, - EndPos: 1841, - }, - Value: "1", - }, - }, - &stmt.Constant{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1843, - EndPos: 1850, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1843, - EndPos: 1846, - }, - Value: "BAR", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1849, - EndPos: 1850, - }, - Value: "2", - }, - }, - }, - }, - &stmt.While{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1854, - EndPos: 1877, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1861, - EndPos: 1862, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1864, - EndPos: 1877, - }, - Stmts: []node.Node{ - &stmt.Continue{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1866, - EndPos: 1875, - }, - }, - }, - }, - }, - &stmt.While{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1880, - EndPos: 1905, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1887, - EndPos: 1888, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1890, - EndPos: 1905, - }, - Stmts: []node.Node{ - &stmt.Continue{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1892, - EndPos: 1903, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1901, - EndPos: 1902, - }, - Value: "2", - }, - }, - }, - }, - }, - &stmt.While{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1908, - EndPos: 1934, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1915, - EndPos: 1916, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1918, - EndPos: 1934, - }, - Stmts: []node.Node{ - &stmt.Continue{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1920, - EndPos: 1932, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1929, - EndPos: 1930, - }, - Value: "3", - }, - }, - }, - }, - }, - &stmt.Declare{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1937, - EndPos: 1954, - }, - Alt: false, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1945, - EndPos: 1952, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1945, - EndPos: 1950, - }, - Value: "ticks", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1951, - EndPos: 1952, - }, - Value: "1", - }, - }, - }, - Stmt: &stmt.Nop{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1953, - EndPos: 1954, - }, - }, - }, - &stmt.Declare{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 1957, - EndPos: 1976, - }, - Alt: false, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 1965, - EndPos: 1972, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 1965, - EndPos: 1970, - }, - Value: "ticks", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 1971, - EndPos: 1972, - }, - Value: "1", - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 1974, - EndPos: 1976, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Declare{ - Position: &position.Position{ - StartLine: 87, - EndLine: 87, - StartPos: 1979, - EndPos: 2008, - }, - Alt: true, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 87, - EndLine: 87, - StartPos: 1987, - EndPos: 1994, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 87, - EndLine: 87, - StartPos: 1987, - EndPos: 1992, - }, - Value: "ticks", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 87, - EndLine: 87, - StartPos: 1993, - EndPos: 1994, - }, - Value: "1", - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Do{ - Position: &position.Position{ - StartLine: 88, - EndLine: 88, - StartPos: 2011, - EndPos: 2026, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 88, - EndLine: 88, - StartPos: 2014, - EndPos: 2016, - }, - Stmts: []node.Node{}, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 88, - EndLine: 88, - StartPos: 2023, - EndPos: 2024, - }, - Value: "1", - }, - }, - &stmt.Echo{ - Position: &position.Position{ - StartLine: 89, - EndLine: 89, - StartPos: 2029, - EndPos: 2040, - }, - Exprs: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 89, - EndLine: 89, - StartPos: 2034, - EndPos: 2036, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 89, - EndLine: 89, - StartPos: 2034, - EndPos: 2036, - }, - Value: "a", - }, - }, - &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 89, - EndLine: 89, - StartPos: 2038, - EndPos: 2039, - }, - Value: "1", - }, - }, - }, - &stmt.Echo{ - Position: &position.Position{ - StartLine: 90, - EndLine: 90, - StartPos: 2043, - EndPos: 2052, - }, - Exprs: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 90, - EndLine: 90, - StartPos: 2048, - EndPos: 2050, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 90, - EndLine: 90, - StartPos: 2048, - EndPos: 2050, - }, - Value: "a", - }, - }, - }, - }, - &stmt.For{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2055, - EndPos: 2090, - }, - Init: []node.Node{ - &assign.Assign{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2059, - EndPos: 2065, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2059, - EndPos: 2061, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2059, - EndPos: 2061, - }, - Value: "i", - }, - }, - Expression: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2064, - EndPos: 2065, - }, - Value: "0", - }, - }, - }, - Cond: []node.Node{ - &binary.Smaller{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2067, - EndPos: 2074, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2067, - EndPos: 2069, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2067, - EndPos: 2069, - }, - Value: "i", - }, - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2072, - EndPos: 2074, - }, - Value: "10", - }, - }, - }, - Loop: []node.Node{ - &expr.PostInc{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2076, - EndPos: 2080, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2076, - EndPos: 2078, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2076, - EndPos: 2078, - }, - Value: "i", - }, - }, - }, - &expr.PostInc{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2082, - EndPos: 2086, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2082, - EndPos: 2084, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2082, - EndPos: 2084, - }, - Value: "i", - }, - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2088, - EndPos: 2090, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.AltFor{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2093, - EndPos: 2129, - }, - Cond: []node.Node{ - &binary.Smaller{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2099, - EndPos: 2106, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2099, - EndPos: 2101, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2099, - EndPos: 2101, - }, - Value: "i", - }, - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2104, - EndPos: 2106, - }, - Value: "10", - }, - }, - }, - Loop: []node.Node{ - &expr.PostInc{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2108, - EndPos: 2112, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2108, - EndPos: 2110, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2108, - EndPos: 2110, - }, - Value: "i", - }, - }, - }, - &expr.PostInc{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2114, - EndPos: 2118, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2114, - EndPos: 2116, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2114, - EndPos: 2116, - }, - Value: "i", - }, - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 2132, - EndPos: 2153, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 2141, - EndPos: 2143, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 2141, - EndPos: 2143, - }, - Value: "a", - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 2147, - EndPos: 2149, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 2147, - EndPos: 2149, - }, - Value: "v", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 2151, - EndPos: 2153, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.AltForeach{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2156, - EndPos: 2188, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2165, - EndPos: 2167, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2165, - EndPos: 2167, - }, - Value: "a", - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2171, - EndPos: 2173, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2171, - EndPos: 2173, - }, - Value: "v", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2191, - EndPos: 2218, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2200, - EndPos: 2202, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2200, - EndPos: 2202, - }, - Value: "a", - }, - }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2206, - EndPos: 2208, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2206, - EndPos: 2208, - }, - Value: "k", - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2212, - EndPos: 2214, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2212, - EndPos: 2214, - }, - Value: "v", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2216, - EndPos: 2218, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2221, - EndPos: 2249, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2230, - EndPos: 2232, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2230, - EndPos: 2232, - }, - Value: "a", - }, - }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2236, - EndPos: 2238, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2236, - EndPos: 2238, - }, - Value: "k", - }, - }, - Variable: &expr.Reference{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2242, - EndPos: 2245, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2243, - EndPos: 2245, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2243, - EndPos: 2245, - }, - Value: "v", - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2247, - EndPos: 2249, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2252, - EndPos: 2285, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2261, - EndPos: 2263, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2261, - EndPos: 2263, - }, - Value: "a", - }, - }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2267, - EndPos: 2269, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2267, - EndPos: 2269, - }, - Value: "k", - }, - }, - Variable: &expr.List{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2273, - EndPos: 2281, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2278, - EndPos: 2280, - }, - Val: &expr.Variable{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2278, - EndPos: 2280, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2278, - EndPos: 2280, - }, - Value: "v", - }, - }, - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2283, - EndPos: 2285, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2288, - EndPos: 2317, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2297, - EndPos: 2299, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2297, - EndPos: 2299, - }, - Value: "a", - }, - }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2303, - EndPos: 2305, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2303, - EndPos: 2305, - }, - Value: "k", - }, - }, - Variable: &expr.ShortList{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2309, - EndPos: 2313, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2310, - EndPos: 2312, - }, - Val: &expr.Variable{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2310, - EndPos: 2312, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2310, - EndPos: 2312, - }, - Value: "v", - }, - }, - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2315, - EndPos: 2317, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 99, - EndLine: 99, - StartPos: 2320, - EndPos: 2337, - }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 99, - EndLine: 99, - StartPos: 2329, - EndPos: 2332, - }, - Value: "foo", - }, - Stmts: []node.Node{}, - }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 100, - EndLine: 100, - StartPos: 2340, - EndPos: 2364, - }, - PhpDocComment: "", - ReturnsRef: false, - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 100, - EndLine: 100, - StartPos: 2349, - EndPos: 2352, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.Return{ - Position: &position.Position{ - StartLine: 100, - EndLine: 100, - StartPos: 2356, - EndPos: 2363, - }, - }, - }, - }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2367, - EndPos: 2394, - }, - ReturnsRef: true, - PhpDocComment: "", - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2377, - EndPos: 2380, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.Return{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2384, - EndPos: 2393, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2391, - EndPos: 2392, - }, - Value: "1", - }, - }, - }, - }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2397, - EndPos: 2421, - }, - ReturnsRef: true, - PhpDocComment: "", - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2407, - EndPos: 2410, - }, - Value: "foo", - }, - ReturnType: &name.Name{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2414, - EndPos: 2418, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2414, - EndPos: 2418, - }, - Value: "void", - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Global{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2424, - EndPos: 2438, - }, - Vars: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2431, - EndPos: 2433, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2431, - EndPos: 2433, - }, - Value: "a", - }, - }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2435, - EndPos: 2437, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2435, - EndPos: 2437, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Label{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2441, - EndPos: 2443, - }, - LabelName: &node.Identifier{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2441, - EndPos: 2442, - }, - Value: "a", - }, - }, - &stmt.Goto{ - Position: &position.Position{ - StartLine: 105, - EndLine: 105, - StartPos: 2447, - EndPos: 2454, - }, - Label: &node.Identifier{ - Position: &position.Position{ - StartLine: 105, - EndLine: 105, - StartPos: 2452, - EndPos: 2453, - }, - Value: "a", - }, - }, - &stmt.If{ - Position: &position.Position{ - StartLine: 106, - EndLine: 106, - StartPos: 2457, - EndPos: 2467, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 106, - EndLine: 106, - StartPos: 2461, - EndPos: 2463, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 106, - EndLine: 106, - StartPos: 2461, - EndPos: 2463, - }, - Value: "a", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 106, - EndLine: 106, - StartPos: 2465, - EndPos: 2467, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.If{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2470, - EndPos: 2495, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2474, - EndPos: 2476, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2474, - EndPos: 2476, - }, - Value: "a", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2478, - EndPos: 2480, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2481, - EndPos: 2495, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2489, - EndPos: 2491, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2489, - EndPos: 2491, - }, - Value: "b", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2493, - EndPos: 2495, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.If{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2498, - EndPos: 2516, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2502, - EndPos: 2504, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2502, - EndPos: 2504, - }, - Value: "a", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2506, - EndPos: 2508, - }, - Stmts: []node.Node{}, - }, - Else: &stmt.Else{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2509, - EndPos: 2516, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2514, - EndPos: 2516, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.If{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2519, - EndPos: 2567, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2523, - EndPos: 2525, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2523, - EndPos: 2525, - }, - Value: "a", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2527, - EndPos: 2529, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2530, - EndPos: 2544, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2538, - EndPos: 2540, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2538, - EndPos: 2540, - }, - Value: "b", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2542, - EndPos: 2544, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.ElseIf{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2545, - EndPos: 2559, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2553, - EndPos: 2555, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2553, - EndPos: 2555, - }, - Value: "c", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2557, - EndPos: 2559, - }, - Stmts: []node.Node{}, - }, - }, - }, - Else: &stmt.Else{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2560, - EndPos: 2567, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2565, - EndPos: 2567, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.If{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2570, - EndPos: 2619, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2574, - EndPos: 2576, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2574, - EndPos: 2576, - }, - Value: "a", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2578, - EndPos: 2580, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2581, - EndPos: 2595, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2589, - EndPos: 2591, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2589, - EndPos: 2591, - }, - Value: "b", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2593, - EndPos: 2595, - }, - Stmts: []node.Node{}, - }, - }, - }, - Else: &stmt.Else{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2596, - EndPos: 2619, - }, - Stmt: &stmt.If{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2601, - EndPos: 2619, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2605, - EndPos: 2607, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2605, - EndPos: 2607, - }, - Value: "c", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2609, - EndPos: 2611, - }, - Stmts: []node.Node{}, - }, - Else: &stmt.Else{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2612, - EndPos: 2619, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2617, - EndPos: 2619, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - }, - &stmt.Nop{ - Position: &position.Position{ - StartLine: 111, - EndLine: 111, - StartPos: 2622, - EndPos: 2624, - }, - }, - &stmt.InlineHtml{ - Position: &position.Position{ - StartLine: 111, - EndLine: 111, - StartPos: 2624, - EndPos: 2637, - }, - Value: "
", - }, - &stmt.Interface{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2642, - EndPos: 2658, - }, - PhpDocComment: "", - InterfaceName: &node.Identifier{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2652, - EndPos: 2655, - }, - Value: "Foo", - }, - Stmts: []node.Node{}, - }, - &stmt.Interface{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2661, - EndPos: 2689, - }, - PhpDocComment: "", - InterfaceName: &node.Identifier{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2671, - EndPos: 2674, - }, - Value: "Foo", - }, - Extends: &stmt.InterfaceExtends{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2675, - EndPos: 2686, - }, - InterfaceNames: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2683, - EndPos: 2686, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2683, - EndPos: 2686, - }, - Value: "Bar", - }, - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Interface{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2692, - EndPos: 2725, - }, - PhpDocComment: "", - InterfaceName: &node.Identifier{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2702, - EndPos: 2705, - }, - Value: "Foo", - }, - Extends: &stmt.InterfaceExtends{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2706, - EndPos: 2722, - }, - InterfaceNames: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2714, - EndPos: 2717, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2714, - EndPos: 2717, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2719, - EndPos: 2722, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2719, - EndPos: 2722, - }, - Value: "Baz", - }, - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Namespace{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2728, - EndPos: 2742, - }, - NamespaceName: &name.Name{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2738, - EndPos: 2741, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2738, - EndPos: 2741, - }, - Value: "Foo", - }, - }, - }, - }, - &stmt.Namespace{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2745, - EndPos: 2761, - }, - NamespaceName: &name.Name{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2755, - EndPos: 2758, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2755, - EndPos: 2758, - }, - Value: "Foo", - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Namespace{ - Position: &position.Position{ - StartLine: 117, - EndLine: 117, - StartPos: 2764, - EndPos: 2776, - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2779, - EndPos: 2798, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2785, - EndPos: 2788, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.PropertyList{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2790, - EndPos: 2797, - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2790, - EndPos: 2793, - }, - Value: "var", - }, - }, - Properties: []node.Node{ - &stmt.Property{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2794, - EndPos: 2796, - }, - PhpDocComment: "", - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2794, - EndPos: 2796, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2794, - EndPos: 2796, - }, - Value: "a", - }, - }, - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2801, - EndPos: 2838, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2807, - EndPos: 2810, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.PropertyList{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2812, - EndPos: 2837, - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2812, - EndPos: 2818, - }, - Value: "public", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2819, - EndPos: 2825, - }, - Value: "static", - }, - }, - Properties: []node.Node{ - &stmt.Property{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2826, - EndPos: 2828, - }, - PhpDocComment: "", - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2826, - EndPos: 2828, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2826, - EndPos: 2828, - }, - Value: "a", - }, - }, - }, - &stmt.Property{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2830, - EndPos: 2836, - }, - PhpDocComment: "", - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2830, - EndPos: 2832, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2830, - EndPos: 2832, - }, - Value: "b", - }, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2835, - EndPos: 2836, - }, - Value: "1", - }, - }, - }, - }, - }, - }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2841, - EndPos: 2859, - }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2848, - EndPos: 2850, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2848, - EndPos: 2850, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2848, - EndPos: 2850, - }, - Value: "a", - }, - }, - }, - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2852, - EndPos: 2858, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2852, - EndPos: 2854, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2852, - EndPos: 2854, - }, - Value: "b", - }, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2857, - EndPos: 2858, - }, - Value: "1", - }, - }, - }, - }, - &stmt.AltSwitch{ - Position: &position.Position{ - StartLine: 122, - EndLine: 126, - StartPos: 2863, - EndPos: 2922, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 122, - EndLine: 122, - StartPos: 2871, - EndPos: 2872, - }, - Value: "1", - }, - CaseList: &stmt.CaseList{ - Position: &position.Position{ - StartLine: 123, - EndLine: -1, - StartPos: 2879, - EndPos: -1, - }, - Cases: []node.Node{ - &stmt.Case{ - Position: &position.Position{ - StartLine: 123, - EndLine: -1, - StartPos: 2879, - EndPos: -1, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 123, - EndLine: 123, - StartPos: 2884, - EndPos: 2885, - }, - Value: "1", - }, - Stmts: []node.Node{}, - }, - &stmt.Default{ - Position: &position.Position{ - StartLine: 124, - EndLine: -1, - StartPos: 2890, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - &stmt.Case{ - Position: &position.Position{ - StartLine: 125, - EndLine: -1, - StartPos: 2902, - EndPos: -1, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 125, - EndLine: 125, - StartPos: 2907, - EndPos: 2908, - }, - Value: "2", - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.AltSwitch{ - Position: &position.Position{ - StartLine: 128, - EndLine: 131, - StartPos: 2926, - EndPos: 2974, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 128, - EndLine: 128, - StartPos: 2934, - EndPos: 2935, - }, - Value: "1", - }, - CaseList: &stmt.CaseList{ - Position: &position.Position{ - StartLine: 129, - EndLine: -1, - StartPos: 2943, - EndPos: -1, - }, - Cases: []node.Node{ - &stmt.Case{ - Position: &position.Position{ - StartLine: 129, - EndLine: -1, - StartPos: 2943, - EndPos: -1, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 129, - EndLine: 129, - StartPos: 2948, - EndPos: 2949, - }, - Value: "1", - }, - Stmts: []node.Node{}, - }, - &stmt.Case{ - Position: &position.Position{ - StartLine: 130, - EndLine: -1, - StartPos: 2954, - EndPos: -1, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 130, - EndLine: 130, - StartPos: 2959, - EndPos: 2960, - }, - Value: "2", - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.Switch{ - Position: &position.Position{ - StartLine: 133, - EndLine: 136, - StartPos: 2980, - EndPos: 3032, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 133, - EndLine: 133, - StartPos: 2988, - EndPos: 2989, - }, - Value: "1", - }, - CaseList: &stmt.CaseList{ - Position: &position.Position{ - StartLine: 133, - EndLine: 136, - StartPos: 2991, - EndPos: 3032, - }, - Cases: []node.Node{ - &stmt.Case{ - Position: &position.Position{ - StartLine: 134, - EndLine: 134, - StartPos: 2996, - EndPos: 3010, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 134, - EndLine: 134, - StartPos: 3001, - EndPos: 3002, - }, - Value: "1", - }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 134, - EndLine: 134, - StartPos: 3004, - EndPos: 3010, - }, - }, - }, - }, - &stmt.Case{ - Position: &position.Position{ - StartLine: 135, - EndLine: 135, - StartPos: 3014, - EndPos: 3028, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 135, - EndLine: 135, - StartPos: 3019, - EndPos: 3020, - }, - Value: "2", - }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 135, - EndLine: 135, - StartPos: 3022, - EndPos: 3028, - }, - }, - }, - }, - }, - }, - }, - &stmt.Switch{ - Position: &position.Position{ - StartLine: 138, - EndLine: 141, - StartPos: 3038, - EndPos: 3091, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 138, - EndLine: 138, - StartPos: 3046, - EndPos: 3047, - }, - Value: "1", - }, - CaseList: &stmt.CaseList{ - Position: &position.Position{ - StartLine: 138, - EndLine: 141, - StartPos: 3049, - EndPos: 3091, - }, - Cases: []node.Node{ - &stmt.Case{ - Position: &position.Position{ - StartLine: 139, - EndLine: 139, - StartPos: 3055, - EndPos: 3069, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 139, - EndLine: 139, - StartPos: 3060, - EndPos: 3061, - }, - Value: "1", - }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 139, - EndLine: 139, - StartPos: 3063, - EndPos: 3069, - }, - }, - }, - }, - &stmt.Case{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 3073, - EndPos: 3087, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 3078, - EndPos: 3079, - }, - Value: "2", - }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 3081, - EndPos: 3087, - }, - }, - }, - }, - }, - }, - }, - &stmt.Throw{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3095, - EndPos: 3104, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3101, - EndPos: 3103, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3101, - EndPos: 3103, - }, - Value: "e", - }, - }, - }, - &stmt.Trait{ - Position: &position.Position{ - StartLine: 145, - EndLine: 145, - StartPos: 3108, - EndPos: 3120, - }, - PhpDocComment: "", - TraitName: &node.Identifier{ - Position: &position.Position{ - StartLine: 145, - EndLine: 145, - StartPos: 3114, - EndPos: 3117, - }, - Value: "Foo", - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 3123, - EndPos: 3145, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 3129, - EndPos: 3132, - }, - Value: "Foo", - }, - Stmts: []node.Node{ - &stmt.TraitUse{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 3135, - EndPos: 3143, - }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 3139, - EndPos: 3142, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 3139, - EndPos: 3142, - }, - Value: "Bar", - }, - }, - }, - }, - TraitAdaptationList: &stmt.Nop{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 3142, - EndPos: 3143, - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3148, - EndPos: 3177, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3154, - EndPos: 3157, - }, - Value: "Foo", - }, - Stmts: []node.Node{ - &stmt.TraitUse{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3160, - EndPos: 3175, - }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3164, - EndPos: 3167, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3164, - EndPos: 3167, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3169, - EndPos: 3172, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3169, - EndPos: 3172, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3173, - EndPos: 3175, - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3180, - EndPos: 3226, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3186, - EndPos: 3189, - }, - Value: "Foo", - }, - Stmts: []node.Node{ - &stmt.TraitUse{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3192, - EndPos: 3224, - }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3196, - EndPos: 3199, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3196, - EndPos: 3199, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3201, - EndPos: 3204, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3201, - EndPos: 3204, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3205, - EndPos: 3224, - }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3207, - EndPos: 3221, - }, - Ref: &stmt.TraitMethodRef{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3207, - EndPos: 3210, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3207, - EndPos: 3210, - }, - Value: "one", - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3214, - EndPos: 3221, - }, - Value: "include", - }, - }, - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3229, - EndPos: 3274, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3235, - EndPos: 3238, - }, - Value: "Foo", - }, - Stmts: []node.Node{ - &stmt.TraitUse{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3241, - EndPos: 3272, - }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3245, - EndPos: 3248, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3245, - EndPos: 3248, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3250, - EndPos: 3253, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3250, - EndPos: 3253, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3254, - EndPos: 3272, - }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3256, - EndPos: 3269, - }, - Ref: &stmt.TraitMethodRef{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3256, - EndPos: 3259, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3256, - EndPos: 3259, - }, - Value: "one", - }, - }, - Modifier: &node.Identifier{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3263, - EndPos: 3269, - }, - Value: "public", - }, - }, - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3277, - EndPos: 3326, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3283, - EndPos: 3286, - }, - Value: "Foo", - }, - Stmts: []node.Node{ - &stmt.TraitUse{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3289, - EndPos: 3324, - }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3293, - EndPos: 3296, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3293, - EndPos: 3296, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3298, - EndPos: 3301, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3298, - EndPos: 3301, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3302, - EndPos: 3324, - }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3304, - EndPos: 3321, - }, - Ref: &stmt.TraitMethodRef{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3304, - EndPos: 3307, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3304, - EndPos: 3307, - }, - Value: "one", - }, - }, - Modifier: &node.Identifier{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3311, - EndPos: 3317, - }, - Value: "public", - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3318, - EndPos: 3321, - }, - Value: "two", - }, - }, - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3329, - EndPos: 3406, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3335, - EndPos: 3338, - }, - Value: "Foo", - }, - Stmts: []node.Node{ - &stmt.TraitUse{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3341, - EndPos: 3404, - }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3345, - EndPos: 3348, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3345, - EndPos: 3348, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3350, - EndPos: 3353, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3350, - EndPos: 3353, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3354, - EndPos: 3404, - }, - Adaptations: []node.Node{ - &stmt.TraitUsePrecedence{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3356, - EndPos: 3384, - }, - Ref: &stmt.TraitMethodRef{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3356, - EndPos: 3364, - }, - Trait: &name.Name{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3356, - EndPos: 3359, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3356, - EndPos: 3359, - }, - Value: "Bar", - }, - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3361, - EndPos: 3364, - }, - Value: "one", - }, - }, - Insteadof: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3375, - EndPos: 3378, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3375, - EndPos: 3378, - }, - Value: "Baz", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3380, - EndPos: 3384, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3380, - EndPos: 3384, - }, - Value: "Quux", - }, - }, - }, - }, - }, - &stmt.TraitUseAlias{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3386, - EndPos: 3401, - }, - Ref: &stmt.TraitMethodRef{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3386, - EndPos: 3394, - }, - Trait: &name.Name{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3386, - EndPos: 3389, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3386, - EndPos: 3389, - }, - Value: "Baz", - }, - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3391, - EndPos: 3394, - }, - Value: "one", - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3398, - EndPos: 3401, - }, - Value: "two", - }, - }, - }, - }, - }, - }, - }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 153, - EndLine: -1, - StartPos: 3410, - EndPos: -1, - }, - Stmts: []node.Node{}, - Catches: []node.Node{}, - }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3419, - EndPos: 3449, - }, - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3426, - EndPos: 3449, - }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3433, - EndPos: 3442, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3433, - EndPos: 3442, - }, - Value: "Exception", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3443, - EndPos: 3445, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3443, - EndPos: 3445, - }, - Value: "e", - }, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3452, - EndPos: 3499, - }, - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3459, - EndPos: 3499, - }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3466, - EndPos: 3475, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3466, - EndPos: 3475, - }, - Value: "Exception", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3476, - EndPos: 3492, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3476, - EndPos: 3492, - }, - Value: "RuntimeException", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3493, - EndPos: 3495, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3493, - EndPos: 3495, - }, - Value: "e", - }, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3502, - EndPos: 3563, - }, - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3509, - EndPos: 3532, - }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3516, - EndPos: 3525, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3516, - EndPos: 3525, - }, - Value: "Exception", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3526, - EndPos: 3528, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3526, - EndPos: 3528, - }, - Value: "e", - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Catch{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3533, - EndPos: 3563, - }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3540, - EndPos: 3556, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3540, - EndPos: 3556, - }, - Value: "RuntimeException", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3557, - EndPos: 3559, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3557, - EndPos: 3559, - }, - Value: "e", - }, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3566, - EndPos: 3607, - }, - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3573, - EndPos: 3596, - }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3580, - EndPos: 3589, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3580, - EndPos: 3589, - }, - Value: "Exception", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3590, - EndPos: 3592, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3590, - EndPos: 3592, - }, - Value: "e", - }, - }, - Stmts: []node.Node{}, - }, - }, - Finally: &stmt.Finally{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3597, - EndPos: 3607, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Unset{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3611, - EndPos: 3626, - }, - Vars: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3617, - EndPos: 3619, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3617, - EndPos: 3619, - }, - Value: "a", - }, - }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3621, - EndPos: 3623, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3621, - EndPos: 3623, - }, - Value: "b", - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3630, - EndPos: 3638, - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3634, - EndPos: 3637, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3634, - EndPos: 3637, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3634, - EndPos: 3637, - }, - Value: "Foo", - }, - }, - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3641, - EndPos: 3650, - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3646, - EndPos: 3649, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3646, - EndPos: 3649, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3646, - EndPos: 3649, - }, - Value: "Foo", - }, - }, - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3653, - EndPos: 3669, - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3658, - EndPos: 3668, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3658, - EndPos: 3661, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3658, - EndPos: 3661, - }, - Value: "Foo", - }, - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3665, - EndPos: 3668, - }, - Value: "Bar", - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3672, - EndPos: 3685, - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3676, - EndPos: 3679, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3676, - EndPos: 3679, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3676, - EndPos: 3679, - }, - Value: "Foo", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3681, - EndPos: 3684, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3681, - EndPos: 3684, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3681, - EndPos: 3684, - }, - Value: "Bar", - }, - }, - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3688, - EndPos: 3708, - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3692, - EndPos: 3695, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3692, - EndPos: 3695, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3692, - EndPos: 3695, - }, - Value: "Foo", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3697, - EndPos: 3707, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3697, - EndPos: 3700, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3697, - EndPos: 3700, - }, - Value: "Bar", - }, - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3704, - EndPos: 3707, - }, - Value: "Baz", - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3711, - EndPos: 3734, - }, - UseType: &node.Identifier{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3715, - EndPos: 3723, - }, - Value: "function", - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3724, - EndPos: 3727, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3724, - EndPos: 3727, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3724, - EndPos: 3727, - }, - Value: "Foo", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3730, - EndPos: 3733, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3730, - EndPos: 3733, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3730, - EndPos: 3733, - }, - Value: "Bar", - }, - }, - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3737, - EndPos: 3774, - }, - UseType: &node.Identifier{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3741, - EndPos: 3749, - }, - Value: "function", - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3750, - EndPos: 3760, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3750, - EndPos: 3753, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3750, - EndPos: 3753, - }, - Value: "Foo", - }, - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3757, - EndPos: 3760, - }, - Value: "foo", - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3763, - EndPos: 3773, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3763, - EndPos: 3766, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3763, - EndPos: 3766, - }, - Value: "Bar", - }, - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3770, - EndPos: 3773, - }, - Value: "bar", - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3777, - EndPos: 3797, - }, - UseType: &node.Identifier{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3781, - EndPos: 3786, - }, - Value: "const", - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3787, - EndPos: 3790, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3787, - EndPos: 3790, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3787, - EndPos: 3790, - }, - Value: "Foo", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3793, - EndPos: 3796, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3793, - EndPos: 3796, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3793, - EndPos: 3796, - }, - Value: "Bar", - }, - }, - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3800, - EndPos: 3834, - }, - UseType: &node.Identifier{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3804, - EndPos: 3809, - }, - Value: "const", - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3810, - EndPos: 3820, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3810, - EndPos: 3813, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3810, - EndPos: 3813, - }, - Value: "Foo", - }, - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3817, - EndPos: 3820, - }, - Value: "foo", - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3823, - EndPos: 3833, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3823, - EndPos: 3826, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3823, - EndPos: 3826, - }, - Value: "Bar", - }, - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3830, - EndPos: 3833, - }, - Value: "bar", - }, - }, - }, - }, - &stmt.GroupUse{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3838, - EndPos: 3858, - }, - Prefix: &name.Name{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3843, - EndPos: 3846, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3843, - EndPos: 3846, - }, - Value: "Foo", - }, - }, - }, - UseList: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3848, - EndPos: 3851, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3848, - EndPos: 3851, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3848, - EndPos: 3851, - }, - Value: "Bar", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3853, - EndPos: 3856, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3853, - EndPos: 3856, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3853, - EndPos: 3856, - }, - Value: "Baz", - }, - }, - }, - }, - }, - }, - &stmt.GroupUse{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3861, - EndPos: 3888, - }, - Prefix: &name.Name{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3865, - EndPos: 3868, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3865, - EndPos: 3868, - }, - Value: "Foo", - }, - }, - }, - UseList: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3873, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3873, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3873, - }, - Value: "Bar", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3875, - EndPos: 3886, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3875, - EndPos: 3878, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3875, - EndPos: 3878, - }, - Value: "Baz", - }, - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3882, - EndPos: 3886, - }, - Value: "quux", - }, - }, - }, - }, - &stmt.GroupUse{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3891, - EndPos: 3919, - }, - UseType: &node.Identifier{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3895, - EndPos: 3903, - }, - Value: "function", - }, - Prefix: &name.Name{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3904, - EndPos: 3907, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3904, - EndPos: 3907, - }, - Value: "Foo", - }, - }, - }, - UseList: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3909, - EndPos: 3912, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3909, - EndPos: 3912, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3909, - EndPos: 3912, - }, - Value: "Bar", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3914, - EndPos: 3917, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3914, - EndPos: 3917, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3914, - EndPos: 3917, - }, - Value: "Baz", - }, - }, - }, - }, - }, - }, - &stmt.GroupUse{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3922, - EndPos: 3948, - }, - UseType: &node.Identifier{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3926, - EndPos: 3931, - }, - Value: "const", - }, - Prefix: &name.Name{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3933, - EndPos: 3936, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3933, - EndPos: 3936, - }, - Value: "Foo", - }, - }, - }, - UseList: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3938, - EndPos: 3941, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3938, - EndPos: 3941, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3938, - EndPos: 3941, - }, - Value: "Bar", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3943, - EndPos: 3946, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3943, - EndPos: 3946, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3943, - EndPos: 3946, - }, - Value: "Baz", - }, - }, - }, - }, - }, - }, - &stmt.GroupUse{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3951, - EndPos: 3985, - }, - Prefix: &name.Name{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3955, - EndPos: 3958, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3955, - EndPos: 3958, - }, - Value: "Foo", - }, - }, - }, - UseList: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3966, - EndPos: 3969, - }, - UseType: &node.Identifier{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3960, - EndPos: 3965, - }, - Value: "const", - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3966, - EndPos: 3969, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3966, - EndPos: 3969, - }, - Value: "Bar", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3980, - EndPos: 3983, - }, - UseType: &node.Identifier{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3971, - EndPos: 3979, - }, - Value: "function", - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3980, - EndPos: 3983, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3980, - EndPos: 3983, - }, - Value: "Baz", - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3989, - EndPos: 3995, - }, - Expr: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3989, - EndPos: 3994, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3989, - EndPos: 3991, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3989, - EndPos: 3991, - }, - Value: "a", - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3992, - EndPos: 3993, - }, - Value: "1", - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3998, - EndPos: 4007, - }, - Expr: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3998, - EndPos: 4006, - }, - Variable: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3998, - EndPos: 4003, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3998, - EndPos: 4000, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3998, - EndPos: 4000, - }, - Value: "a", - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 4001, - EndPos: 4002, - }, - Value: "1", - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 4004, - EndPos: 4005, - }, - Value: "2", - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 4010, - EndPos: 4018, - }, - Expr: &expr.Array{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 4010, - EndPos: 4017, - }, - Items: []node.Node{}, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 180, - EndLine: 180, - StartPos: 4021, - EndPos: 4030, - }, - Expr: &expr.Array{ - Position: &position.Position{ - StartLine: 180, - EndLine: 180, - StartPos: 4021, - EndPos: 4029, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 180, - EndLine: 180, - StartPos: 4027, - EndPos: 4028, - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 180, - EndLine: 180, - StartPos: 4027, - EndPos: 4028, - }, - Value: "1", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4033, - EndPos: 4051, - }, - Expr: &expr.Array{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4033, - EndPos: 4050, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4039, - EndPos: 4043, - }, - Key: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4039, - EndPos: 4040, - }, - Value: "1", - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4042, - EndPos: 4043, - }, - Value: "1", - }, - }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4045, - EndPos: 4048, - }, - Val: &expr.Reference{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4045, - EndPos: 4048, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4046, - EndPos: 4048, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4046, - EndPos: 4048, - }, - Value: "b", - }, - }, - }, - }, - &expr.ArrayItem{}, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 4054, - EndPos: 4058, - }, - Expr: &expr.BitwiseNot{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 4054, - EndPos: 4057, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 4055, - EndPos: 4057, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 4055, - EndPos: 4057, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 4061, - EndPos: 4065, - }, - Expr: &expr.BooleanNot{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 4061, - EndPos: 4064, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 4062, - EndPos: 4064, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 4062, - EndPos: 4064, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 4069, - EndPos: 4078, - }, - Expr: &expr.ClassConstFetch{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 4069, - EndPos: 4077, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 4069, - EndPos: 4072, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 4069, - EndPos: 4072, - }, - Value: "Foo", - }, - }, - }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 4074, - EndPos: 4077, - }, - Value: "Bar", - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 4081, - EndPos: 4091, - }, - Expr: &expr.ClassConstFetch{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 4081, - EndPos: 4090, - }, - Class: &expr.Variable{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 4081, - EndPos: 4085, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 4081, - EndPos: 4085, - }, - Value: "foo", - }, - }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 4087, - EndPos: 4090, - }, - Value: "Bar", - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 4094, - EndPos: 4104, - }, - Expr: &expr.Clone{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 4094, - EndPos: 4102, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 4100, - EndPos: 4102, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 4100, - EndPos: 4102, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 4107, - EndPos: 4116, - }, - Expr: &expr.Clone{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 4107, - EndPos: 4115, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 4113, - EndPos: 4115, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 4113, - EndPos: 4115, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 189, - EndLine: 189, - StartPos: 4119, - EndPos: 4132, - }, - Expr: &expr.Closure{ - Position: &position.Position{ - StartLine: 189, - EndLine: 189, - StartPos: 4119, - EndPos: 4131, - }, - ReturnsRef: false, - Static: false, - PhpDocComment: "", - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4135, - EndPos: 4169, - }, - Expr: &expr.Closure{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4135, - EndPos: 4168, - }, - Static: false, - PhpDocComment: "", - ReturnsRef: false, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4144, - EndPos: 4146, - }, - ByRef: false, - Variadic: false, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4144, - EndPos: 4146, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4144, - EndPos: 4146, - }, - Value: "a", - }, - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4148, - EndPos: 4150, - }, - ByRef: false, - Variadic: false, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4148, - EndPos: 4150, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4148, - EndPos: 4150, - }, - Value: "b", - }, - }, - }, - }, - ClosureUse: &expr.ClosureUse{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4152, - EndPos: 4165, - }, - Uses: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4157, - EndPos: 4159, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4157, - EndPos: 4159, - }, - Value: "c", - }, - }, - &expr.Reference{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4161, - EndPos: 4164, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4162, - EndPos: 4164, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4162, - EndPos: 4164, - }, - Value: "d", - }, - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 191, - EndLine: 191, - StartPos: 4172, - EndPos: 4192, - }, - Expr: &expr.Closure{ - Position: &position.Position{ - StartLine: 191, - EndLine: 191, - StartPos: 4172, - EndPos: 4191, - }, - ReturnsRef: false, - Static: false, - PhpDocComment: "", - ReturnType: &name.Name{ - Position: &position.Position{ - StartLine: 191, - EndLine: 191, - StartPos: 4184, - EndPos: 4188, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 191, - EndLine: 191, - StartPos: 4184, - EndPos: 4188, - }, - Value: "void", - }, - }, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 4195, - EndPos: 4199, - }, - Expr: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 4195, - EndPos: 4198, - }, - Constant: &name.Name{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 4195, - EndPos: 4198, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 4195, - EndPos: 4198, - }, - Value: "foo", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 4202, - EndPos: 4216, - }, - Expr: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 4202, - EndPos: 4215, - }, - Constant: &name.Relative{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 4202, - EndPos: 4215, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 4212, - EndPos: 4215, - }, - Value: "foo", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 4219, - EndPos: 4224, - }, - Expr: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 4219, - EndPos: 4223, - }, - Constant: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 4219, - EndPos: 4223, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 4220, - EndPos: 4223, - }, - Value: "foo", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 4228, - EndPos: 4238, - }, - Expr: &expr.Empty{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 4228, - EndPos: 4237, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 4234, - EndPos: 4236, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 4234, - EndPos: 4236, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 197, - EndLine: 197, - StartPos: 4241, - EndPos: 4245, - }, - Expr: &expr.ErrorSuppress{ - Position: &position.Position{ - StartLine: 197, - EndLine: 197, - StartPos: 4241, - EndPos: 4244, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 197, - EndLine: 197, - StartPos: 4242, - EndPos: 4244, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 197, - EndLine: 197, - StartPos: 4242, - EndPos: 4244, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 4248, - EndPos: 4257, - }, - Expr: &expr.Eval{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 4248, - EndPos: 4256, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 4253, - EndPos: 4255, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 4253, - EndPos: 4255, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 199, - EndLine: 199, - StartPos: 4260, - EndPos: 4265, - }, - Expr: &expr.Exit{ - Position: &position.Position{ - StartLine: 199, - EndLine: 199, - StartPos: 4260, - EndPos: 4264, - }, - Die: false, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 4268, - EndPos: 4277, - }, - Expr: &expr.Exit{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 4268, - EndPos: 4276, - }, - Die: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 4273, - EndPos: 4275, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 4273, - EndPos: 4275, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 201, - EndLine: 201, - StartPos: 4280, - EndPos: 4284, - }, - Expr: &expr.Exit{ - Position: &position.Position{ - StartLine: 201, - EndLine: 201, - StartPos: 4280, - EndPos: 4283, - }, - Die: true, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 202, - EndLine: 202, - StartPos: 4287, - EndPos: 4295, - }, - Expr: &expr.Exit{ - Position: &position.Position{ - StartLine: 202, - EndLine: 202, - StartPos: 4287, - EndPos: 4294, - }, - Die: true, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 202, - EndLine: 202, - StartPos: 4291, - EndPos: 4293, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 202, - EndLine: 202, - StartPos: 4291, - EndPos: 4293, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 4298, - EndPos: 4304, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 4298, - EndPos: 4303, - }, - Function: &name.Name{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 4298, - EndPos: 4301, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 4298, - EndPos: 4301, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 4301, - EndPos: 4303, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 4307, - EndPos: 4323, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 4307, - EndPos: 4322, - }, - Function: &name.Relative{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 4307, - EndPos: 4320, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 4317, - EndPos: 4320, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 4320, - EndPos: 4322, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 4326, - EndPos: 4333, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 4326, - EndPos: 4332, - }, - Function: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 4326, - EndPos: 4330, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 4327, - EndPos: 4330, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 4330, - EndPos: 4332, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 4336, - EndPos: 4343, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 4336, - EndPos: 4342, - }, - Function: &expr.Variable{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 4336, - EndPos: 4340, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 4336, - EndPos: 4340, - }, - Value: "foo", - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 4340, - EndPos: 4342, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 4347, - EndPos: 4352, - }, - Expr: &expr.PostDec{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 4347, - EndPos: 4351, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 4347, - EndPos: 4349, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 4347, - EndPos: 4349, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 4355, - EndPos: 4360, - }, - Expr: &expr.PostInc{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 4355, - EndPos: 4359, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 4355, - EndPos: 4357, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 4355, - EndPos: 4357, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4363, - EndPos: 4368, - }, - Expr: &expr.PreDec{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4363, - EndPos: 4367, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4365, - EndPos: 4367, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4365, - EndPos: 4367, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 211, - EndLine: 211, - StartPos: 4371, - EndPos: 4376, - }, - Expr: &expr.PreInc{ - Position: &position.Position{ - StartLine: 211, - EndLine: 211, - StartPos: 4371, - EndPos: 4375, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 211, - EndLine: 211, - StartPos: 4373, - EndPos: 4375, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 211, - EndLine: 211, - StartPos: 4373, - EndPos: 4375, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4380, - EndPos: 4391, - }, - Expr: &expr.Include{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4380, - EndPos: 4390, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4388, - EndPos: 4390, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4388, - EndPos: 4390, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4394, - EndPos: 4410, - }, - Expr: &expr.IncludeOnce{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4394, - EndPos: 4409, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4407, - EndPos: 4409, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4407, - EndPos: 4409, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4413, - EndPos: 4424, - }, - Expr: &expr.Require{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4413, - EndPos: 4423, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4421, - EndPos: 4423, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4421, - EndPos: 4423, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4427, - EndPos: 4443, - }, - Expr: &expr.RequireOnce{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4427, - EndPos: 4442, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4440, - EndPos: 4442, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4440, - EndPos: 4442, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4447, - EndPos: 4465, - }, - Expr: &expr.InstanceOf{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4447, - EndPos: 4464, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4447, - EndPos: 4449, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4447, - EndPos: 4449, - }, - Value: "a", - }, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4461, - EndPos: 4464, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4461, - EndPos: 4464, - }, - Value: "Foo", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4468, - EndPos: 4496, - }, - Expr: &expr.InstanceOf{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4468, - EndPos: 4495, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4468, - EndPos: 4470, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4468, - EndPos: 4470, - }, - Value: "a", - }, - }, - Class: &name.Relative{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4482, - EndPos: 4495, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4492, - EndPos: 4495, - }, - Value: "Foo", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4499, - EndPos: 4518, - }, - Expr: &expr.InstanceOf{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4499, - EndPos: 4517, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4499, - EndPos: 4501, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4499, - EndPos: 4501, - }, - Value: "a", - }, - }, - Class: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4513, - EndPos: 4517, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4514, - EndPos: 4517, - }, - Value: "Foo", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4522, - EndPos: 4536, - }, - Expr: &expr.Isset{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4522, - EndPos: 4535, - }, - Variables: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4528, - EndPos: 4530, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4528, - EndPos: 4530, - }, - Value: "a", - }, - }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4532, - EndPos: 4534, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4532, - EndPos: 4534, - }, - Value: "b", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4539, - EndPos: 4553, - }, - Expr: &assign.Assign{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4539, - EndPos: 4552, - }, - Variable: &expr.List{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4539, - EndPos: 4547, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4546, - }, - Val: &expr.Variable{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4546, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4546, - }, - Value: "a", - }, - }, - }, - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4550, - EndPos: 4552, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4550, - EndPos: 4552, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4556, - EndPos: 4572, - }, - Expr: &assign.Assign{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4556, - EndPos: 4571, - }, - Variable: &expr.List{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4556, - EndPos: 4566, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4561, - EndPos: 4565, - }, - Val: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4561, - EndPos: 4565, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4561, - EndPos: 4563, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4561, - EndPos: 4563, - }, - Value: "a", - }, - }, - }, - }, - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4569, - EndPos: 4571, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4569, - EndPos: 4571, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4575, - EndPos: 4595, - }, - Expr: &assign.Assign{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4575, - EndPos: 4594, - }, - Variable: &expr.List{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4575, - EndPos: 4589, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4580, - EndPos: 4588, - }, - Val: &expr.List{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4580, - EndPos: 4588, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4585, - EndPos: 4587, - }, - Val: &expr.Variable{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4585, - EndPos: 4587, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4585, - EndPos: 4587, - }, - Value: "a", - }, - }, - }, - }, - }, - }, - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4592, - EndPos: 4594, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4592, - EndPos: 4594, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4599, - EndPos: 4609, - }, - Expr: &expr.MethodCall{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4599, - EndPos: 4608, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4599, - EndPos: 4601, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4599, - EndPos: 4601, - }, - Value: "a", - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4603, - EndPos: 4606, - }, - Value: "foo", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4606, - EndPos: 4608, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4612, - EndPos: 4622, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4612, - EndPos: 4621, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4616, - EndPos: 4619, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4616, - EndPos: 4619, - }, - Value: "Foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4621, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4625, - EndPos: 4645, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4625, - EndPos: 4644, - }, - Class: &name.Relative{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4629, - EndPos: 4642, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4639, - EndPos: 4642, - }, - Value: "Foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4642, - EndPos: 4644, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4648, - EndPos: 4659, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4648, - EndPos: 4658, - }, - Class: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4652, - EndPos: 4656, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4653, - EndPos: 4656, - }, - Value: "Foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4656, - EndPos: 4658, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4662, - EndPos: 4687, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4662, - EndPos: 4686, - }, - Class: &stmt.Class{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4666, - EndPos: 4686, - }, - PhpDocComment: "", - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4672, - EndPos: 4683, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4673, - EndPos: 4675, - }, - IsReference: false, - Variadic: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4673, - EndPos: 4675, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4673, - EndPos: 4675, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4677, - EndPos: 4682, - }, - IsReference: false, - Variadic: true, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4680, - EndPos: 4682, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4680, - EndPos: 4682, - }, - Value: "b", - }, - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4690, - EndPos: 4700, - }, - Expr: &expr.Print{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4690, - EndPos: 4698, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4696, - EndPos: 4698, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4696, - EndPos: 4698, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4703, - EndPos: 4711, - }, - Expr: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4703, - EndPos: 4710, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4703, - EndPos: 4705, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4703, - EndPos: 4705, - }, - Value: "a", - }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4707, - EndPos: 4710, - }, - Value: "foo", - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 234, - EndLine: 234, - StartPos: 4714, - EndPos: 4723, - }, - Expr: &expr.ShellExec{ - Position: &position.Position{ - StartLine: 234, - EndLine: 234, - StartPos: 4714, - EndPos: 4722, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 234, - EndLine: 234, - StartPos: 4715, - EndPos: 4719, - }, - Value: "cmd ", - }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 234, - EndLine: 234, - StartPos: 4719, - EndPos: 4721, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 234, - EndLine: 234, - StartPos: 4719, - EndPos: 4721, - }, - Value: "a", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4726, - EndPos: 4732, - }, - Expr: &expr.ShellExec{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4726, - EndPos: 4731, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4727, - EndPos: 4730, - }, - Value: "cmd", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4735, - EndPos: 4738, - }, - Expr: &expr.ShellExec{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4735, - EndPos: 4737, - }, - Parts: []node.Node{}, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4741, - EndPos: 4744, - }, - Expr: &expr.ShortArray{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4741, - EndPos: 4743, - }, - Items: []node.Node{}, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4747, - EndPos: 4751, - }, - Expr: &expr.ShortArray{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4747, - EndPos: 4750, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4748, - EndPos: 4749, - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4748, - EndPos: 4749, - }, - Value: "1", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4754, - EndPos: 4767, - }, - Expr: &expr.ShortArray{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4754, - EndPos: 4766, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4755, - EndPos: 4759, - }, - Key: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4755, - EndPos: 4756, - }, - Value: "1", - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4758, - EndPos: 4759, - }, - Value: "1", - }, - }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4761, - EndPos: 4764, - }, - Val: &expr.Reference{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4761, - EndPos: 4764, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4762, - EndPos: 4764, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4762, - EndPos: 4764, - }, - Value: "b", - }, - }, - }, - }, - &expr.ArrayItem{}, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4771, - EndPos: 4781, - }, - Expr: &assign.Assign{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4771, - EndPos: 4780, - }, - Variable: &expr.ShortList{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4771, - EndPos: 4775, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4772, - EndPos: 4774, - }, - Val: &expr.Variable{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4772, - EndPos: 4774, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4772, - EndPos: 4774, - }, - Value: "a", - }, - }, - }, - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4778, - EndPos: 4780, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4778, - EndPos: 4780, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4784, - EndPos: 4796, - }, - Expr: &assign.Assign{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4784, - EndPos: 4795, - }, - Variable: &expr.ShortList{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4784, - EndPos: 4790, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4785, - EndPos: 4789, - }, - Val: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4785, - EndPos: 4789, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4785, - EndPos: 4787, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4785, - EndPos: 4787, - }, - Value: "a", - }, - }, - }, - }, - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4793, - EndPos: 4795, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4793, - EndPos: 4795, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4799, - EndPos: 4815, - }, - Expr: &assign.Assign{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4799, - EndPos: 4814, - }, - Variable: &expr.ShortList{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4799, - EndPos: 4809, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4800, - EndPos: 4808, - }, - Val: &expr.List{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4800, - EndPos: 4808, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4805, - EndPos: 4807, - }, - Val: &expr.Variable{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4805, - EndPos: 4807, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4805, - EndPos: 4807, - }, - Value: "a", - }, - }, - }, - }, - }, - }, - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4812, - EndPos: 4814, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4812, - EndPos: 4814, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4818, - EndPos: 4829, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4818, - EndPos: 4828, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4818, - EndPos: 4821, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4818, - EndPos: 4821, - }, - Value: "Foo", - }, - }, - }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4823, - EndPos: 4826, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4826, - EndPos: 4828, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4832, - EndPos: 4853, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4832, - EndPos: 4852, - }, - Class: &name.Relative{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4832, - EndPos: 4845, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4842, - EndPos: 4845, - }, - Value: "Foo", - }, - }, - }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4847, - EndPos: 4850, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4850, - EndPos: 4852, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4856, - EndPos: 4868, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4856, - EndPos: 4867, - }, - Class: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4856, - EndPos: 4860, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4857, - EndPos: 4860, - }, - Value: "Foo", - }, - }, - }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4862, - EndPos: 4865, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4865, - EndPos: 4867, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4871, - EndPos: 4881, - }, - Expr: &expr.StaticPropertyFetch{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4871, - EndPos: 4880, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4871, - EndPos: 4874, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4871, - EndPos: 4874, - }, - Value: "Foo", - }, - }, - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4876, - EndPos: 4880, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4876, - EndPos: 4880, - }, - Value: "bar", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4884, - EndPos: 4895, - }, - Expr: &expr.StaticPropertyFetch{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4884, - EndPos: 4894, - }, - Class: &expr.Variable{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4884, - EndPos: 4888, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4884, - EndPos: 4888, - }, - Value: "foo", - }, - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4890, - EndPos: 4894, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4890, - EndPos: 4894, - }, - Value: "bar", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4898, - EndPos: 4918, - }, - Expr: &expr.StaticPropertyFetch{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4898, - EndPos: 4917, - }, - Class: &name.Relative{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4898, - EndPos: 4911, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4908, - EndPos: 4911, - }, - Value: "Foo", - }, - }, - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4913, - EndPos: 4917, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4913, - EndPos: 4917, - }, - Value: "bar", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4921, - EndPos: 4932, - }, - Expr: &expr.StaticPropertyFetch{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4921, - EndPos: 4931, - }, - Class: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4921, - EndPos: 4925, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4922, - EndPos: 4925, - }, - Value: "Foo", - }, - }, - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4927, - EndPos: 4931, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4927, - EndPos: 4931, - }, - Value: "bar", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4935, - EndPos: 4948, - }, - Expr: &expr.Ternary{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4935, - EndPos: 4947, - }, - Condition: &expr.Variable{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4935, - EndPos: 4937, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4935, - EndPos: 4937, - }, - Value: "a", - }, - }, - IfTrue: &expr.Variable{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4940, - EndPos: 4942, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4940, - EndPos: 4942, - }, - Value: "b", - }, - }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4945, - EndPos: 4947, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4945, - EndPos: 4947, - }, - Value: "c", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4951, - EndPos: 4961, - }, - Expr: &expr.Ternary{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4951, - EndPos: 4960, - }, - Condition: &expr.Variable{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4951, - EndPos: 4953, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4951, - EndPos: 4953, - }, - Value: "a", - }, - }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4958, - EndPos: 4960, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4958, - EndPos: 4960, - }, - Value: "c", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4964, - EndPos: 4987, - }, - Expr: &expr.Ternary{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4964, - EndPos: 4986, - }, - Condition: &expr.Variable{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4964, - EndPos: 4966, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4964, - EndPos: 4966, - }, - Value: "a", - }, - }, - IfTrue: &expr.Ternary{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4969, - EndPos: 4981, - }, - Condition: &expr.Variable{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4969, - EndPos: 4971, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4969, - EndPos: 4971, - }, - Value: "b", - }, - }, - IfTrue: &expr.Variable{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4974, - EndPos: 4976, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4974, - EndPos: 4976, - }, - Value: "c", - }, - }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4979, - EndPos: 4981, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4979, - EndPos: 4981, - }, - Value: "d", - }, - }, - }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4984, - EndPos: 4986, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4984, - EndPos: 4986, - }, - Value: "e", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4990, - EndPos: 5013, - }, - Expr: &expr.Ternary{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4990, - EndPos: 5012, - }, - Condition: &expr.Ternary{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4990, - EndPos: 5002, - }, - Condition: &expr.Variable{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4990, - EndPos: 4992, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4990, - EndPos: 4992, - }, - Value: "a", - }, - }, - IfTrue: &expr.Variable{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4995, - EndPos: 4997, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4995, - EndPos: 4997, - }, - Value: "b", - }, - }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 5000, - EndPos: 5002, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 5000, - EndPos: 5002, - }, - Value: "c", - }, - }, - }, - IfTrue: &expr.Variable{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 5005, - EndPos: 5007, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 5005, - EndPos: 5007, - }, - Value: "d", - }, - }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 5010, - EndPos: 5012, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 5010, - EndPos: 5012, - }, - Value: "e", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 5016, - EndPos: 5020, - }, - Expr: &expr.UnaryMinus{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 5016, - EndPos: 5019, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 5017, - EndPos: 5019, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 5017, - EndPos: 5019, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 256, - EndLine: 256, - StartPos: 5023, - EndPos: 5027, - }, - Expr: &expr.UnaryPlus{ - Position: &position.Position{ - StartLine: 256, - EndLine: 256, - StartPos: 5023, - EndPos: 5026, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 256, - EndLine: 256, - StartPos: 5024, - EndPos: 5026, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 256, - EndLine: 256, - StartPos: 5024, - EndPos: 5026, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 5030, - EndPos: 5034, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 5030, - EndPos: 5033, - }, - VarName: &expr.Variable{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 5031, - EndPos: 5033, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 5031, - EndPos: 5033, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 258, - EndLine: 258, - StartPos: 5037, - EndPos: 5043, - }, - Expr: &expr.Yield{ - Position: &position.Position{ - StartLine: 258, - EndLine: 258, - StartPos: 5037, - EndPos: 5042, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 5046, - EndPos: 5055, - }, - Expr: &expr.Yield{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 5046, - EndPos: 5054, - }, - Value: &expr.Variable{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 5052, - EndPos: 5054, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 5052, - EndPos: 5054, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 5058, - EndPos: 5073, - }, - Expr: &expr.Yield{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 5058, - EndPos: 5072, - }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 5064, - EndPos: 5066, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 5064, - EndPos: 5066, - }, - Value: "a", - }, - }, - Value: &expr.Variable{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 5070, - EndPos: 5072, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 5070, - EndPos: 5072, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 5076, - EndPos: 5090, - }, - Expr: &expr.YieldFrom{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 5076, - EndPos: 5089, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 5087, - EndPos: 5089, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 5087, - EndPos: 5089, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 5096, - EndPos: 5106, - }, - Expr: &cast.Array{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 5096, - EndPos: 5105, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 5103, - EndPos: 5105, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 5103, - EndPos: 5105, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 5109, - EndPos: 5121, - }, - Expr: &cast.Bool{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 5109, - EndPos: 5120, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 5118, - EndPos: 5120, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 5118, - EndPos: 5120, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 5124, - EndPos: 5133, - }, - Expr: &cast.Bool{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 5124, - EndPos: 5132, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 5130, - EndPos: 5132, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 5130, - EndPos: 5132, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 5136, - EndPos: 5147, - }, - Expr: &cast.Double{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 5136, - EndPos: 5146, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 5144, - EndPos: 5146, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 5144, - EndPos: 5146, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 267, - EndLine: 267, - StartPos: 5150, - EndPos: 5160, - }, - Expr: &cast.Double{ - Position: &position.Position{ - StartLine: 267, - EndLine: 267, - StartPos: 5150, - EndPos: 5159, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 267, - EndLine: 267, - StartPos: 5157, - EndPos: 5159, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 267, - EndLine: 267, - StartPos: 5157, - EndPos: 5159, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 5163, - EndPos: 5175, - }, - Expr: &cast.Int{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 5163, - EndPos: 5174, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 5172, - EndPos: 5174, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 5172, - EndPos: 5174, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 5178, - EndPos: 5186, - }, - Expr: &cast.Int{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 5178, - EndPos: 5185, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 5183, - EndPos: 5185, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 5183, - EndPos: 5185, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 5189, - EndPos: 5200, - }, - Expr: &cast.Object{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 5189, - EndPos: 5199, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 5197, - EndPos: 5199, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 5197, - EndPos: 5199, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 5203, - EndPos: 5214, - }, - Expr: &cast.String{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 5203, - EndPos: 5213, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 5211, - EndPos: 5213, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 5211, - EndPos: 5213, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 5217, - EndPos: 5227, - }, - Expr: &cast.Unset{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 5217, - EndPos: 5226, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 5224, - EndPos: 5226, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 5224, - EndPos: 5226, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 5231, - EndPos: 5239, - }, - Expr: &binary.BitwiseAnd{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 5231, - EndPos: 5238, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 5231, - EndPos: 5233, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 5231, - EndPos: 5233, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 5236, - EndPos: 5238, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 5236, - EndPos: 5238, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 5242, - EndPos: 5250, - }, - Expr: &binary.BitwiseOr{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 5242, - EndPos: 5249, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 5242, - EndPos: 5244, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 5242, - EndPos: 5244, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 5247, - EndPos: 5249, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 5247, - EndPos: 5249, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 5253, - EndPos: 5261, - }, - Expr: &binary.BitwiseXor{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 5253, - EndPos: 5260, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 5253, - EndPos: 5255, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 5253, - EndPos: 5255, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 5258, - EndPos: 5260, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 5258, - EndPos: 5260, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 5264, - EndPos: 5273, - }, - Expr: &binary.BooleanAnd{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 5264, - EndPos: 5272, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 5264, - EndPos: 5266, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 5264, - EndPos: 5266, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 5270, - EndPos: 5272, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 5270, - EndPos: 5272, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 5276, - EndPos: 5285, - }, - Expr: &binary.BooleanOr{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 5276, - EndPos: 5284, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 5276, - EndPos: 5278, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 5276, - EndPos: 5278, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 5282, - EndPos: 5284, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 5282, - EndPos: 5284, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 5288, - EndPos: 5297, - }, - Expr: &binary.Coalesce{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 5288, - EndPos: 5296, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 5288, - EndPos: 5290, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 5288, - EndPos: 5290, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 5294, - EndPos: 5296, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 5294, - EndPos: 5296, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 5300, - EndPos: 5308, - }, - Expr: &binary.Concat{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 5300, - EndPos: 5307, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 5300, - EndPos: 5302, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 5300, - EndPos: 5302, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 5305, - EndPos: 5307, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 5305, - EndPos: 5307, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 5311, - EndPos: 5319, - }, - Expr: &binary.Div{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 5311, - EndPos: 5318, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 5311, - EndPos: 5313, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 5311, - EndPos: 5313, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 5316, - EndPos: 5318, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 5316, - EndPos: 5318, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 5322, - EndPos: 5331, - }, - Expr: &binary.Equal{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 5322, - EndPos: 5330, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 5322, - EndPos: 5324, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 5322, - EndPos: 5324, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 5328, - EndPos: 5330, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 5328, - EndPos: 5330, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 5334, - EndPos: 5343, - }, - Expr: &binary.GreaterOrEqual{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 5334, - EndPos: 5342, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 5334, - EndPos: 5336, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 5334, - EndPos: 5336, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 5340, - EndPos: 5342, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 5340, - EndPos: 5342, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 5346, - EndPos: 5354, - }, - Expr: &binary.Greater{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 5346, - EndPos: 5353, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 5346, - EndPos: 5348, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 5346, - EndPos: 5348, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 5351, - EndPos: 5353, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 5351, - EndPos: 5353, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 5357, - EndPos: 5367, - }, - Expr: &binary.Identical{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 5357, - EndPos: 5366, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 5357, - EndPos: 5359, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 5357, - EndPos: 5359, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 5364, - EndPos: 5366, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 5364, - EndPos: 5366, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 5370, - EndPos: 5380, - }, - Expr: &binary.LogicalAnd{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 5370, - EndPos: 5379, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 5370, - EndPos: 5372, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 5370, - EndPos: 5372, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 5377, - EndPos: 5379, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 5377, - EndPos: 5379, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 5383, - EndPos: 5392, - }, - Expr: &binary.LogicalOr{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 5383, - EndPos: 5391, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 5383, - EndPos: 5385, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 5383, - EndPos: 5385, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 5389, - EndPos: 5391, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 5389, - EndPos: 5391, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 5395, - EndPos: 5405, - }, - Expr: &binary.LogicalXor{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 5395, - EndPos: 5404, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 5395, - EndPos: 5397, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 5395, - EndPos: 5397, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 5402, - EndPos: 5404, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 5402, - EndPos: 5404, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 5408, - EndPos: 5416, - }, - Expr: &binary.Minus{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 5408, - EndPos: 5415, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 5408, - EndPos: 5410, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 5408, - EndPos: 5410, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 5413, - EndPos: 5415, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 5413, - EndPos: 5415, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 5419, - EndPos: 5427, - }, - Expr: &binary.Mod{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 5419, - EndPos: 5426, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 5419, - EndPos: 5421, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 5419, - EndPos: 5421, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 5424, - EndPos: 5426, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 5424, - EndPos: 5426, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 5430, - EndPos: 5438, - }, - Expr: &binary.Mul{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 5430, - EndPos: 5437, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 5430, - EndPos: 5432, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 5430, - EndPos: 5432, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 5435, - EndPos: 5437, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 5435, - EndPos: 5437, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 5441, - EndPos: 5450, - }, - Expr: &binary.NotEqual{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 5441, - EndPos: 5449, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 5441, - EndPos: 5443, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 5441, - EndPos: 5443, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 5447, - EndPos: 5449, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 5447, - EndPos: 5449, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 5453, - EndPos: 5463, - }, - Expr: &binary.NotIdentical{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 5453, - EndPos: 5462, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 5453, - EndPos: 5455, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 5453, - EndPos: 5455, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 5460, - EndPos: 5462, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 5460, - EndPos: 5462, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 5466, - EndPos: 5474, - }, - Expr: &binary.Plus{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 5466, - EndPos: 5473, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 5466, - EndPos: 5468, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 5466, - EndPos: 5468, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 5471, - EndPos: 5473, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 5471, - EndPos: 5473, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5477, - EndPos: 5486, - }, - Expr: &binary.Pow{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5477, - EndPos: 5485, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5477, - EndPos: 5479, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5477, - EndPos: 5479, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5483, - EndPos: 5485, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5483, - EndPos: 5485, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5489, - EndPos: 5498, - }, - Expr: &binary.ShiftLeft{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5489, - EndPos: 5497, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5489, - EndPos: 5491, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5489, - EndPos: 5491, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5495, - EndPos: 5497, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5495, - EndPos: 5497, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 5501, - EndPos: 5510, - }, - Expr: &binary.ShiftRight{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 5501, - EndPos: 5509, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 5501, - EndPos: 5503, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 5501, - EndPos: 5503, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 5507, - EndPos: 5509, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 5507, - EndPos: 5509, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 5513, - EndPos: 5522, - }, - Expr: &binary.SmallerOrEqual{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 5513, - EndPos: 5521, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 5513, - EndPos: 5515, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 5513, - EndPos: 5515, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 5519, - EndPos: 5521, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 5519, - EndPos: 5521, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5525, - EndPos: 5533, - }, - Expr: &binary.Smaller{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5525, - EndPos: 5532, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5525, - EndPos: 5527, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5525, - EndPos: 5527, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5530, - EndPos: 5532, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5530, - EndPos: 5532, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5536, - EndPos: 5546, - }, - Expr: &binary.Spaceship{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5536, - EndPos: 5545, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5536, - EndPos: 5538, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5536, - EndPos: 5538, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5543, - EndPos: 5545, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5543, - EndPos: 5545, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5550, - EndPos: 5559, - }, - Expr: &assign.Reference{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5550, - EndPos: 5558, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5550, - EndPos: 5552, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5550, - EndPos: 5552, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5556, - EndPos: 5558, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5556, - EndPos: 5558, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5562, - EndPos: 5570, - }, - Expr: &assign.Assign{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5562, - EndPos: 5569, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5562, - EndPos: 5564, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5562, - EndPos: 5564, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5567, - EndPos: 5569, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5567, - EndPos: 5569, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5573, - EndPos: 5582, - }, - Expr: &assign.BitwiseAnd{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5573, - EndPos: 5581, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5573, - EndPos: 5575, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5573, - EndPos: 5575, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5579, - EndPos: 5581, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5579, - EndPos: 5581, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5585, - EndPos: 5594, - }, - Expr: &assign.BitwiseOr{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5585, - EndPos: 5593, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5585, - EndPos: 5587, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5585, - EndPos: 5587, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5591, - EndPos: 5593, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5591, - EndPos: 5593, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5597, - EndPos: 5606, - }, - Expr: &assign.BitwiseXor{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5597, - EndPos: 5605, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5597, - EndPos: 5599, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5597, - EndPos: 5599, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5603, - EndPos: 5605, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5603, - EndPos: 5605, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5609, - EndPos: 5618, - }, - Expr: &assign.Concat{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5609, - EndPos: 5617, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5609, - EndPos: 5611, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5609, - EndPos: 5611, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5615, - EndPos: 5617, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5615, - EndPos: 5617, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5621, - EndPos: 5630, - }, - Expr: &assign.Div{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5621, - EndPos: 5629, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5621, - EndPos: 5623, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5621, - EndPos: 5623, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5627, - EndPos: 5629, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5627, - EndPos: 5629, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5633, - EndPos: 5642, - }, - Expr: &assign.Minus{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5633, - EndPos: 5641, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5633, - EndPos: 5635, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5633, - EndPos: 5635, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5639, - EndPos: 5641, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5639, - EndPos: 5641, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5645, - EndPos: 5654, - }, - Expr: &assign.Mod{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5645, - EndPos: 5653, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5645, - EndPos: 5647, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5645, - EndPos: 5647, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5651, - EndPos: 5653, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5651, - EndPos: 5653, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5657, - EndPos: 5666, - }, - Expr: &assign.Mul{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5657, - EndPos: 5665, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5657, - EndPos: 5659, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5657, - EndPos: 5659, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5663, - EndPos: 5665, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5663, - EndPos: 5665, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5669, - EndPos: 5678, - }, - Expr: &assign.Plus{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5669, - EndPos: 5677, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5669, - EndPos: 5671, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5669, - EndPos: 5671, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5675, - EndPos: 5677, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5675, - EndPos: 5677, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5681, - EndPos: 5691, - }, - Expr: &assign.Pow{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5681, - EndPos: 5690, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5681, - EndPos: 5683, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5681, - EndPos: 5683, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5688, - EndPos: 5690, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5688, - EndPos: 5690, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5694, - EndPos: 5704, - }, - Expr: &assign.ShiftLeft{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5694, - EndPos: 5703, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5694, - EndPos: 5696, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5694, - EndPos: 5696, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5701, - EndPos: 5703, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5701, - EndPos: 5703, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5707, - EndPos: 5717, - }, - Expr: &assign.ShiftRight{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5707, - EndPos: 5716, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5707, - EndPos: 5709, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5707, - EndPos: 5709, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5714, - EndPos: 5716, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5714, - EndPos: 5716, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5721, - EndPos: 5760, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5727, - EndPos: 5730, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5732, - EndPos: 5758, - }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5748, - EndPos: 5753, - }, - Value: "class", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5732, - EndPos: 5738, - }, - Value: "public", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5756, - EndPos: 5758, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5763, - EndPos: 5774, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5763, - EndPos: 5773, - }, - Function: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5763, - EndPos: 5771, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5764, - EndPos: 5767, - }, - Value: "foo", - }, - &name.NamePart{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5768, - EndPos: 5771, - }, - Value: "bar", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5771, - EndPos: 5773, - }, - }, - }, - }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 320, - EndLine: 326, - StartPos: 5778, - EndPos: 5905, - }, - PhpDocComment: "", - ReturnsRef: false, - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5787, - EndPos: 5790, - }, - Value: "foo", - }, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5791, - EndPos: 5794, - }, - ByRef: true, - Variadic: false, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5792, - EndPos: 5794, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5792, - EndPos: 5794, - }, - Value: "a", - }, - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5796, - EndPos: 5801, - }, - ByRef: false, - Variadic: true, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5799, - EndPos: 5801, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5799, - EndPos: 5801, - }, - Value: "b", - }, - }, - }, - }, - Stmts: []node.Node{ - &stmt.Function{ - Position: &position.Position{ - StartLine: 322, - EndLine: 322, - StartPos: 5830, - EndPos: 5847, - }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 322, - EndLine: 322, - StartPos: 5839, - EndPos: 5842, - }, - Value: "bar", - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 323, - EndLine: 323, - StartPos: 5851, - EndPos: 5863, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 323, - EndLine: 323, - StartPos: 5857, - EndPos: 5860, - }, - Value: "Baz", - }, - Stmts: []node.Node{}, - }, - &stmt.Trait{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5867, - EndPos: 5879, - }, - PhpDocComment: "", - TraitName: &node.Identifier{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5873, - EndPos: 5877, - }, - Value: "Quux", - }, - Stmts: []node.Node{}, - }, - &stmt.Interface{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5883, - EndPos: 5901, - }, - PhpDocComment: "", - InterfaceName: &node.Identifier{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5893, - EndPos: 5898, - }, - Value: "Quuux", - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5911, - EndPos: 5954, - }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5920, - EndPos: 5923, - }, - Value: "foo", - }, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5924, - EndPos: 5931, - }, - ByRef: true, - Variadic: false, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5925, - EndPos: 5927, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5925, - EndPos: 5927, - }, - Value: "a", - }, - }, - DefaultValue: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5930, - EndPos: 5931, - }, - Value: "1", - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5933, - EndPos: 5942, - }, - ByRef: false, - Variadic: true, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5936, - EndPos: 5938, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5936, - EndPos: 5938, - }, - Value: "b", - }, - }, - DefaultValue: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5941, - EndPos: 5942, - }, - Value: "1", - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5944, - EndPos: 5950, - }, - ByRef: false, - Variadic: false, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5944, - EndPos: 5946, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5944, - EndPos: 5946, - }, - Value: "c", - }, - }, - DefaultValue: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5949, - EndPos: 5950, - }, - Value: "1", - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5957, - EndPos: 5995, - }, - PhpDocComment: "", - ReturnsRef: false, - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5966, - EndPos: 5969, - }, - Value: "foo", - }, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5970, - EndPos: 5978, - }, - ByRef: false, - Variadic: false, - VariableType: &node.Identifier{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5970, - EndPos: 5975, - }, - Value: "array", - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5976, - EndPos: 5978, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5976, - EndPos: 5978, - }, - Value: "a", - }, - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5980, - EndPos: 5991, - }, - Variadic: false, - ByRef: false, - VariableType: &node.Identifier{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5980, - EndPos: 5988, - }, - Value: "callable", - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5989, - EndPos: 5991, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5989, - EndPos: 5991, - }, - Value: "b", - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5998, - EndPos: 6100, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6019, - EndPos: 6022, - }, - Value: "foo", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5998, - EndPos: 6006, - }, - Value: "abstract", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6007, - EndPos: 6012, - }, - Value: "final", - }, - }, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6025, - EndPos: 6066, - }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6060, - EndPos: 6063, - }, - Value: "bar", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6025, - EndPos: 6033, - }, - Value: "abstract", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6034, - EndPos: 6043, - }, - Value: "protected", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6044, - EndPos: 6050, - }, - Value: "static", - }, - }, - Stmt: &stmt.Nop{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6065, - EndPos: 6066, - }, - }, - }, - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6067, - EndPos: 6098, - }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6090, - EndPos: 6093, - }, - Value: "baz", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6067, - EndPos: 6072, - }, - Value: "final", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6073, - EndPos: 6080, - }, - Value: "private", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6096, - EndPos: 6098, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6105, - EndPos: 6119, - }, - Expr: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6105, - EndPos: 6118, - }, - Variable: &expr.New{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6105, - EndPos: 6112, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6109, - EndPos: 6112, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6109, - EndPos: 6112, - }, - Value: "Foo", - }, - }, - }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6115, - EndPos: 6118, - }, - Value: "bar", - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6123, - EndPos: 6134, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6123, - EndPos: 6133, - }, - Function: &expr.New{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6123, - EndPos: 6130, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6127, - EndPos: 6130, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6127, - EndPos: 6130, - }, - Value: "Foo", - }, - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6131, - EndPos: 6133, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6137, - EndPos: 6149, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6137, - EndPos: 6148, - }, - Function: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6137, - EndPos: 6146, - }, - Variable: &expr.ShortArray{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6137, - EndPos: 6143, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6138, - EndPos: 6142, - }, - Val: &expr.Variable{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6138, - EndPos: 6142, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6138, - EndPos: 6142, - }, - Value: "foo", - }, - }, - }, - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6144, - EndPos: 6145, - }, - Value: "0", - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6146, - EndPos: 6148, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6152, - EndPos: 6161, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6152, - EndPos: 6160, - }, - Function: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6152, - EndPos: 6158, - }, - Variable: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6152, - EndPos: 6155, - }, - Constant: &name.Name{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6152, - EndPos: 6155, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6152, - EndPos: 6155, - }, - Value: "foo", - }, - }, - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6156, - EndPos: 6157, - }, - Value: "1", - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6158, - EndPos: 6160, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 6164, - EndPos: 6172, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 6164, - EndPos: 6171, - }, - Function: &scalar.String{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 6164, - EndPos: 6169, - }, - Value: "\"foo\"", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 6169, - EndPos: 6171, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6175, - EndPos: 6187, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6175, - EndPos: 6186, - }, - Function: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6175, - EndPos: 6184, - }, - Variable: &expr.ShortArray{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6175, - EndPos: 6178, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6176, - EndPos: 6177, - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6176, - EndPos: 6177, - }, - Value: "1", - }, - }, - }, - }, - Dim: &expr.Variable{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6179, - EndPos: 6183, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6179, - EndPos: 6183, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6184, - EndPos: 6186, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6190, - EndPos: 6199, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6190, - EndPos: 6198, - }, - VarName: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6192, - EndPos: 6197, - }, - Function: &name.Name{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6192, - EndPos: 6195, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6192, - EndPos: 6195, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6195, - EndPos: 6197, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6203, - EndPos: 6215, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6203, - EndPos: 6214, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6203, - EndPos: 6206, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6203, - EndPos: 6206, - }, - Value: "Foo", - }, - }, - }, - Call: &expr.Variable{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6208, - EndPos: 6212, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6208, - EndPos: 6212, - }, - Value: "bar", - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6212, - EndPos: 6214, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6218, - EndPos: 6235, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6218, - EndPos: 6234, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6218, - EndPos: 6221, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6218, - EndPos: 6221, - }, - Value: "Foo", - }, - }, - }, - Call: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6224, - EndPos: 6231, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6224, - EndPos: 6228, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6224, - EndPos: 6228, - }, - Value: "bar", - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6229, - EndPos: 6230, - }, - Value: "0", - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6232, - EndPos: 6234, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6241, - EndPos: 6252, - }, - Expr: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6241, - EndPos: 6251, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6241, - EndPos: 6245, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6241, - EndPos: 6245, - }, - Value: "foo", - }, - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6247, - EndPos: 6251, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6247, - EndPos: 6251, - }, - Value: "bar", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6255, - EndPos: 6271, - }, - Expr: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6255, - EndPos: 6269, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6255, - EndPos: 6259, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6255, - EndPos: 6259, - }, - Value: "foo", - }, - }, - Property: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6262, - EndPos: 6269, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6262, - EndPos: 6266, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6262, - EndPos: 6266, - }, - Value: "bar", - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6267, - EndPos: 6268, - }, - Value: "0", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6275, - EndPos: 6297, - }, - Expr: &expr.ShortArray{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6275, - EndPos: 6296, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6276, - EndPos: 6282, - }, - Key: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6276, - EndPos: 6277, - }, - Value: "1", - }, - Val: &expr.Reference{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6279, - EndPos: 6282, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6280, - EndPos: 6282, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6280, - EndPos: 6282, - }, - Value: "a", - }, - }, - }, - }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6284, - EndPos: 6295, - }, - Key: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6284, - EndPos: 6285, - }, - Value: "2", - }, - Val: &expr.List{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6287, - EndPos: 6295, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6292, - EndPos: 6294, - }, - Val: &expr.Variable{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6292, - EndPos: 6294, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6292, - EndPos: 6294, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - }, - }, - &stmt.HaltCompiler{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 6301, - EndPos: 6319, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - -func TestPhp5Strings(t *testing.T) { - src := `", strings.Repeat(" ", v.depth), key, ":\n") @@ -90,14 +89,14 @@ func (v *testVisitor) Identifier(_ *ast.Identifier) { fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.Identifier") } -func (v *testVisitor) ArgumentList(_ *ast.ArgumentList) { +func (v *testVisitor) ArgumentList(_ *ast.ArgumentList) { fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.ArgumentList") } -func (v *testVisitor) Argument(_ *ast.Argument) { +func (v *testVisitor) Argument(_ *ast.Argument) { fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.Argument") } -func (v *testVisitor) ScalarDnumber(_ *ast.ScalarDnumber) { +func (v *testVisitor) ScalarDnumber(_ *ast.ScalarDnumber) { fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.ScalarDnumber") } diff --git a/pkg/ast/node.go b/pkg/ast/node.go index b8b486e..99b34a3 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -8,6 +8,7 @@ import ( type Node struct { StartTokens []token.Token EndTokens []token.Token + Tokens token.Collection Position *position.Position } @@ -52,7 +53,7 @@ func (n *Parameter) Accept(v NodeVisitor) { // Identifier node type Identifier struct { Node - Value string + Value []byte } func (n *Identifier) Accept(v NodeVisitor) { @@ -84,7 +85,7 @@ func (n *Argument) Accept(v NodeVisitor) { // ScalarDnumber node type ScalarDnumber struct { Node - Value string + Value []byte } func (n *ScalarDnumber) Accept(v NodeVisitor) { @@ -104,7 +105,7 @@ func (n *ScalarEncapsed) Accept(v NodeVisitor) { // ScalarEncapsedStringPart node type ScalarEncapsedStringPart struct { Node - Value string + Value []byte } func (n *ScalarEncapsedStringPart) Accept(v NodeVisitor) { @@ -114,7 +115,7 @@ func (n *ScalarEncapsedStringPart) Accept(v NodeVisitor) { // ScalarHeredoc node type ScalarHeredoc struct { Node - Label string + Label []byte Parts []Vertex } @@ -125,7 +126,7 @@ func (n *ScalarHeredoc) Accept(v NodeVisitor) { // ScalarLnumber node type ScalarLnumber struct { Node - Value string + Value []byte } func (n *ScalarLnumber) Accept(v NodeVisitor) { @@ -135,7 +136,7 @@ func (n *ScalarLnumber) Accept(v NodeVisitor) { // ScalarMagicConstant node type ScalarMagicConstant struct { Node - Value string + Value []byte } func (n *ScalarMagicConstant) Accept(v NodeVisitor) { @@ -145,7 +146,7 @@ func (n *ScalarMagicConstant) Accept(v NodeVisitor) { // ScalarString node type ScalarString struct { Node - Value string + Value []byte } func (n *ScalarString) Accept(v NodeVisitor) { @@ -550,7 +551,7 @@ func (n *StmtIf) Accept(v NodeVisitor) { // StmtInlineHtml node type StmtInlineHtml struct { Node - Value string + Value []byte } func (n *StmtInlineHtml) Accept(v NodeVisitor) { @@ -1803,3 +1804,39 @@ type ExprBinarySpaceship struct { func (n *ExprBinarySpaceship) Accept(v NodeVisitor) { v.ExprBinarySpaceship(n) } + +type NameName struct { + Node + Parts []Vertex +} + +func (n *NameName) Accept(v NodeVisitor) { + v.NameName(n) +} + +type NameFullyQualified struct { + Node + Parts []Vertex +} + +func (n *NameFullyQualified) Accept(v NodeVisitor) { + v.NameFullyQualified(n) +} + +type NameRelative struct { + Node + Parts []Vertex +} + +func (n *NameRelative) Accept(v NodeVisitor) { + v.NameRelative(n) +} + +type NameNamePart struct { + Node + Value []byte +} + +func (n *NameNamePart) Accept(v NodeVisitor) { + v.NameNamePart(n) +} diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index b013607..a000a59 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -73,7 +73,7 @@ func (v *Dump) EnterNode(n ast.Vertex) bool { } n.Accept(v) - + return true } diff --git a/pkg/ast/visitor/dump_test.go b/pkg/ast/visitor/dump_test.go index 5d2277d..b1f5153 100644 --- a/pkg/ast/visitor/dump_test.go +++ b/pkg/ast/visitor/dump_test.go @@ -13,8 +13,7 @@ func ExampleDump() { &ast.Identifier{}, &ast.Parameter{ Variadic: true, - Var: &ast.ExprVariable{ - }, + Var: &ast.ExprVariable{}, }, &ast.StmtInlineHtml{ Value: "foo", diff --git a/errors/error.go b/pkg/errors/error.go similarity index 90% rename from errors/error.go rename to pkg/errors/error.go index 63e480e..623dc07 100644 --- a/errors/error.go +++ b/pkg/errors/error.go @@ -3,7 +3,7 @@ package errors import ( "fmt" - "github.com/z7zmey/php-parser/position" + "github.com/z7zmey/php-parser/pkg/position" ) // Error parsing error diff --git a/errors/error_test.go b/pkg/errors/error_test.go similarity index 100% rename from errors/error_test.go rename to pkg/errors/error_test.go diff --git a/parser/parser.go b/pkg/parser/parser.go similarity index 59% rename from parser/parser.go rename to pkg/parser/parser.go index c05b22d..9f804c3 100644 --- a/parser/parser.go +++ b/pkg/parser/parser.go @@ -1,19 +1,19 @@ package parser import ( - "github.com/z7zmey/php-parser/errors" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/php5" - "github.com/z7zmey/php-parser/php7" - "github.com/z7zmey/php-parser/version" + "github.com/z7zmey/php-parser/internal/php5" + "github.com/z7zmey/php-parser/internal/php7" + "github.com/z7zmey/php-parser/internal/version" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/errors" ) // Parser interface type Parser interface { Parse() int - GetRootNode() node.Node + GetRootNode() ast.Vertex GetErrors() []*errors.Error - WithFreeFloating() + WithTokens() } func NewParser(src []byte, v string) (Parser, error) { diff --git a/freefloating/string.go b/pkg/token/position.go similarity index 66% rename from freefloating/string.go rename to pkg/token/position.go index ee05c36..209ed9d 100644 --- a/freefloating/string.go +++ b/pkg/token/position.go @@ -1,17 +1,9 @@ -package freefloating - -import "github.com/z7zmey/php-parser/position" - -type StringType int - -const ( - WhiteSpaceType StringType = iota - CommentType - TokenType -) +package token type Position int +type Collection map[Position][]Token + //go:generate stringer -type=Position -output ./position_string.go const ( Start Position = iota @@ -94,20 +86,3 @@ const ( OpenParenthesisToken CloseParenthesisToken ) - -type String struct { - StringType StringType - Value string - Position *position.Position -} - -type Collection map[Position][]String - -func (c Collection) IsEmpty() bool { - for _, v := range c { - if len(v) > 0 { - return false - } - } - return true -} diff --git a/freefloating/position_string.go b/pkg/token/position_string.go similarity index 99% rename from freefloating/position_string.go rename to pkg/token/position_string.go index 2428f22..cc51fe2 100644 --- a/freefloating/position_string.go +++ b/pkg/token/position_string.go @@ -1,6 +1,6 @@ // Code generated by "stringer -type=Position -output ./position_string.go"; DO NOT EDIT. -package freefloating +package token import "strconv" diff --git a/pkg/token/token.go b/pkg/token/token.go index a79915d..6ba52d6 100644 --- a/pkg/token/token.go +++ b/pkg/token/token.go @@ -1,9 +1,9 @@ package token -type TokenID int +type ID int const ( - T_INCLUDE TokenID = iota + 57346 + T_INCLUDE ID = iota + 57346 T_INCLUDE_ONCE T_EXIT T_IF @@ -144,6 +144,6 @@ const ( ) type Token struct { - ID TokenID + ID ID Value []byte } diff --git a/position/position.go b/position/position.go deleted file mode 100644 index d4099cd..0000000 --- a/position/position.go +++ /dev/null @@ -1,27 +0,0 @@ -package position - -import ( - "fmt" -) - -// Position represents node position -type Position struct { - StartLine int - EndLine int - StartPos int - EndPos int -} - -// NewPosition Position constructor -func NewPosition(StartLine int, EndLine int, StartPos int, EndPos int) *Position { - return &Position{ - StartLine: StartLine, - EndLine: EndLine, - StartPos: StartPos, - EndPos: EndPos, - } -} - -func (p Position) String() string { - return fmt.Sprintf("Pos{Line: %d-%d Pos: %d-%d}", p.StartLine, p.EndLine, p.StartPos, p.EndPos) -} diff --git a/position/position_test.go b/position/position_test.go deleted file mode 100644 index 0e322b6..0000000 --- a/position/position_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package position_test - -import ( - "testing" - - "github.com/z7zmey/php-parser/position" -) - -func TestPrintPosition(t *testing.T) { - pos := position.NewPosition(1, 1, 2, 5) - - expected := "Pos{Line: 1-1 Pos: 2-5}" - - actual := pos.String() - - if expected != actual { - t.Errorf("expected and actual are not equal\n") - } -} diff --git a/positionbuilder/position_builder_test.go b/positionbuilder/position_builder_test.go deleted file mode 100644 index fd8fa2b..0000000 --- a/positionbuilder/position_builder_test.go +++ /dev/null @@ -1,463 +0,0 @@ -package positionbuilder_test - -import ( - "testing" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/positionbuilder" - - "github.com/z7zmey/php-parser/scanner" -) - -func TestNewTokenPosition(t *testing.T) { - builder := positionbuilder.PositionBuilder{} - - tkn := &scanner.Token{ - Value: `foo`, - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 3, - } - - pos := builder.NewTokenPosition(tkn) - - if pos.String() != `Pos{Line: 1-1 Pos: 0-3}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewTokensPosition(t *testing.T) { - builder := positionbuilder.PositionBuilder{} - - token1 := &scanner.Token{ - Value: `foo`, - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 3, - } - token2 := &scanner.Token{ - Value: `foo`, - StartLine: 2, - EndLine: 2, - StartPos: 4, - EndPos: 6, - } - - pos := builder.NewTokensPosition(token1, token2) - - if pos.String() != `Pos{Line: 1-2 Pos: 0-6}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewNodePosition(t *testing.T) { - n := node.NewIdentifier("test node") - n.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 3, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodePosition(n) - - if pos.String() != `Pos{Line: 1-1 Pos: 0-3}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewTokenNodePosition(t *testing.T) { - tkn := &scanner.Token{ - Value: `foo`, - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 3, - } - n := node.NewIdentifier("test node") - n.SetPosition(&position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 4, - EndPos: 12, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewTokenNodePosition(tkn, n) - - if pos.String() != `Pos{Line: 1-2 Pos: 0-12}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewNodeTokenPosition(t *testing.T) { - n := node.NewIdentifier("test node") - n.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 9, - }) - - tkn := &scanner.Token{ - Value: `foo`, - StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 12, - } - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeTokenPosition(n, tkn) - - if pos.String() != `Pos{Line: 1-2 Pos: 0-12}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewNodeListPosition(t *testing.T) { - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 9, - }) - - n2 := node.NewIdentifier("test node") - n2.SetPosition(&position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 19, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeListPosition([]node.Node{n1, n2}) - - if pos.String() != `Pos{Line: 1-2 Pos: 0-19}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewNodesPosition(t *testing.T) { - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 9, - }) - - n2 := node.NewIdentifier("test node") - n2.SetPosition(&position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 19, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodesPosition(n1, n2) - - if pos.String() != `Pos{Line: 1-2 Pos: 0-19}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewNodeListTokenPosition(t *testing.T) { - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 9, - }) - - n2 := node.NewIdentifier("test node") - n2.SetPosition(&position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 19, - }) - - tkn := &scanner.Token{ - Value: `foo`, - StartLine: 3, - EndLine: 3, - StartPos: 20, - EndPos: 22, - } - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeListTokenPosition([]node.Node{n1, n2}, tkn) - - if pos.String() != `Pos{Line: 1-3 Pos: 0-22}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewTokenNodeListPosition(t *testing.T) { - tkn := &scanner.Token{ - Value: `foo`, - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 2, - } - - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 3, - EndPos: 10, - }) - - n2 := node.NewIdentifier("test node") - n2.SetPosition(&position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 11, - EndPos: 20, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewTokenNodeListPosition(tkn, []node.Node{n1, n2}) - - if pos.String() != `Pos{Line: 1-3 Pos: 0-20}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewNodeNodeListPosition(t *testing.T) { - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 8, - }) - - n2 := node.NewIdentifier("test node") - n2.SetPosition(&position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 17, - }) - - n3 := node.NewIdentifier("test node") - n3.SetPosition(&position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 18, - EndPos: 26, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeNodeListPosition(n1, []node.Node{n2, n3}) - - if pos.String() != `Pos{Line: 1-3 Pos: 0-26}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewNodeListNodePosition(t *testing.T) { - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 8, - }) - n2 := node.NewIdentifier("test node") - n2.SetPosition(&position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 17, - }) - n3 := node.NewIdentifier("test node") - n3.SetPosition(&position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 18, - EndPos: 26, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeListNodePosition([]node.Node{n1, n2}, n3) - - if pos.String() != `Pos{Line: 1-3 Pos: 0-26}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewOptionalListTokensPosition(t *testing.T) { - builder := positionbuilder.PositionBuilder{} - - token1 := &scanner.Token{ - Value: `foo`, - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 3, - } - token2 := &scanner.Token{ - Value: `foo`, - StartLine: 2, - EndLine: 2, - StartPos: 4, - EndPos: 6, - } - - pos := builder.NewOptionalListTokensPosition(nil, token1, token2) - - if pos.String() != `Pos{Line: 1-2 Pos: 0-6}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewOptionalListTokensPosition2(t *testing.T) { - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 8, - }) - n2 := node.NewIdentifier("test node") - n2.SetPosition(&position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 17, - }) - n3 := node.NewIdentifier("test node") - n3.SetPosition(&position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 18, - EndPos: 26, - }) - - builder := positionbuilder.PositionBuilder{} - - token1 := &scanner.Token{ - Value: `foo`, - StartLine: 4, - EndLine: 4, - StartPos: 27, - EndPos: 29, - } - token2 := &scanner.Token{ - Value: `foo`, - StartLine: 5, - EndLine: 5, - StartPos: 30, - EndPos: 32, - } - - pos := builder.NewOptionalListTokensPosition([]node.Node{n2, n3}, token1, token2) - - if pos.String() != `Pos{Line: 2-5 Pos: 9-32}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNilNodePos(t *testing.T) { - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodesPosition(nil, nil) - - if pos.String() != `Pos{Line: -1--1 Pos: -1--1}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNilNodeListPos(t *testing.T) { - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 8, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeNodeListPosition(n1, nil) - - if pos.String() != `Pos{Line: 1--1 Pos: 0--1}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNilNodeListTokenPos(t *testing.T) { - token := &scanner.Token{ - Value: `foo`, - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 3, - } - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeListTokenPosition(nil, token) - - if pos.String() != `Pos{Line: -1-1 Pos: -1-3}` { - t.Errorf("token value is not equal\n") - } -} - -func TestEmptyNodeListPos(t *testing.T) { - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 8, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeNodeListPosition(n1, []node.Node{}) - - if pos.String() != `Pos{Line: 1--1 Pos: 0--1}` { - t.Errorf("token value is not equal\n") - } -} - -func TestEmptyNodeListTokenPos(t *testing.T) { - token := &scanner.Token{ - Value: `foo`, - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 3, - } - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeListTokenPosition([]node.Node{}, token) - - if pos.String() != `Pos{Line: -1-1 Pos: -1-3}` { - t.Errorf("token value is not equal\n") - } -} diff --git a/scanner/token.go b/scanner/token.go deleted file mode 100644 index fcd66a4..0000000 --- a/scanner/token.go +++ /dev/null @@ -1,35 +0,0 @@ -package scanner - -import ( - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/position" -) - -// Token value returned by lexer -type Token struct { - Value string - FreeFloating []freefloating.String - StartLine int - EndLine int - StartPos int - EndPos int -} - -func (t *Token) String() string { - return string(t.Value) -} - -func (t *Token) GetFreeFloatingToken() []freefloating.String { - return []freefloating.String{ - { - StringType: freefloating.TokenType, - Value: t.Value, - Position: &position.Position{ - StartLine: t.StartLine, - EndLine: t.EndLine, - StartPos: t.StartPos, - EndPos: t.EndPos, - }, - }, - } -} diff --git a/scanner/token_test.go b/scanner/token_test.go deleted file mode 100644 index 0edf072..0000000 --- a/scanner/token_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package scanner_test - -import ( - "reflect" - "testing" - - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/scanner" -) - -func TestToken(t *testing.T) { - tkn := &scanner.Token{ - Value: `foo`, - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 3, - } - - c := []freefloating.String{ - { - Value: "test comment", - StringType: freefloating.CommentType, - Position: nil, - }, - } - - tkn.FreeFloating = c - - if !reflect.DeepEqual(tkn.FreeFloating, c) { - t.Errorf("comments are not equal\n") - } - - if tkn.String() != `foo` { - t.Errorf("token value is not equal\n") - } -} diff --git a/visitor/dumper.go b/visitor/dumper.go deleted file mode 100644 index 785679a..0000000 --- a/visitor/dumper.go +++ /dev/null @@ -1,83 +0,0 @@ -// Package visitor contains walker.visitor implementations -package visitor - -import ( - "fmt" - "io" - "reflect" - "strings" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/walker" -) - -// Dumper writes ast hierarchy to an io.Writer -// Also prints comments and positions attached to nodes -type Dumper struct { - Writer io.Writer - Indent string - NsResolver *NamespaceResolver -} - -// EnterNode is invoked at every node in hierarchy -func (d *Dumper) EnterNode(w walker.Walkable) bool { - n := w.(node.Node) - - fmt.Fprintf(d.Writer, "%v[%v]\n", d.Indent, reflect.TypeOf(n)) - - if n.GetPosition() != nil { - fmt.Fprintf(d.Writer, "%v\"Position\": %s\n", d.Indent+" ", n.GetPosition()) - } - - if d.NsResolver != nil { - if namespacedName, ok := d.NsResolver.ResolvedNames[n]; ok { - fmt.Fprintf(d.Writer, "%v\"NamespacedName\": %q\n", d.Indent+" ", namespacedName) - } - } - - if !n.GetFreeFloating().IsEmpty() { - fmt.Fprintf(d.Writer, "%v\"freefloating\":\n", d.Indent+" ") - for key, freeFloatingStrings := range *n.GetFreeFloating() { - for _, freeFloatingString := range freeFloatingStrings { - fmt.Fprintf(d.Writer, "%v%q: %q\n", d.Indent+" ", key.String(), freeFloatingString.Value) - } - } - } - - if a := n.Attributes(); len(a) > 0 { - for key, attr := range a { - switch attr.(type) { - case string: - fmt.Fprintf(d.Writer, "%v\"%v\": %q\n", d.Indent+" ", key, attr) - default: - fmt.Fprintf(d.Writer, "%v\"%v\": %v\n", d.Indent+" ", key, attr) - } - } - } - - return true -} - -// LeaveNode is invoked after node process -func (d *Dumper) LeaveNode(n walker.Walkable) { - // do nothing -} - -// GetChildrenVisitor is invoked at every node parameter that contains children nodes -func (d *Dumper) EnterChildNode(key string, w walker.Walkable) { - fmt.Fprintf(d.Writer, "%v%q:\n", d.Indent+" ", key) - d.Indent = d.Indent + " " -} - -func (d *Dumper) LeaveChildNode(key string, w walker.Walkable) { - d.Indent = strings.TrimSuffix(d.Indent, " ") -} - -func (d *Dumper) EnterChildList(key string, w walker.Walkable) { - fmt.Fprintf(d.Writer, "%v%q:\n", d.Indent+" ", key) - d.Indent = d.Indent + " " -} - -func (d *Dumper) LeaveChildList(key string, w walker.Walkable) { - d.Indent = strings.TrimSuffix(d.Indent, " ") -} diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go deleted file mode 100644 index cdfc78d..0000000 --- a/visitor/dumper_test.go +++ /dev/null @@ -1,151 +0,0 @@ -package visitor_test - -import ( - "os" - - "github.com/z7zmey/php-parser/php7" - "github.com/z7zmey/php-parser/visitor" -) - -func ExampleDumper() { - src := ` 0 { - for key, attr := range a { - printIndent(d.Writer, d.depth) - switch attr.(type) { - case string: - fmt.Fprintf(d.Writer, "%s: %q,\n", key, attr) - default: - fmt.Fprintf(d.Writer, "%s: %v,\n", key, attr) - } - } - } - - return true -} - -// LeaveNode is invoked after node process -func (d *GoDumper) LeaveNode(n walker.Walkable) { - d.depth-- - printIndent(d.Writer, d.depth) - if d.depth != 0 { - io.WriteString(d.Writer, "},\n") - } else { - io.WriteString(d.Writer, "}\n") - } -} - -func (d *GoDumper) EnterChildNode(key string, w walker.Walkable) { - printIndent(d.Writer, d.depth) - io.WriteString(d.Writer, key+": ") - d.isChildNode = true -} - -func (d *GoDumper) LeaveChildNode(key string, w walker.Walkable) { - // do nothing -} - -func (d *GoDumper) EnterChildList(key string, w walker.Walkable) { - printIndent(d.Writer, d.depth) - io.WriteString(d.Writer, key+": []node.Node{\n") - d.depth++ -} - -func (d *GoDumper) LeaveChildList(key string, w walker.Walkable) { - d.depth-- - printIndent(d.Writer, d.depth) - if d.depth != 0 { - io.WriteString(d.Writer, "},\n") - } -} diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go deleted file mode 100644 index 2970615..0000000 --- a/visitor/go_dumper_test.go +++ /dev/null @@ -1,528 +0,0 @@ -package visitor_test - -import ( - "os" - - "github.com/z7zmey/php-parser/php7" - "github.com/z7zmey/php-parser/visitor" -) - -func ExampleGoDumper() { - src := ` 0 { - var attributes []string - for key := range n.Attributes() { - attributes = append(attributes, key) - } - - sort.Strings(attributes) - - for _, attributeName := range attributes { - attr := a[attributeName] - switch attr.(type) { - case string: - fmt.Fprintf(d.Writer, ",\"%s\":%q", attributeName, attr) - default: - fmt.Fprintf(d.Writer, ",\"%s\":%v", attributeName, attr) - } - } - } - - return true -} - -// LeaveNode is invoked after node process -func (d *JsonDumper) LeaveNode(n walker.Walkable) { - fmt.Fprint(d.Writer, "}") -} - -func (d *JsonDumper) EnterChildNode(key string, w walker.Walkable) { - fmt.Fprintf(d.Writer, ",%q:", key) - d.isChildNode = true -} - -func (d *JsonDumper) LeaveChildNode(key string, w walker.Walkable) { - // do nothing -} - -func (d *JsonDumper) EnterChildList(key string, w walker.Walkable) { - fmt.Fprintf(d.Writer, ",%q:[", key) - d.isNotFirstNode = false - -} - -func (d *JsonDumper) LeaveChildList(key string, w walker.Walkable) { - fmt.Fprint(d.Writer, "]") -} diff --git a/visitor/json_dumper_test.go b/visitor/json_dumper_test.go deleted file mode 100644 index b803fc3..0000000 --- a/visitor/json_dumper_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package visitor_test - -import ( - "os" - - "github.com/z7zmey/php-parser/php7" - "github.com/z7zmey/php-parser/visitor" -) - -func ExampleJsonDumper() { - src := ` 1 { - // if name qualified, replace first part by alias - return aliasName + "\\" + concatNameParts(n.Parts[1:]), nil - } - - return aliasName, nil - } - - return "", errors.New("must be instance of name.Names") -} - -// ResolveAlias returns alias or error if not found -func (ns *Namespace) ResolveAlias(nameNode node.Node, aliasType string) (string, error) { - aliasType = strings.ToLower(aliasType) - nameParts := nameNode.(*name.Name).Parts - - firstPartStr := nameParts[0].(*name.NamePart).Value - - if len(nameParts) > 1 { // resolve aliases for qualified names, always against class alias type - firstPartStr = strings.ToLower(firstPartStr) - aliasType = "" - } else { - if aliasType != "const" { // constants are case-sensitive - firstPartStr = strings.ToLower(firstPartStr) - } - } - - aliasName, ok := ns.Aliases[aliasType][firstPartStr] - if !ok { - return "", errors.New("Not found") - } - - return aliasName, nil -} - -func concatNameParts(parts ...[]node.Node) string { - str := "" - - for _, p := range parts { - for _, n := range p { - if str == "" { - str = n.(*name.NamePart).Value - } else { - str = str + "\\" + n.(*name.NamePart).Value - } - } - } - - return str -} diff --git a/visitor/namespace_resolver_test.go b/visitor/namespace_resolver_test.go deleted file mode 100644 index d626dbb..0000000 --- a/visitor/namespace_resolver_test.go +++ /dev/null @@ -1,976 +0,0 @@ -package visitor_test - -import ( - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/expr" - "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/visitor" -) - -func TestResolveStaticCall(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - }, - }, - &expr.StaticCall{ - Class: nameBC, - Call: &node.Identifier{Value: "foo"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - } - - expected := map[node.Node]string{ - nameBC: "A\\B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveStaticPropertyFetch(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - }, - }, - &expr.StaticPropertyFetch{ - Class: nameBC, - Property: &node.Identifier{Value: "foo"}, - }, - }, - } - - expected := map[node.Node]string{ - nameBC: "A\\B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveClassConstFetch(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - }, - }, - &expr.ClassConstFetch{ - Class: nameBC, - ConstantName: &node.Identifier{Value: "FOO"}, - }, - }, - } - - expected := map[node.Node]string{ - nameBC: "A\\B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveNew(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - }, - }, - &expr.New{ - Class: nameBC, - ArgumentList: &node.ArgumentList{}, - }, - }, - } - - expected := map[node.Node]string{ - nameBC: "A\\B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveInstanceOf(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - }, - }, - &expr.InstanceOf{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Class: nameBC, - }, - }, - } - - expected := map[node.Node]string{ - nameBC: "A\\B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveInstanceCatch(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - nameDE := &name.Name{Parts: []node.Node{&name.NamePart{Value: "D"}, &name.NamePart{Value: "E"}}} - nameF := &name.Name{Parts: []node.Node{&name.NamePart{Value: "F"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - &stmt.Use{ - Use: nameDE, - Alias: &node.Identifier{Value: "F"}, - }, - }, - }, - &stmt.Try{ - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Types: []node.Node{ - nameBC, - nameF, - }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Stmts: []node.Node{}, - }, - }, - }, - }, - } - - expected := map[node.Node]string{ - nameBC: "A\\B\\C", - nameF: "D\\E", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveFunctionCall(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - UseType: &node.Identifier{Value: "function"}, - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - }, - }, - &expr.FunctionCall{ - Function: nameB, - ArgumentList: &node.ArgumentList{}, - }, - }, - } - - expected := map[node.Node]string{ - nameB: "A\\B", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveConstFetch(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - UseType: &node.Identifier{Value: "const"}, - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - }, - }, - &expr.ConstFetch{ - Constant: nameB, - }, - }, - } - - expected := map[node.Node]string{ - nameB: "A\\B", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveGroupUse(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBD := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "D"}}} - nameE := &name.Name{Parts: []node.Node{&name.NamePart{Value: "E"}}} - nameC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "C"}}} - nameF := &name.Name{Parts: []node.Node{&name.NamePart{Value: "F"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.GroupUse{ - Prefix: nameAB, - UseList: []node.Node{ - &stmt.Use{ - UseType: &node.Identifier{Value: "Function"}, - Use: nameF, - }, - &stmt.Use{ - UseType: &node.Identifier{Value: "const"}, - Use: nameC, - }, - }, - }, - &stmt.GroupUse{ - Prefix: nameBD, - UseType: &node.Identifier{Value: "Function"}, - UseList: []node.Node{ - &stmt.Use{ - Use: nameE, - }, - }, - }, - &expr.ConstFetch{ - Constant: nameC, - }, - &expr.FunctionCall{ - Function: nameF, - ArgumentList: &node.ArgumentList{}, - }, - &expr.FunctionCall{ - Function: nameE, - ArgumentList: &node.ArgumentList{}, - }, - }, - } - - expected := map[node.Node]string{ - nameC: "A\\B\\C", - nameF: "A\\B\\F", - nameE: "B\\D\\E", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveTraitUse(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}}} - nameD := &name.Name{Parts: []node.Node{&name.NamePart{Value: "D"}}} - - fullyQualifiedNameB := &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "B"}}} - fullyQualifiedNameBC := &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - relativeNameB := &name.Relative{Parts: []node.Node{&name.NamePart{Value: "B"}}} - relativeNameBC := &name.Relative{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - }, - }, - &stmt.TraitUse{ - Traits: []node.Node{ - nameB, - relativeNameB, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ - Adaptations: []node.Node{ - &stmt.TraitUsePrecedence{ - Ref: &stmt.TraitMethodRef{ - Trait: fullyQualifiedNameB, - Method: &node.Identifier{Value: "foo"}, - }, - Insteadof: []node.Node{fullyQualifiedNameBC}, - }, - &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Trait: relativeNameBC, - Method: &node.Identifier{Value: "foo"}, - }, - Alias: &node.Identifier{Value: "bar"}, - }, - }, - }, - }, - &stmt.TraitUse{ - Traits: []node.Node{ - nameD, - }, - }, - }, - } - - expected := map[node.Node]string{ - nameB: "A\\B", - nameD: "D", - relativeNameB: "B", - fullyQualifiedNameB: "B", - fullyQualifiedNameBC: "B\\C", - relativeNameBC: "B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveClassName(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - class := &stmt.Class{ - PhpDocComment: "", - ClassName: &node.Identifier{Value: "A"}, - Extends: &stmt.ClassExtends{ - ClassName: nameAB, - }, - Implements: &stmt.ClassImplements{ - InterfaceNames: []node.Node{ - nameBC, - }, - }, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - class, - }, - } - - expected := map[node.Node]string{ - class: "A", - nameAB: "A\\B", - nameBC: "B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveInterfaceName(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - interfaceNode := &stmt.Interface{ - PhpDocComment: "", - InterfaceName: &node.Identifier{Value: "A"}, - Extends: &stmt.InterfaceExtends{ - InterfaceNames: []node.Node{ - nameAB, - nameBC, - }, - }, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - interfaceNode, - }, - } - - expected := map[node.Node]string{ - interfaceNode: "A", - nameAB: "A\\B", - nameBC: "B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveTraitName(t *testing.T) { - traitNode := &stmt.Trait{ - PhpDocComment: "", - TraitName: &node.Identifier{Value: "A"}, - Stmts: []node.Node{}, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - traitNode, - }, - } - - expected := map[node.Node]string{ - traitNode: "A", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveFunctionName(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - functionNode := &stmt.Function{ - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{Value: "A"}, - Params: []node.Node{ - &node.Parameter{ - ByRef: false, - Variadic: false, - VariableType: nameAB, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - }, - }, - ReturnType: &node.Nullable{Expr: nameBC}, - Stmts: []node.Node{}, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - functionNode, - }, - } - - expected := map[node.Node]string{ - functionNode: "A", - nameAB: "A\\B", - nameBC: "B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveMethodName(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - methodNode := &stmt.ClassMethod{ - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{Value: "A"}, - Params: []node.Node{ - &node.Parameter{ - ByRef: false, - Variadic: false, - VariableType: nameAB, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - }, - }, - ReturnType: &node.Nullable{Expr: nameBC}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, - }, - } - - expected := map[node.Node]string{ - nameAB: "A\\B", - nameBC: "B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - methodNode.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveClosureName(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - closureNode := &expr.Closure{ - ReturnsRef: false, - Static: false, - PhpDocComment: "", - Params: []node.Node{ - &node.Parameter{ - ByRef: false, - Variadic: false, - VariableType: nameAB, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - }, - }, - ReturnType: &node.Nullable{Expr: nameBC}, - Stmts: []node.Node{}, - } - - expected := map[node.Node]string{ - nameAB: "A\\B", - nameBC: "B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - closureNode.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveConstantsName(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - - constantB := &stmt.Constant{ - PhpDocComment: "", - ConstantName: &node.Identifier{Value: "B"}, - Expr: &scalar.Lnumber{Value: "1"}, - } - constantC := &stmt.Constant{ - PhpDocComment: "", - ConstantName: &node.Identifier{Value: "C"}, - Expr: &scalar.Lnumber{Value: "1"}, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Namespace{ - NamespaceName: nameAB, - }, - &stmt.ConstList{ - Consts: []node.Node{ - constantB, - constantC, - }, - }, - }, - } - - expected := map[node.Node]string{ - constantB: "A\\B\\B", - constantC: "A\\B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveNamespaces(t *testing.T) { - namespaceAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - namespaceCD := &name.Name{Parts: []node.Node{&name.NamePart{Value: "C"}, &name.NamePart{Value: "D"}}} - - nameAC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "C"}}} - nameCF := &name.Name{Parts: []node.Node{&name.NamePart{Value: "C"}, &name.NamePart{Value: "F"}}} - nameFG := &name.Name{Parts: []node.Node{&name.NamePart{Value: "F"}, &name.NamePart{Value: "G"}}} - relativeNameCE := &name.Relative{Parts: []node.Node{&name.NamePart{Value: "C"}, &name.NamePart{Value: "E"}}} - - constantB := &stmt.Constant{ - PhpDocComment: "", - ConstantName: &node.Identifier{Value: "B"}, - Expr: &scalar.Lnumber{Value: "1"}, - } - constantC := &stmt.Constant{ - PhpDocComment: "", - ConstantName: &node.Identifier{Value: "C"}, - Expr: &scalar.Lnumber{Value: "1"}, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Namespace{ - NamespaceName: namespaceAB, - }, - &stmt.ConstList{ - Consts: []node.Node{ - constantB, - constantC, - }, - }, - &expr.StaticCall{ - Class: nameFG, - Call: &node.Identifier{Value: "foo"}, - ArgumentList: &node.ArgumentList{}, - }, - &stmt.Namespace{ - Stmts: []node.Node{}, - }, - &stmt.Namespace{ - NamespaceName: namespaceCD, - Stmts: []node.Node{ - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: nameAC, - }, - }, - }, - &expr.StaticCall{ - Class: relativeNameCE, - Call: &node.Identifier{Value: "foo"}, - ArgumentList: &node.ArgumentList{}, - }, - &expr.StaticCall{ - Class: nameCF, - Call: &node.Identifier{Value: "foo"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - }, - }, - } - - expected := map[node.Node]string{ - constantB: "A\\B\\B", - constantC: "A\\B\\C", - nameFG: "A\\B\\F\\G", - relativeNameCE: "C\\D\\C\\E", - nameCF: "A\\C\\F", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveStaticCallDinamicClassName(t *testing.T) { - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &expr.StaticCall{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Call: &node.Identifier{Value: "foo"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - } - - expected := map[node.Node]string{} - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestDoNotResolveReservedConstants(t *testing.T) { - namespaceName := &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}} - - constantTrue := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "True"}, - }, - } - - constantFalse := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "False"}, - }, - } - - constantNull := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "NULL"}, - }, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Namespace{ - NamespaceName: namespaceName, - }, - &stmt.Expression{ - Expr: &expr.ConstFetch{ - Constant: constantTrue, - }, - }, - &stmt.Expression{ - Expr: &expr.ConstFetch{ - Constant: constantFalse, - }, - }, - &stmt.Expression{ - Expr: &expr.ConstFetch{ - Constant: constantNull, - }, - }, - }, - } - - expected := map[node.Node]string{ - constantTrue: "true", - constantFalse: "false", - constantNull: "null", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestDoNotResolveReservedNames(t *testing.T) { - - nameInt := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "int"}, - }, - } - - nameFloat := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "float"}, - }, - } - - nameBool := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "bool"}, - }, - } - - nameString := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "string"}, - }, - } - - nameVoid := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "void"}, - }, - } - - nameIterable := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "iterable"}, - }, - } - - nameObject := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "object"}, - }, - } - - function := &stmt.Function{ - FunctionName: &node.Identifier{Value: "bar"}, - Params: []node.Node{ - &node.Parameter{ - VariableType: nameInt, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "Int"}, - }, - }, - &node.Parameter{ - VariableType: nameFloat, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "Float"}, - }, - }, - &node.Parameter{ - VariableType: nameBool, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "Bool"}, - }, - }, - &node.Parameter{ - VariableType: nameString, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "String"}, - }, - }, - &node.Parameter{ - VariableType: nameVoid, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "Void"}, - }, - }, - &node.Parameter{ - VariableType: nameIterable, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "Iterable"}, - }, - }, - &node.Parameter{ - VariableType: nameObject, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "Object"}, - }, - }, - }, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Namespace{ - NamespaceName: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - }, - function, - }, - } - - expected := map[node.Node]string{ - function: "Foo\\bar", - nameInt: "int", - nameFloat: "float", - nameBool: "bool", - nameString: "string", - nameVoid: "void", - nameIterable: "iterable", - nameObject: "object", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestDoNotResolveReservedSpecialNames(t *testing.T) { - - nameSelf := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Self"}, - }, - } - - nameStatic := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Static"}, - }, - } - - nameParent := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Parent"}, - }, - } - - cls := &stmt.Class{ - ClassName: &node.Identifier{Value: "Bar"}, - Stmts: []node.Node{ - &stmt.Expression{ - Expr: &expr.StaticCall{ - Class: nameSelf, - Call: &node.Identifier{Value: "func"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticCall{ - Class: nameStatic, - Call: &node.Identifier{Value: "func"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticCall{ - Class: nameParent, - Call: &node.Identifier{Value: "func"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - }, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Namespace{ - NamespaceName: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - }, - cls, - }, - } - - expected := map[node.Node]string{ - cls: "Foo\\Bar", - nameSelf: "self", - nameStatic: "static", - nameParent: "parent", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} diff --git a/visitor/pretty_json_dumper.go b/visitor/pretty_json_dumper.go deleted file mode 100644 index 547e486..0000000 --- a/visitor/pretty_json_dumper.go +++ /dev/null @@ -1,187 +0,0 @@ -// Package visitor contains walker.visitor implementations -package visitor - -import ( - "fmt" - "io" - "reflect" - - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/walker" -) - -type PrettyJsonDumper struct { - Writer io.Writer - NsResolver *NamespaceResolver - depth int - isChildNode bool - isNotFirstNode bool -} - -func NewPrettyJsonDumper(Writer io.Writer, NsResolver *NamespaceResolver) *PrettyJsonDumper { - return &PrettyJsonDumper{ - Writer: Writer, - NsResolver: NsResolver, - depth: 0, - isChildNode: false, - isNotFirstNode: false, - } -} - -func (d *PrettyJsonDumper) printIndent(w io.Writer) { - for i := 0; i < d.depth; i++ { - fmt.Fprint(d.Writer, " ") - } -} - -// EnterNode is invoked at every node in hierarchy -func (d *PrettyJsonDumper) EnterNode(w walker.Walkable) bool { - n := w.(node.Node) - - nodeType := reflect.TypeOf(n).String() - - if d.isChildNode { - d.isChildNode = false - } else if d.isNotFirstNode { - fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - } else { - d.printIndent(d.Writer) - d.isNotFirstNode = true - } - - fmt.Fprint(d.Writer, "{\n") - d.depth++ - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %q", "type", nodeType) - - if p := n.GetPosition(); p != nil { - fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: {\n", "position") - d.depth++ - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %d,\n", "startPos", p.StartPos) - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %d,\n", "endPos", p.EndPos) - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %d,\n", "startLine", p.StartLine) - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %d\n", "endLine", p.EndLine) - d.depth-- - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "}") - } - - if d.NsResolver != nil { - if namespacedName, ok := d.NsResolver.ResolvedNames[n]; ok { - fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "\"namespacedName\": %q", namespacedName) - } - } - - if !n.GetFreeFloating().IsEmpty() { - fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "\"freefloating\": {\n") - d.depth++ - i := 0 - for key, freeFloatingStrings := range *n.GetFreeFloating() { - if i != 0 { - fmt.Fprint(d.Writer, ",\n") - } - i++ - - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: [\n", key) - d.depth++ - - j := 0 - for _, freeFloatingString := range freeFloatingStrings { - if j != 0 { - fmt.Fprint(d.Writer, ",\n") - } - j++ - - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "{\n") - d.depth++ - d.printIndent(d.Writer) - switch freeFloatingString.StringType { - case freefloating.CommentType: - fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "freefloating.CommentType") - case freefloating.WhiteSpaceType: - fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "freefloating.WhiteSpaceType") - case freefloating.TokenType: - fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "freefloating.TokenType") - } - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %q\n", "value", freeFloatingString.Value) - d.depth-- - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "}") - } - - d.depth-- - fmt.Fprint(d.Writer, "\n") - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "]") - } - d.depth-- - fmt.Fprint(d.Writer, "\n") - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "}") - } - - if a := n.Attributes(); len(a) > 0 { - for key, attr := range a { - fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - switch attr.(type) { - case string: - fmt.Fprintf(d.Writer, "\"%s\": %q", key, attr) - default: - fmt.Fprintf(d.Writer, "\"%s\": %v", key, attr) - } - } - } - - return true -} - -// LeaveNode is invoked after node process -func (d *PrettyJsonDumper) LeaveNode(n walker.Walkable) { - d.depth-- - fmt.Fprint(d.Writer, "\n") - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "}") -} - -func (d *PrettyJsonDumper) EnterChildNode(key string, w walker.Walkable) { - fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: ", key) - d.isChildNode = true -} - -func (d *PrettyJsonDumper) LeaveChildNode(key string, w walker.Walkable) { - // do nothing -} - -func (d *PrettyJsonDumper) EnterChildList(key string, w walker.Walkable) { - fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: [\n", key) - d.depth++ - - d.isNotFirstNode = false -} - -func (d *PrettyJsonDumper) LeaveChildList(key string, w walker.Walkable) { - d.depth-- - fmt.Fprint(d.Writer, "\n") - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "]") -} diff --git a/visitor/pretty_json_dumper_test.go b/visitor/pretty_json_dumper_test.go deleted file mode 100644 index 307581d..0000000 --- a/visitor/pretty_json_dumper_test.go +++ /dev/null @@ -1,509 +0,0 @@ -package visitor_test - -import ( - "os" - - "github.com/z7zmey/php-parser/php7" - "github.com/z7zmey/php-parser/visitor" -) - -func ExamplePrettyJsonDumper() { - src := `