refactoring: fix naming

This commit is contained in:
Vadym Slizov 2020-12-28 23:01:02 +02:00
parent 0701b3552e
commit cb4b4e69c4
No known key found for this signature in database
GPG Key ID: AEA2A9388EF42A4A
19 changed files with 2517 additions and 2517 deletions

File diff suppressed because it is too large Load Diff

BIN
internal/php5/php5.go generated

Binary file not shown.

View File

@ -293,7 +293,7 @@ namespace_name:
{
$$ = &ParserSeparatedList{
Items: []ast.Vertex{
&ast.NameNamePart{
&ast.NamePart{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
StringTkn: $1,
Value: $1.Value,
@ -303,7 +303,7 @@ namespace_name:
}
| namespace_name T_NS_SEPARATOR T_STRING
{
part := &ast.NameNamePart{
part := &ast.NamePart{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
StringTkn: $3,
Value: $3.Value,
@ -349,7 +349,7 @@ top_statement:
$$ = &ast.StmtNamespace{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
NsTkn: $1,
Name: &ast.NameName{
Name: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items),
Parts: $2.(*ParserSeparatedList).Items,
SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns,
@ -362,7 +362,7 @@ top_statement:
$$ = &ast.StmtNamespace{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $5),
NsTkn: $1,
Name: &ast.NameName{
Name: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items),
Parts: $2.(*ParserSeparatedList).Items,
SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns,
@ -384,17 +384,17 @@ top_statement:
}
| T_USE use_declarations ';'
{
$$ = &ast.StmtUse{
$$ = &ast.StmtUseList{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
UseTkn: $1,
UseDeclarations: $2.(*ParserSeparatedList).Items,
Uses: $2.(*ParserSeparatedList).Items,
SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns,
SemiColonTkn: $3,
}
}
| T_USE T_FUNCTION use_function_declarations ';'
{
$$ = &ast.StmtUse{
$$ = &ast.StmtUseList{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $4),
UseTkn: $1,
Type: &ast.Identifier{
@ -402,14 +402,14 @@ top_statement:
IdentifierTkn: $2,
Value: $2.Value,
},
UseDeclarations: $3.(*ParserSeparatedList).Items,
Uses: $3.(*ParserSeparatedList).Items,
SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns,
SemiColonTkn: $4,
}
}
| T_USE T_CONST use_const_declarations ';'
{
$$ = &ast.StmtUse{
$$ = &ast.StmtUseList{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $4),
UseTkn: $1,
Type: &ast.Identifier{
@ -417,7 +417,7 @@ top_statement:
IdentifierTkn: $2,
Value: $2.Value,
},
UseDeclarations: $3.(*ParserSeparatedList).Items,
Uses: $3.(*ParserSeparatedList).Items,
SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns,
SemiColonTkn: $4,
}
@ -449,9 +449,9 @@ use_declarations:
use_declaration:
namespace_name
{
$$ = &ast.StmtUseDeclaration{
$$ = &ast.StmtUse{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Use: &ast.NameName{
Use: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Parts: $1.(*ParserSeparatedList).Items,
SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns,
@ -460,9 +460,9 @@ use_declaration:
}
| namespace_name T_AS T_STRING
{
$$ = &ast.StmtUseDeclaration{
$$ = &ast.StmtUse{
Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $3),
Use: &ast.NameName{
Use: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Parts: $1.(*ParserSeparatedList).Items,
SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns,
@ -477,10 +477,10 @@ use_declaration:
}
| T_NS_SEPARATOR namespace_name
{
$$ = &ast.StmtUseDeclaration{
$$ = &ast.StmtUse{
Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items),
NsSeparatorTkn: $1,
Use: &ast.NameName{
Use: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items),
Parts: $2.(*ParserSeparatedList).Items,
SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns,
@ -489,10 +489,10 @@ use_declaration:
}
| T_NS_SEPARATOR namespace_name T_AS T_STRING
{
$$ = &ast.StmtUseDeclaration{
$$ = &ast.StmtUse{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $4),
NsSeparatorTkn: $1,
Use: &ast.NameName{
Use: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items),
Parts: $2.(*ParserSeparatedList).Items,
SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns,
@ -526,9 +526,9 @@ use_function_declarations:
use_function_declaration:
namespace_name
{
$$ = &ast.StmtUseDeclaration{
$$ = &ast.StmtUse{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Use: &ast.NameName{
Use: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Parts: $1.(*ParserSeparatedList).Items,
SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns,
@ -537,9 +537,9 @@ use_function_declaration:
}
| namespace_name T_AS T_STRING
{
$$ = &ast.StmtUseDeclaration{
$$ = &ast.StmtUse{
Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $3),
Use: &ast.NameName{
Use: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Parts: $1.(*ParserSeparatedList).Items,
SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns,
@ -554,10 +554,10 @@ use_function_declaration:
}
| T_NS_SEPARATOR namespace_name
{
$$ = &ast.StmtUseDeclaration{
$$ = &ast.StmtUse{
Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items),
NsSeparatorTkn: $1,
Use: &ast.NameName{
Use: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items),
Parts: $2.(*ParserSeparatedList).Items,
SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns,
@ -566,10 +566,10 @@ use_function_declaration:
}
| T_NS_SEPARATOR namespace_name T_AS T_STRING
{
$$ = &ast.StmtUseDeclaration{
$$ = &ast.StmtUse{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $4),
NsSeparatorTkn: $1,
Use: &ast.NameName{
Use: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items),
Parts: $2.(*ParserSeparatedList).Items,
SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns,
@ -603,9 +603,9 @@ use_const_declarations:
use_const_declaration:
namespace_name
{
$$ = &ast.StmtUseDeclaration{
$$ = &ast.StmtUse{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Use: &ast.NameName{
Use: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Parts: $1.(*ParserSeparatedList).Items,
SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns,
@ -614,9 +614,9 @@ use_const_declaration:
}
| namespace_name T_AS T_STRING
{
$$ = &ast.StmtUseDeclaration{
$$ = &ast.StmtUse{
Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $3),
Use: &ast.NameName{
Use: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Parts: $1.(*ParserSeparatedList).Items,
SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns,
@ -631,10 +631,10 @@ use_const_declaration:
}
| T_NS_SEPARATOR namespace_name
{
$$ = &ast.StmtUseDeclaration{
$$ = &ast.StmtUse{
Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items),
NsSeparatorTkn: $1,
Use: &ast.NameName{
Use: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items),
Parts: $2.(*ParserSeparatedList).Items,
SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns,
@ -643,10 +643,10 @@ use_const_declaration:
}
| T_NS_SEPARATOR namespace_name T_AS T_STRING
{
$$ = &ast.StmtUseDeclaration{
$$ = &ast.StmtUse{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $4),
NsSeparatorTkn: $1,
Use: &ast.NameName{
Use: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items),
Parts: $2.(*ParserSeparatedList).Items,
SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns,
@ -755,7 +755,7 @@ statement:
{
$$ = &ast.StmtLabel{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $2),
LabelName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -1115,7 +1115,7 @@ catch_statement:
Types: []ast.Vertex{$3},
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($4),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($4),
IdentifierTkn: $4,
Value: $4.Value,
@ -1179,7 +1179,7 @@ additional_catch:
Types: []ast.Vertex{$3},
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($4),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($4),
IdentifierTkn: $4,
Value: $4.Value,
@ -1259,7 +1259,7 @@ unticked_function_declaration_statement:
Position: yylex.(*Parser).builder.NewTokensPosition($1, $9),
FunctionTkn: $1,
AmpersandTkn: $2,
FunctionName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
IdentifierTkn: $3,
Value: $3.Value,
@ -1287,7 +1287,7 @@ unticked_class_declaration_statement:
}
n.Position = yylex.(*Parser).builder.NewNodeTokenPosition($1, $7)
n.ClassName = className
n.Name = className
n.OpenCurlyBracketTkn = $5
n.Stmts = $6
n.CloseCurlyBracketTkn = $7
@ -1310,7 +1310,7 @@ unticked_class_declaration_statement:
}
n.Position = yylex.(*Parser).builder.NewNodeTokenPosition($1, $7)
n.TraitName = traitName
n.Name = traitName
n.OpenCurlyBracketTkn = $5
n.Stmts = $6
n.CloseCurlyBracketTkn = $7
@ -1331,7 +1331,7 @@ unticked_class_declaration_statement:
iface := &ast.StmtInterface{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $6),
InterfaceTkn: $1,
InterfaceName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($2),
IdentifierTkn: $2,
Value: $2.Value,
@ -1631,7 +1631,7 @@ switch_case_list:
$$ = &ast.StmtSwitch{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
OpenCurlyBracketTkn: $1,
CaseList: $2,
Cases: $2,
CloseCurlyBracketTkn: $3,
}
}
@ -1641,7 +1641,7 @@ switch_case_list:
Position: yylex.(*Parser).builder.NewTokensPosition($1, $4),
OpenCurlyBracketTkn: $1,
CaseSeparatorTkn: $2,
CaseList: $3,
Cases: $3,
CloseCurlyBracketTkn: $4,
}
}
@ -1650,7 +1650,7 @@ switch_case_list:
$$ = &ast.StmtSwitch{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $4),
ColonTkn: $1,
CaseList: $2,
Cases: $2,
EndSwitchTkn: $3,
SemiColonTkn: $4,
}
@ -1661,7 +1661,7 @@ switch_case_list:
Position: yylex.(*Parser).builder.NewTokensPosition($1, $5),
ColonTkn: $1,
CaseSeparatorTkn: $2,
CaseList: $3,
Cases: $3,
EndSwitchTkn: $4,
SemiColonTkn: $5,
}
@ -1857,7 +1857,7 @@ parameter:
VariadicTkn: $3,
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($4),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($4),
IdentifierTkn: $4,
Value: $4.Value,
@ -1883,7 +1883,7 @@ parameter:
VariadicTkn: $3,
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($4),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($4),
IdentifierTkn: $4,
Value: $4.Value,
@ -2030,7 +2030,7 @@ global_var:
{
$$ = &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -2042,7 +2042,7 @@ global_var:
$$ = &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2),
DollarTkn: $1,
VarName: $2,
Name: $2,
}
}
| '$' '{' expr '}'
@ -2051,7 +2051,7 @@ global_var:
Position: yylex.(*Parser).builder.NewTokensPosition($1, $4),
DollarTkn: $1,
OpenCurlyBracketTkn: $2,
VarName: $3,
Name: $3,
CloseCurlyBracketTkn: $4,
}
}
@ -2065,7 +2065,7 @@ static_var_list:
Position: yylex.(*Parser).builder.NewTokenPosition($3),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
IdentifierTkn: $3,
Value: $3.Value,
@ -2082,7 +2082,7 @@ static_var_list:
Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $5),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
IdentifierTkn: $3,
Value: $3.Value,
@ -2103,7 +2103,7 @@ static_var_list:
Position: yylex.(*Parser).builder.NewTokenPosition($1),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -2121,7 +2121,7 @@ static_var_list:
Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -2154,7 +2154,7 @@ class_statement:
$$ = &ast.StmtPropertyList{
Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1, $3),
Modifiers: $1,
Properties: $2.(*ParserSeparatedList).Items,
Props: $2.(*ParserSeparatedList).Items,
SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns,
SemiColonTkn: $3,
}
@ -2181,7 +2181,7 @@ class_statement:
Modifiers: $1,
FunctionTkn: $2,
AmpersandTkn: $3,
MethodName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($4),
IdentifierTkn: $4,
Value: $4.Value,
@ -2512,7 +2512,7 @@ class_variable_declaration:
Position: yylex.(*Parser).builder.NewTokenPosition($3),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
IdentifierTkn: $3,
Value: $3.Value,
@ -2531,7 +2531,7 @@ class_variable_declaration:
Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $5),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
IdentifierTkn: $3,
Value: $3.Value,
@ -2554,7 +2554,7 @@ class_variable_declaration:
Position: yylex.(*Parser).builder.NewTokenPosition($1),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -2573,7 +2573,7 @@ class_variable_declaration:
Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -2744,7 +2744,7 @@ new_expr:
NewTkn: $1,
Class: $2,
OpenParenthesisTkn: $3.(*ArgumentList).OpenParenthesisTkn,
Arguments: $3.(*ArgumentList).Arguments,
Args: $3.(*ArgumentList).Arguments,
SeparatorTkns: $3.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $3.(*ArgumentList).CloseParenthesisTkn,
}
@ -2802,7 +2802,7 @@ expr_without_variable:
NewTkn: $4,
Class: $5,
OpenParenthesisTkn: $6.(*ArgumentList).OpenParenthesisTkn,
Arguments: $6.(*ArgumentList).Arguments,
Args: $6.(*ArgumentList).Arguments,
SeparatorTkns: $6.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $6.(*ArgumentList).CloseParenthesisTkn,
}
@ -3281,7 +3281,7 @@ expr_without_variable:
{
$$ = &ast.ExprTernary{
Position: yylex.(*Parser).builder.NewNodesPosition($1, $5),
Condition: $1,
Cond: $1,
QuestionTkn: $2,
IfTrue: $3,
ColonTkn: $4,
@ -3292,7 +3292,7 @@ expr_without_variable:
{
$$ = &ast.ExprTernary{
Position: yylex.(*Parser).builder.NewNodesPosition($1, $4),
Condition: $1,
Cond: $1,
QuestionTkn: $2,
ColonTkn: $3,
IfFalse: $4,
@ -3462,7 +3462,7 @@ yield_expr:
$$ = &ast.ExprYield{
Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2),
YieldTkn: $1,
Value: $2,
Val: $2,
}
}
| T_YIELD variable
@ -3470,7 +3470,7 @@ yield_expr:
$$ = &ast.ExprYield{
Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2),
YieldTkn: $1,
Value: $2,
Val: $2,
}
}
| T_YIELD expr T_DOUBLE_ARROW expr_without_variable
@ -3480,7 +3480,7 @@ yield_expr:
YieldTkn: $1,
Key: $2,
DoubleArrowTkn: $3,
Value: $4,
Val: $4,
}
}
| T_YIELD expr T_DOUBLE_ARROW variable
@ -3490,7 +3490,7 @@ yield_expr:
YieldTkn: $1,
Key: $2,
DoubleArrowTkn: $3,
Value: $4,
Val: $4,
}
}
;
@ -3583,7 +3583,7 @@ lexical_vars:
$$ = &ast.ExprClosure{
UseTkn: $1,
UseOpenParenthesisTkn: $2,
Use: $3.(*ParserSeparatedList).Items,
Uses: $3.(*ParserSeparatedList).Items,
UseSeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns,
UseCloseParenthesisTkn: $4,
}
@ -3597,7 +3597,7 @@ lexical_var_list:
Position: yylex.(*Parser).builder.NewTokenPosition($3),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
IdentifierTkn: $3,
Value: $3.Value,
@ -3617,7 +3617,7 @@ lexical_var_list:
AmpersandTkn: $3,
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($4),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($4),
IdentifierTkn: $4,
Value: $4.Value,
@ -3636,7 +3636,7 @@ lexical_var_list:
Position: yylex.(*Parser).builder.NewTokenPosition($1),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -3655,7 +3655,7 @@ lexical_var_list:
AmpersandTkn: $1,
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($2),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($2),
IdentifierTkn: $2,
Value: $2.Value,
@ -3674,13 +3674,13 @@ function_call:
{
$$ = &ast.ExprFunctionCall{
Position: yylex.(*Parser).builder.NewNodeListNodePosition($1.(*ParserSeparatedList).Items, $2),
Function: &ast.NameName{
Function: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Parts: $1.(*ParserSeparatedList).Items,
SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns,
},
OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn,
Arguments: $2.(*ArgumentList).Arguments,
Args: $2.(*ArgumentList).Arguments,
SeparatorTkns: $2.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn,
}
@ -3697,7 +3697,7 @@ function_call:
SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns,
},
OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn,
Arguments: $4.(*ArgumentList).Arguments,
Args: $4.(*ArgumentList).Arguments,
SeparatorTkns: $4.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn,
}
@ -3713,7 +3713,7 @@ function_call:
SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns,
},
OpenParenthesisTkn: $3.(*ArgumentList).OpenParenthesisTkn,
Arguments: $3.(*ArgumentList).Arguments,
Args: $3.(*ArgumentList).Arguments,
SeparatorTkns: $3.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $3.(*ArgumentList).CloseParenthesisTkn,
}
@ -3726,7 +3726,7 @@ function_call:
DoubleColonTkn: $2,
Call: $3,
OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn,
Arguments: $4.(*ArgumentList).Arguments,
Args: $4.(*ArgumentList).Arguments,
SeparatorTkns: $4.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn,
}
@ -3747,7 +3747,7 @@ function_call:
DoubleColonTkn: $2,
Call: $3,
OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn,
Arguments: $4.(*ArgumentList).Arguments,
Args: $4.(*ArgumentList).Arguments,
SeparatorTkns: $4.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn,
}
@ -3760,7 +3760,7 @@ function_call:
DoubleColonTkn: $2,
Call: $3,
OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn,
Arguments: $4.(*ArgumentList).Arguments,
Args: $4.(*ArgumentList).Arguments,
SeparatorTkns: $4.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn,
}
@ -3781,7 +3781,7 @@ function_call:
DoubleColonTkn: $2,
Call: $3,
OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn,
Arguments: $4.(*ArgumentList).Arguments,
Args: $4.(*ArgumentList).Arguments,
SeparatorTkns: $4.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn,
}
@ -3792,7 +3792,7 @@ function_call:
Position: yylex.(*Parser).builder.NewNodesPosition($1, $2),
Function: $1,
OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn,
Arguments: $2.(*ArgumentList).Arguments,
Args: $2.(*ArgumentList).Arguments,
SeparatorTkns: $2.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn,
}
@ -3810,7 +3810,7 @@ class_name:
}
| namespace_name
{
$$ = &ast.NameName{
$$ = &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Parts: $1.(*ParserSeparatedList).Items,
SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns,
@ -3840,7 +3840,7 @@ class_name:
fully_qualified_class_name:
namespace_name
{
$$ = &ast.NameName{
$$ = &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Parts: $1.(*ParserSeparatedList).Items,
SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns,
@ -4105,7 +4105,7 @@ static_class_constant:
Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3),
Class: $1,
DoubleColonTkn: $2,
ConstantName: &ast.Identifier{
Const: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
IdentifierTkn: $3,
Value: $3.Value,
@ -4134,7 +4134,7 @@ static_scalar_value:
{
$$ = &ast.ExprConstFetch{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Const: &ast.NameName{
Const: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Parts: $1.(*ParserSeparatedList).Items,
SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns,
@ -4461,7 +4461,7 @@ static_operation:
{
$$ = &ast.ExprTernary{
Position: yylex.(*Parser).builder.NewNodesPosition($1, $4),
Condition: $1,
Cond: $1,
QuestionTkn: $2,
ColonTkn: $3,
IfFalse: $4,
@ -4471,7 +4471,7 @@ static_operation:
{
$$ = &ast.ExprTernary{
Position: yylex.(*Parser).builder.NewNodesPosition($1, $5),
Condition: $1,
Cond: $1,
QuestionTkn: $2,
IfTrue: $3,
ColonTkn: $4,
@ -4514,7 +4514,7 @@ general_constant:
{
$$ = &ast.ExprConstFetch{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Const: &ast.NameName{
Const: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Parts: $1.(*ParserSeparatedList).Items,
SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns,
@ -4553,7 +4553,7 @@ scalar:
{
$$ = &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -4750,7 +4750,7 @@ variable:
$3 = append($3, &ast.ExprFunctionCall{
Position: yylex.(*Parser).builder.NewNodePosition(mc),
OpenParenthesisTkn: mc.OpenParenthesisTkn,
Arguments: mc.Arguments,
Args: mc.Args,
SeparatorTkns: mc.SeparatorTkns,
CloseParenthesisTkn: mc.CloseParenthesisTkn,
},
@ -4758,7 +4758,7 @@ variable:
$3 = append($3, $4[1:len($4)]...)
case *ast.ExprPropertyFetch:
$4[0].(*ast.ExprMethodCall).OpenCurlyBracketTkn = l.OpenCurlyBracketTkn
$4[0].(*ast.ExprMethodCall).Method = l.Property
$4[0].(*ast.ExprMethodCall).Method = l.Prop
$4[0].(*ast.ExprMethodCall).CloseCurlyBracketTkn = l.CloseCurlyBracketTkn
$4[0].(*ast.ExprMethodCall).ObjectOperatorTkn = l.ObjectOperatorTkn
$3 = append($3[:len($3)-1], $4...)
@ -4844,7 +4844,7 @@ variable_property:
$2 = append($2, &ast.ExprFunctionCall{
Position: yylex.(*Parser).builder.NewNodePosition(mc),
OpenParenthesisTkn: mc.OpenParenthesisTkn,
Arguments: mc.Arguments,
Args: mc.Args,
SeparatorTkns: mc.SeparatorTkns,
CloseParenthesisTkn: mc.OpenParenthesisTkn,
},
@ -4852,7 +4852,7 @@ variable_property:
$2 = append($2, $3[1:len($3)]...)
case *ast.ExprPropertyFetch:
$3[0].(*ast.ExprMethodCall).OpenCurlyBracketTkn = l.OpenCurlyBracketTkn
$3[0].(*ast.ExprMethodCall).Method = l.Property
$3[0].(*ast.ExprMethodCall).Method = l.Prop
$3[0].(*ast.ExprMethodCall).CloseCurlyBracketTkn = l.CloseCurlyBracketTkn
$3[0].(*ast.ExprMethodCall).ObjectOperatorTkn = l.ObjectOperatorTkn
$2 = append($2[:len($2)-1], $3...)
@ -4896,7 +4896,7 @@ method:
$$ = &ast.ExprMethodCall{
Position: yylex.(*Parser).builder.NewNodePosition($1),
OpenParenthesisTkn: $1.(*ArgumentList).OpenParenthesisTkn,
Arguments: $1.(*ArgumentList).Arguments,
Args: $1.(*ArgumentList).Arguments,
SeparatorTkns: $1.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $1.(*ArgumentList).CloseParenthesisTkn,
}
@ -4926,7 +4926,7 @@ variable_without_objects:
| simple_indirect_reference reference_variable
{
for i := len($1)-1; i>=0; i-- {
$1[i].(*ast.ExprVariable).VarName = $2
$1[i].(*ast.ExprVariable).Name = $2
$1[i].(*ast.ExprVariable).Position = yylex.(*Parser).builder.NewNodesPosition($1[i], $2)
$2 = $1[i]
}
@ -4942,7 +4942,7 @@ static_member:
Position: yylex.(*Parser).builder.NewNodesPosition($1, $3),
Class: $1,
DoubleColonTkn: $2,
Property: $3,
Prop: $3,
}
}
| variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects
@ -4951,7 +4951,7 @@ static_member:
Position: yylex.(*Parser).builder.NewNodesPosition($1, $3),
Class: $1,
DoubleColonTkn: $2,
Property: $3,
Prop: $3,
}
}
;
@ -5010,7 +5010,7 @@ base_variable:
| simple_indirect_reference reference_variable
{
for i := len($1)-1; i>=0; i-- {
$1[i].(*ast.ExprVariable).VarName = $2
$1[i].(*ast.ExprVariable).Name = $2
$1[i].(*ast.ExprVariable).Position = yylex.(*Parser).builder.NewNodesPosition($1[i], $2)
$2 = $1[i]
}
@ -5056,7 +5056,7 @@ compound_variable:
{
$$ = &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -5069,7 +5069,7 @@ compound_variable:
Position: yylex.(*Parser).builder.NewTokensPosition($1, $4),
DollarTkn: $1,
OpenCurlyBracketTkn: $2,
VarName: $3,
Name: $3,
CloseCurlyBracketTkn: $4,
}
}
@ -5097,7 +5097,7 @@ object_property:
$$ = []ast.Vertex{
&ast.ExprPropertyFetch{
Position: yylex.(*Parser).builder.NewNodePosition($1),
Property: $1,
Prop: $1,
},
}
}
@ -5132,12 +5132,12 @@ object_dim_list:
{
property := &ast.ExprPropertyFetch{
Position: yylex.(*Parser).builder.NewNodePosition($1),
Property: $1,
Prop: $1,
}
if brackets, ok := $1.(*ParserBrackets); ok {
property.OpenCurlyBracketTkn = brackets.OpenBracketTkn
property.Property = brackets.Child
property.Prop = brackets.Child
property.CloseCurlyBracketTkn = brackets.CloseBracketTkn
}
@ -5398,7 +5398,7 @@ encaps_var:
{
$$ = &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -5411,7 +5411,7 @@ encaps_var:
Position: yylex.(*Parser).builder.NewTokensPosition($1, $4),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -5428,14 +5428,14 @@ encaps_var:
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
},
},
ObjectOperatorTkn: $2,
Property: &ast.Identifier{
Prop: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
IdentifierTkn: $3,
Value: $3.Value,
@ -5447,7 +5447,7 @@ encaps_var:
$$ = &ast.ScalarEncapsedStringVar{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
DollarOpenCurlyBracketTkn: $1,
VarName: $2,
Name: $2,
CloseCurlyBracketTkn: $3,
}
}
@ -5456,7 +5456,7 @@ encaps_var:
$$ = &ast.ScalarEncapsedStringVar{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
DollarOpenCurlyBracketTkn: $1,
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($2),
IdentifierTkn: $2,
Value: $2.Value,
@ -5469,7 +5469,7 @@ encaps_var:
$$ = &ast.ScalarEncapsedStringVar{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
DollarOpenCurlyBracketTkn: $1,
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($2),
IdentifierTkn: $2,
Value: $2.Value,
@ -5521,7 +5521,7 @@ encaps_var_offset:
{
$$ = &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -5640,7 +5640,7 @@ class_constant:
Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3),
Class: $1,
DoubleColonTkn: $2,
ConstantName: &ast.Identifier{
Const: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
IdentifierTkn: $3,
Value: $3.Value,
@ -5653,7 +5653,7 @@ class_constant:
Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3),
Class: $1,
DoubleColonTkn: $2,
ConstantName: &ast.Identifier{
Const: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
IdentifierTkn: $3,
Value: $3.Value,
@ -5669,7 +5669,7 @@ static_class_name_scalar:
Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3),
Class: $1,
DoubleColonTkn: $2,
ConstantName: &ast.Identifier{
Const: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
IdentifierTkn: $3,
Value: $3.Value,
@ -5685,7 +5685,7 @@ class_name_scalar:
Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3),
Class: $1,
DoubleColonTkn: $2,
ConstantName: &ast.Identifier{
Const: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
IdentifierTkn: $3,
Value: $3.Value,

File diff suppressed because it is too large Load Diff

BIN
internal/php7/php7.go generated

Binary file not shown.

View File

@ -338,7 +338,7 @@ namespace_name:
{
$$ = &ParserSeparatedList{
Items: []ast.Vertex{
&ast.NameNamePart{
&ast.NamePart{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
StringTkn: $1,
Value: $1.Value,
@ -348,7 +348,7 @@ namespace_name:
}
| namespace_name T_NS_SEPARATOR T_STRING
{
part := &ast.NameNamePart{
part := &ast.NamePart{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
StringTkn: $3,
Value: $3.Value,
@ -364,7 +364,7 @@ namespace_name:
name:
namespace_name
{
$$ = &ast.NameName{
$$ = &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Parts: $1.(*ParserSeparatedList).Items,
SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns,
@ -432,7 +432,7 @@ top_statement:
$$ = &ast.StmtNamespace{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
NsTkn: $1,
Name: &ast.NameName{
Name: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items),
Parts: $2.(*ParserSeparatedList).Items,
SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns,
@ -445,7 +445,7 @@ top_statement:
$$ = &ast.StmtNamespace{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $5),
NsTkn: $1,
Name: &ast.NameName{
Name: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items),
Parts: $2.(*ParserSeparatedList).Items,
SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns,
@ -467,7 +467,7 @@ top_statement:
}
| T_USE mixed_group_use_declaration ';'
{
use := $2.(*ast.StmtGroupUse)
use := $2.(*ast.StmtGroupUseList)
use.Position = yylex.(*Parser).builder.NewTokensPosition($1, $3)
use.UseTkn = $1
@ -477,7 +477,7 @@ top_statement:
}
| T_USE use_type group_use_declaration ';'
{
use := $3.(*ast.StmtGroupUse)
use := $3.(*ast.StmtGroupUseList)
use.Position = yylex.(*Parser).builder.NewTokensPosition($1, $4)
use.UseTkn = $1
@ -488,21 +488,21 @@ top_statement:
}
| T_USE use_declarations ';'
{
$$ = &ast.StmtUse{
$$ = &ast.StmtUseList{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
UseTkn: $1,
UseDeclarations: $2.(*ParserSeparatedList).Items,
Uses: $2.(*ParserSeparatedList).Items,
SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns,
SemiColonTkn: $3,
}
}
| T_USE use_type use_declarations ';'
{
$$ = &ast.StmtUse{
$$ = &ast.StmtUseList{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $4),
UseTkn: $1,
Type: $2,
UseDeclarations: $3.(*ParserSeparatedList).Items,
Uses: $3.(*ParserSeparatedList).Items,
SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns,
SemiColonTkn: $4,
}
@ -545,16 +545,16 @@ group_use_declaration:
$4.(*ParserSeparatedList).SeparatorTkns = append($4.(*ParserSeparatedList).SeparatorTkns, $5)
}
$$ = &ast.StmtGroupUse{
$$ = &ast.StmtGroupUseList{
Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $6),
Prefix: &ast.NameName{
Prefix: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Parts: $1.(*ParserSeparatedList).Items,
SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns,
},
NsSeparatorTkn: $2,
OpenCurlyBracketTkn: $3,
UseDeclarations: $4.(*ParserSeparatedList).Items,
Uses: $4.(*ParserSeparatedList).Items,
SeparatorTkns: $4.(*ParserSeparatedList).SeparatorTkns,
CloseCurlyBracketTkn: $6,
}
@ -565,17 +565,17 @@ group_use_declaration:
$5.(*ParserSeparatedList).SeparatorTkns = append($5.(*ParserSeparatedList).SeparatorTkns, $6)
}
$$ = &ast.StmtGroupUse{
$$ = &ast.StmtGroupUseList{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $7),
LeadingNsSeparatorTkn: $1,
Prefix: &ast.NameName{
Prefix: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items),
Parts: $2.(*ParserSeparatedList).Items,
SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns,
},
NsSeparatorTkn: $3,
OpenCurlyBracketTkn: $4,
UseDeclarations: $5.(*ParserSeparatedList).Items,
Uses: $5.(*ParserSeparatedList).Items,
SeparatorTkns: $5.(*ParserSeparatedList).SeparatorTkns,
CloseCurlyBracketTkn: $7,
}
@ -589,16 +589,16 @@ mixed_group_use_declaration:
$4.(*ParserSeparatedList).SeparatorTkns = append($4.(*ParserSeparatedList).SeparatorTkns, $5)
}
$$ = &ast.StmtGroupUse{
$$ = &ast.StmtGroupUseList{
Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $6),
Prefix: &ast.NameName{
Prefix: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Parts: $1.(*ParserSeparatedList).Items,
SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns,
},
NsSeparatorTkn: $2,
OpenCurlyBracketTkn: $3,
UseDeclarations: $4.(*ParserSeparatedList).Items,
Uses: $4.(*ParserSeparatedList).Items,
SeparatorTkns: $4.(*ParserSeparatedList).SeparatorTkns,
CloseCurlyBracketTkn: $6,
}
@ -609,17 +609,17 @@ mixed_group_use_declaration:
$5.(*ParserSeparatedList).SeparatorTkns = append($5.(*ParserSeparatedList).SeparatorTkns, $6)
}
$$ = &ast.StmtGroupUse{
$$ = &ast.StmtGroupUseList{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $7),
LeadingNsSeparatorTkn: $1,
Prefix: &ast.NameName{
Prefix: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items),
Parts: $2.(*ParserSeparatedList).Items,
SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns,
},
NsSeparatorTkn: $3,
OpenCurlyBracketTkn: $4,
UseDeclarations: $5.(*ParserSeparatedList).Items,
Uses: $5.(*ParserSeparatedList).Items,
SeparatorTkns: $5.(*ParserSeparatedList).SeparatorTkns,
CloseCurlyBracketTkn: $7,
}
@ -692,7 +692,7 @@ inline_use_declaration:
}
| use_type unprefixed_use_declaration
{
decl := $2.(*ast.StmtUseDeclaration)
decl := $2.(*ast.StmtUse)
decl.Type = $1
decl.Position = yylex.(*Parser).builder.NewNodesPosition($1, $2)
@ -703,9 +703,9 @@ inline_use_declaration:
unprefixed_use_declaration:
namespace_name
{
$$ = &ast.StmtUseDeclaration{
$$ = &ast.StmtUse{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Use: &ast.NameName{
Use: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Parts: $1.(*ParserSeparatedList).Items,
SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns,
@ -714,9 +714,9 @@ unprefixed_use_declaration:
}
| namespace_name T_AS T_STRING
{
$$ = &ast.StmtUseDeclaration{
$$ = &ast.StmtUse{
Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $3),
Use: &ast.NameName{
Use: &ast.Name{
Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items),
Parts: $1.(*ParserSeparatedList).Items,
SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns,
@ -738,7 +738,7 @@ use_declaration:
}
| T_NS_SEPARATOR unprefixed_use_declaration
{
decl := $2.(*ast.StmtUseDeclaration)
decl := $2.(*ast.StmtUse)
decl.NsSeparatorTkn = $1
decl.Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $2)
@ -1061,7 +1061,7 @@ statement:
{
$$ = &ast.StmtLabel{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $2),
LabelName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -1082,7 +1082,7 @@ catch_list:
catch.OpenParenthesisTkn = $3
catch.Var = &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($5),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($5),
IdentifierTkn: $5,
Value: $5.Value,
@ -1160,7 +1160,7 @@ function_declaration_statement:
Position: yylex.(*Parser).builder.NewTokensPosition($1, $11),
FunctionTkn: $1,
AmpersandTkn: $2,
FunctionName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
IdentifierTkn: $3,
Value: $3.Value,
@ -1207,7 +1207,7 @@ class_declaration_statement:
Position: yylex.(*Parser).builder.NewOptionalListTokensPosition($1, $2, $9),
Modifiers: $1,
ClassTkn: $2,
ClassName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
IdentifierTkn: $3,
Value: $3.Value,
@ -1235,7 +1235,7 @@ class_declaration_statement:
class := &ast.StmtClass{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $8),
ClassTkn: $1,
ClassName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($2),
IdentifierTkn: $2,
Value: $2.Value,
@ -1296,7 +1296,7 @@ trait_declaration_statement:
$$ = &ast.StmtTrait{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $6),
TraitTkn: $1,
TraitName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($2),
IdentifierTkn: $2,
Value: $2.Value,
@ -1314,7 +1314,7 @@ interface_declaration_statement:
iface := &ast.StmtInterface{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $7),
InterfaceTkn: $1,
InterfaceName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($2),
IdentifierTkn: $2,
Value: $2.Value,
@ -1492,7 +1492,7 @@ switch_case_list:
$$ = &ast.StmtSwitch{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
OpenCurlyBracketTkn: $1,
CaseList: $2,
Cases: $2,
CloseCurlyBracketTkn: $3,
}
}
@ -1502,7 +1502,7 @@ switch_case_list:
Position: yylex.(*Parser).builder.NewTokensPosition($1, $4),
OpenCurlyBracketTkn: $1,
CaseSeparatorTkn: $2,
CaseList: $3,
Cases: $3,
CloseCurlyBracketTkn: $4,
}
}
@ -1511,7 +1511,7 @@ switch_case_list:
$$ = &ast.StmtSwitch{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $4),
ColonTkn: $1,
CaseList: $2,
Cases: $2,
EndSwitchTkn: $3,
SemiColonTkn: $4,
}
@ -1522,7 +1522,7 @@ switch_case_list:
Position: yylex.(*Parser).builder.NewTokensPosition($1, $5),
ColonTkn: $1,
CaseSeparatorTkn: $2,
CaseList: $3,
Cases: $3,
EndSwitchTkn: $4,
SemiColonTkn: $5,
}
@ -1746,7 +1746,7 @@ parameter:
VariadicTkn: $3,
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($4),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($4),
IdentifierTkn: $4,
Value: $4.Value,
@ -1772,7 +1772,7 @@ parameter:
VariadicTkn: $3,
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($4),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($4),
IdentifierTkn: $4,
Value: $4.Value,
@ -1951,7 +1951,7 @@ static_var:
Position: yylex.(*Parser).builder.NewTokenPosition($1),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -1965,7 +1965,7 @@ static_var:
Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -1995,7 +1995,7 @@ class_statement:
Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1, $4),
Modifiers: $1,
Type: $2,
Properties: $3.(*ParserSeparatedList).Items,
Props: $3.(*ParserSeparatedList).Items,
SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns,
SemiColonTkn: $4,
}
@ -2043,7 +2043,7 @@ class_statement:
Modifiers: $1,
FunctionTkn: $2,
AmpersandTkn: $3,
MethodName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($4),
IdentifierTkn: $4,
Value: $4.Value,
@ -2369,7 +2369,7 @@ property:
Position: yylex.(*Parser).builder.NewTokenPosition($1),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -2384,7 +2384,7 @@ property:
Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -2501,7 +2501,7 @@ anonymous_class:
Position: yylex.(*Parser).builder.NewTokensPosition($1, $8),
ClassTkn: $1,
OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn,
Arguments: $2.(*ArgumentList).Arguments,
Args: $2.(*ArgumentList).Arguments,
SeparatorTkns: $2.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn,
OpenCurlyBracketTkn: $6,
@ -2533,7 +2533,7 @@ new_expr:
NewTkn: $1,
Class: $2,
OpenParenthesisTkn: $3.(*ArgumentList).OpenParenthesisTkn,
Arguments: $3.(*ArgumentList).Arguments,
Args: $3.(*ArgumentList).Arguments,
SeparatorTkns: $3.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $3.(*ArgumentList).CloseParenthesisTkn,
}
@ -3055,7 +3055,7 @@ expr_without_variable:
{
$$ = &ast.ExprTernary{
Position: yylex.(*Parser).builder.NewNodesPosition($1, $5),
Condition: $1,
Cond: $1,
QuestionTkn: $2,
IfTrue: $3,
ColonTkn: $4,
@ -3066,7 +3066,7 @@ expr_without_variable:
{
$$ = &ast.ExprTernary{
Position: yylex.(*Parser).builder.NewNodesPosition($1, $4),
Condition: $1,
Cond: $1,
QuestionTkn: $2,
ColonTkn: $3,
IfFalse: $4,
@ -3199,7 +3199,7 @@ expr_without_variable:
$$ = &ast.ExprYield{
Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2),
YieldTkn: $1,
Value: $2,
Val: $2,
}
}
| T_YIELD expr T_DOUBLE_ARROW expr
@ -3209,7 +3209,7 @@ expr_without_variable:
YieldTkn: $1,
Key: $2,
DoubleArrowTkn: $3,
Value: $4,
Val: $4,
}
}
| T_YIELD_FROM expr
@ -3302,7 +3302,7 @@ lexical_vars:
$$ = &ast.ExprClosure{
UseTkn: $1,
UseOpenParenthesisTkn: $2,
Use: $3.(*ParserSeparatedList).Items,
Uses: $3.(*ParserSeparatedList).Items,
UseSeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns,
UseCloseParenthesisTkn: $4,
}
@ -3332,7 +3332,7 @@ lexical_var:
Position: yylex.(*Parser).builder.NewTokenPosition($1),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -3347,7 +3347,7 @@ lexical_var:
AmpersandTkn: $1,
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($2),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($2),
IdentifierTkn: $2,
Value: $2.Value,
@ -3364,7 +3364,7 @@ function_call:
Position: yylex.(*Parser).builder.NewNodesPosition($1, $2),
Function: $1,
OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn,
Arguments: $2.(*ArgumentList).Arguments,
Args: $2.(*ArgumentList).Arguments,
SeparatorTkns: $2.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn,
}
@ -3377,7 +3377,7 @@ function_call:
DoubleColonTkn: $2,
Call: $3,
OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn,
Arguments: $4.(*ArgumentList).Arguments,
Args: $4.(*ArgumentList).Arguments,
SeparatorTkns: $4.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn,
}
@ -3398,7 +3398,7 @@ function_call:
DoubleColonTkn: $2,
Call: $3,
OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn,
Arguments: $4.(*ArgumentList).Arguments,
Args: $4.(*ArgumentList).Arguments,
SeparatorTkns: $4.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn,
}
@ -3417,7 +3417,7 @@ function_call:
Position: yylex.(*Parser).builder.NewNodesPosition($1, $2),
Function: $1,
OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn,
Arguments: $2.(*ArgumentList).Arguments,
Args: $2.(*ArgumentList).Arguments,
SeparatorTkns: $2.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn,
}
@ -3676,7 +3676,7 @@ constant:
Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3),
Class: $1,
DoubleColonTkn: $2,
ConstantName: &ast.Identifier{
Const: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
IdentifierTkn: $3,
Value: $3.Value,
@ -3689,7 +3689,7 @@ constant:
Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3),
Class: $1,
DoubleColonTkn: $2,
ConstantName: &ast.Identifier{
Const: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
IdentifierTkn: $3,
Value: $3.Value,
@ -3810,7 +3810,7 @@ callable_variable:
ObjectOperatorTkn: $2,
Method: $3,
OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn,
Arguments: $4.(*ArgumentList).Arguments,
Args: $4.(*ArgumentList).Arguments,
SeparatorTkns: $4.(*ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn,
}
@ -3844,12 +3844,12 @@ variable:
Position: yylex.(*Parser).builder.NewNodesPosition($1, $3),
Var: $1,
ObjectOperatorTkn: $2,
Property: $3,
Prop: $3,
}
if brackets, ok := $3.(*ParserBrackets); ok {
propertyFetch.OpenCurlyBracketTkn = brackets.OpenBracketTkn
propertyFetch.Property = brackets.Child
propertyFetch.Prop = brackets.Child
propertyFetch.CloseCurlyBracketTkn = brackets.CloseBracketTkn
}
@ -3862,7 +3862,7 @@ simple_variable:
{
$$ = &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -3875,7 +3875,7 @@ simple_variable:
Position: yylex.(*Parser).builder.NewTokensPosition($1, $4),
DollarTkn: $1,
OpenCurlyBracketTkn: $2,
VarName: $3,
Name: $3,
CloseCurlyBracketTkn: $4,
}
}
@ -3884,7 +3884,7 @@ simple_variable:
$$ = &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2),
DollarTkn: $1,
VarName: $2,
Name: $2,
}
}
;
@ -3896,7 +3896,7 @@ static_member:
Position: yylex.(*Parser).builder.NewNodesPosition($1, $3),
Class: $1,
DoubleColonTkn: $2,
Property: $3,
Prop: $3,
}
}
| variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable
@ -3905,7 +3905,7 @@ static_member:
Position: yylex.(*Parser).builder.NewNodesPosition($1, $3),
Class: $1,
DoubleColonTkn: $2,
Property: $3,
Prop: $3,
}
}
;
@ -3941,12 +3941,12 @@ new_variable:
Position: yylex.(*Parser).builder.NewNodesPosition($1, $3),
Var: $1,
ObjectOperatorTkn: $2,
Property: $3,
Prop: $3,
}
if brackets, ok := $3.(*ParserBrackets); ok {
propertyFetch.OpenCurlyBracketTkn = brackets.OpenBracketTkn
propertyFetch.Property = brackets.Child
propertyFetch.Prop = brackets.Child
propertyFetch.CloseCurlyBracketTkn = brackets.CloseBracketTkn
}
@ -3958,7 +3958,7 @@ new_variable:
Position: yylex.(*Parser).builder.NewNodesPosition($1, $3),
Class: $1,
DoubleColonTkn: $2,
Property: $3,
Prop: $3,
}
}
| new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable
@ -3967,7 +3967,7 @@ new_variable:
Position: yylex.(*Parser).builder.NewNodesPosition($1, $3),
Class: $1,
DoubleColonTkn: $2,
Property: $3,
Prop: $3,
}
}
;
@ -4174,7 +4174,7 @@ encaps_var:
{
$$ = &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -4187,7 +4187,7 @@ encaps_var:
Position: yylex.(*Parser).builder.NewTokensPosition($1, $4),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
@ -4204,14 +4204,14 @@ encaps_var:
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
Var: &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,
},
},
ObjectOperatorTkn: $2,
Property: &ast.Identifier{
Prop: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($3),
IdentifierTkn: $3,
Value: $3.Value,
@ -4223,7 +4223,7 @@ encaps_var:
$$ = &ast.ScalarEncapsedStringVar{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
DollarOpenCurlyBracketTkn: $1,
VarName: $2,
Name: $2,
CloseCurlyBracketTkn: $3,
}
}
@ -4232,7 +4232,7 @@ encaps_var:
$$ = &ast.ScalarEncapsedStringVar{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
DollarOpenCurlyBracketTkn: $1,
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($2),
IdentifierTkn: $2,
Value: $2.Value,
@ -4245,7 +4245,7 @@ encaps_var:
$$ = &ast.ScalarEncapsedStringVar{
Position: yylex.(*Parser).builder.NewTokensPosition($1, $3),
DollarOpenCurlyBracketTkn: $1,
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($2),
IdentifierTkn: $2,
Value: $2.Value,
@ -4321,7 +4321,7 @@ encaps_var_offset:
{
$$ = &ast.ExprVariable{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
VarName: &ast.Identifier{
Name: &ast.Identifier{
Position: yylex.(*Parser).builder.NewTokenPosition($1),
IdentifierTkn: $1,
Value: $1.Value,

View File

@ -57,9 +57,9 @@ type Visitor interface {
StmtTraitUsePrecedence(n *StmtTraitUsePrecedence)
StmtTry(n *StmtTry)
StmtUnset(n *StmtUnset)
StmtUse(n *StmtUse)
StmtGroupUse(n *StmtGroupUse)
StmtUseDeclaration(n *StmtUseDeclaration)
StmtUse(n *StmtUseList)
StmtGroupUse(n *StmtGroupUseList)
StmtUseDeclaration(n *StmtUse)
StmtWhile(n *StmtWhile)
ExprArray(n *ExprArray)
@ -166,8 +166,8 @@ type Visitor interface {
ScalarMagicConstant(n *ScalarMagicConstant)
ScalarString(n *ScalarString)
NameName(n *NameName)
NameName(n *Name)
NameFullyQualified(n *NameFullyQualified)
NameRelative(n *NameRelative)
NameNamePart(n *NameNamePart)
NameNamePart(n *NamePart)
}

View File

@ -135,7 +135,7 @@ func (n *ScalarEncapsedStringPart) GetPosition() *position.Position {
type ScalarEncapsedStringVar struct {
Position *position.Position
DollarOpenCurlyBracketTkn *token.Token
VarName Vertex
Name Vertex
OpenSquareBracketTkn *token.Token
Dim Vertex
CloseSquareBracketTkn *token.Token
@ -288,9 +288,9 @@ type StmtClass struct {
Position *position.Position
Modifiers []Vertex
ClassTkn *token.Token
ClassName Vertex
Name Vertex
OpenParenthesisTkn *token.Token
Arguments []Vertex
Args []Vertex
SeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token
ExtendsTkn *token.Token
@ -335,7 +335,7 @@ type StmtClassMethod struct {
Modifiers []Vertex
FunctionTkn *token.Token
AmpersandTkn *token.Token
MethodName Vertex
Name Vertex
OpenParenthesisTkn *token.Token
Params []Vertex
SeparatorTkns []*token.Token
@ -603,7 +603,7 @@ type StmtFunction struct {
Position *position.Position
FunctionTkn *token.Token
AmpersandTkn *token.Token
FunctionName Vertex
Name Vertex
OpenParenthesisTkn *token.Token
Params []Vertex
SeparatorTkns []*token.Token
@ -715,7 +715,7 @@ func (n *StmtInlineHtml) GetPosition() *position.Position {
type StmtInterface struct {
Position *position.Position
InterfaceTkn *token.Token
InterfaceName Vertex
Name Vertex
ExtendsTkn *token.Token
Extends []Vertex
ExtendsSeparatorTkns []*token.Token
@ -735,7 +735,7 @@ func (n *StmtInterface) GetPosition() *position.Position {
// StmtLabel node
type StmtLabel struct {
Position *position.Position
LabelName Vertex
Name Vertex
ColonTkn *token.Token
}
@ -801,7 +801,7 @@ type StmtPropertyList struct {
Position *position.Position
Modifiers []Vertex
Type Vertex
Properties []Vertex
Props []Vertex
SeparatorTkns []*token.Token
SemiColonTkn *token.Token
}
@ -889,7 +889,7 @@ type StmtSwitch struct {
ColonTkn *token.Token
OpenCurlyBracketTkn *token.Token
CaseSeparatorTkn *token.Token
CaseList []Vertex
Cases []Vertex
CloseCurlyBracketTkn *token.Token
EndSwitchTkn *token.Token
SemiColonTkn *token.Token
@ -923,7 +923,7 @@ func (n *StmtThrow) GetPosition() *position.Position {
type StmtTrait struct {
Position *position.Position
TraitTkn *token.Token
TraitName Vertex
Name Vertex
OpenCurlyBracketTkn *token.Token
Stmts []Vertex
CloseCurlyBracketTkn *token.Token
@ -1035,26 +1035,26 @@ func (n *StmtUnset) GetPosition() *position.Position {
return n.Position
}
// StmtUse node
type StmtUse struct {
// StmtUseList node
type StmtUseList struct {
Position *position.Position
UseTkn *token.Token
Type Vertex
UseDeclarations []Vertex
Uses []Vertex
SeparatorTkns []*token.Token
SemiColonTkn *token.Token
}
func (n *StmtUse) Accept(v Visitor) {
func (n *StmtUseList) Accept(v Visitor) {
v.StmtUse(n)
}
func (n *StmtUse) GetPosition() *position.Position {
func (n *StmtUseList) GetPosition() *position.Position {
return n.Position
}
// StmtGroupUse node
type StmtGroupUse struct {
// StmtGroupUseList node
type StmtGroupUseList struct {
Position *position.Position
UseTkn *token.Token
Type Vertex
@ -1062,22 +1062,22 @@ type StmtGroupUse struct {
Prefix Vertex
NsSeparatorTkn *token.Token
OpenCurlyBracketTkn *token.Token
UseDeclarations []Vertex
Uses []Vertex
SeparatorTkns []*token.Token
CloseCurlyBracketTkn *token.Token
SemiColonTkn *token.Token
}
func (n *StmtGroupUse) Accept(v Visitor) {
func (n *StmtGroupUseList) Accept(v Visitor) {
v.StmtGroupUse(n)
}
func (n *StmtGroupUse) GetPosition() *position.Position {
func (n *StmtGroupUseList) GetPosition() *position.Position {
return n.Position
}
// StmtUseDeclaration node
type StmtUseDeclaration struct {
// StmtUse node
type StmtUse struct {
Position *position.Position
Type Vertex
NsSeparatorTkn *token.Token
@ -1086,11 +1086,11 @@ type StmtUseDeclaration struct {
Alias Vertex
}
func (n *StmtUseDeclaration) Accept(v Visitor) {
func (n *StmtUse) Accept(v Visitor) {
v.StmtUseDeclaration(n)
}
func (n *StmtUseDeclaration) GetPosition() *position.Position {
func (n *StmtUse) GetPosition() *position.Position {
return n.Position
}
@ -1242,7 +1242,7 @@ type ExprClassConstFetch struct {
Position *position.Position
Class Vertex
DoubleColonTkn *token.Token
ConstantName Vertex
Const Vertex
}
func (n *ExprClassConstFetch) Accept(v Visitor) {
@ -1280,7 +1280,7 @@ type ExprClosure struct {
CloseParenthesisTkn *token.Token
UseTkn *token.Token
UseOpenParenthesisTkn *token.Token
Use []Vertex
Uses []Vertex
UseSeparatorTkns []*token.Token
UseCloseParenthesisTkn *token.Token
ColonTkn *token.Token
@ -1398,7 +1398,7 @@ type ExprFunctionCall struct {
Position *position.Position
Function Vertex
OpenParenthesisTkn *token.Token
Arguments []Vertex
Args []Vertex
SeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token
}
@ -1502,7 +1502,7 @@ type ExprMethodCall struct {
Method Vertex
CloseCurlyBracketTkn *token.Token
OpenParenthesisTkn *token.Token
Arguments []Vertex
Args []Vertex
SeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token
}
@ -1521,7 +1521,7 @@ type ExprNew struct {
NewTkn *token.Token
Class Vertex
OpenParenthesisTkn *token.Token
Arguments []Vertex
Args []Vertex
SeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token
}
@ -1615,7 +1615,7 @@ type ExprPropertyFetch struct {
Var Vertex
ObjectOperatorTkn *token.Token
OpenCurlyBracketTkn *token.Token
Property Vertex
Prop Vertex
CloseCurlyBracketTkn *token.Token
}
@ -1682,7 +1682,7 @@ type ExprStaticCall struct {
Call Vertex
CloseCurlyBracketTkn *token.Token
OpenParenthesisTkn *token.Token
Arguments []Vertex
Args []Vertex
SeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token
}
@ -1700,7 +1700,7 @@ type ExprStaticPropertyFetch struct {
Position *position.Position
Class Vertex
DoubleColonTkn *token.Token
Property Vertex
Prop Vertex
}
func (n *ExprStaticPropertyFetch) Accept(v Visitor) {
@ -1714,7 +1714,7 @@ func (n *ExprStaticPropertyFetch) GetPosition() *position.Position {
// ExprTernary node
type ExprTernary struct {
Position *position.Position
Condition Vertex
Cond Vertex
QuestionTkn *token.Token
IfTrue Vertex
ColonTkn *token.Token
@ -1764,7 +1764,7 @@ type ExprVariable struct {
Position *position.Position
DollarTkn *token.Token
OpenCurlyBracketTkn *token.Token
VarName Vertex
Name Vertex
CloseCurlyBracketTkn *token.Token
}
@ -1782,7 +1782,7 @@ type ExprYield struct {
YieldTkn *token.Token
Key Vertex
DoubleArrowTkn *token.Token
Value Vertex
Val Vertex
}
func (n *ExprYield) Accept(v Visitor) {
@ -2586,17 +2586,17 @@ func (n *ExprBinarySpaceship) GetPosition() *position.Position {
return n.Position
}
type NameName struct {
type Name struct {
Position *position.Position
Parts []Vertex
SeparatorTkns []*token.Token
}
func (n *NameName) Accept(v Visitor) {
func (n *Name) Accept(v Visitor) {
v.NameName(n)
}
func (n *NameName) GetPosition() *position.Position {
func (n *Name) GetPosition() *position.Position {
return n.Position
}
@ -2631,16 +2631,16 @@ func (n *NameRelative) GetPosition() *position.Position {
return n.Position
}
type NameNamePart struct {
type NamePart struct {
Position *position.Position
StringTkn *token.Token
Value []byte
}
func (n *NameNamePart) Accept(v Visitor) {
func (n *NamePart) Accept(v Visitor) {
v.NameNamePart(n)
}
func (n *NameNamePart) GetPosition() *position.Position {
func (n *NamePart) GetPosition() *position.Position {
return n.Position
}

View File

@ -99,7 +99,7 @@ func (v *Dumper) dumpToken(key string, tok *token.Token) {
v.print(v.indent, "ID: token."+tok.ID.String()+",\n")
}
if tok.Value != nil {
v.print(v.indent, "Value: []byte("+strconv.Quote(string(tok.Value))+"),\n")
v.print(v.indent, "Val: []byte("+strconv.Quote(string(tok.Value))+"),\n")
}
v.dumpPosition(tok.Position)
v.dumpTokenList("FreeFloating", tok.FreeFloating)
@ -209,7 +209,7 @@ func (v *Dumper) Identifier(n *ast.Identifier) {
v.dumpPosition(n.Position)
v.dumpToken("IdentifierTkn", n.IdentifierTkn)
v.dumpValue("Value", n.Value)
v.dumpValue("Val", n.Value)
v.indent--
v.print(v.indent, "},\n")
@ -281,9 +281,9 @@ func (v *Dumper) StmtClass(n *ast.StmtClass) {
v.dumpPosition(n.Position)
v.dumpVertexList("Modifiers", n.Modifiers)
v.dumpToken("ClassTkn", n.ClassTkn)
v.dumpVertex("ClassName", n.ClassName)
v.dumpVertex("Name", n.Name)
v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn)
v.dumpVertexList("Arguments", n.Arguments)
v.dumpVertexList("Args", n.Args)
v.dumpTokenList("SeparatorTkns", n.SeparatorTkns)
v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn)
v.dumpToken("ExtendsTkn", n.ExtendsTkn)
@ -322,7 +322,7 @@ func (v *Dumper) StmtClassMethod(n *ast.StmtClassMethod) {
v.dumpVertexList("Modifiers", n.Modifiers)
v.dumpToken("FunctionTkn", n.FunctionTkn)
v.dumpToken("AmpersandTkn", n.AmpersandTkn)
v.dumpVertex("MethodName", n.MethodName)
v.dumpVertex("Name", n.Name)
v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn)
v.dumpVertexList("Params", n.Params)
v.dumpTokenList("SeparatorTkns", n.SeparatorTkns)
@ -549,7 +549,7 @@ func (v *Dumper) StmtFunction(n *ast.StmtFunction) {
v.dumpPosition(n.Position)
v.dumpToken("FunctionTkn", n.FunctionTkn)
v.dumpToken("AmpersandTkn", n.AmpersandTkn)
v.dumpVertex("FunctionName", n.FunctionName)
v.dumpVertex("Name", n.Name)
v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn)
v.dumpVertexList("Params", n.Params)
v.dumpTokenList("SeparatorTkns", n.SeparatorTkns)
@ -631,7 +631,7 @@ func (v *Dumper) StmtInlineHtml(n *ast.StmtInlineHtml) {
v.dumpPosition(n.Position)
v.dumpToken("InlineHtmlTkn", n.InlineHtmlTkn)
v.dumpValue("Value", n.Value)
v.dumpValue("Val", n.Value)
v.indent--
v.print(v.indent, "},\n")
@ -643,7 +643,7 @@ func (v *Dumper) StmtInterface(n *ast.StmtInterface) {
v.dumpPosition(n.Position)
v.dumpToken("InterfaceTkn", n.InterfaceTkn)
v.dumpVertex("InterfaceName", n.InterfaceName)
v.dumpVertex("Name", n.Name)
v.dumpToken("ExtendsTkn", n.ExtendsTkn)
v.dumpVertexList("Extends", n.Extends)
v.dumpTokenList("ExtendsSeparatorTkns", n.ExtendsSeparatorTkns)
@ -660,7 +660,7 @@ func (v *Dumper) StmtLabel(n *ast.StmtLabel) {
v.indent++
v.dumpPosition(n.Position)
v.dumpVertex("LabelName", n.LabelName)
v.dumpVertex("Name", n.Name)
v.dumpToken("ColonTkn", n.ColonTkn)
v.indent--
@ -714,7 +714,7 @@ func (v *Dumper) StmtPropertyList(n *ast.StmtPropertyList) {
v.dumpPosition(n.Position)
v.dumpVertexList("Modifiers", n.Modifiers)
v.dumpVertex("Type", n.Type)
v.dumpVertexList("Properties", n.Properties)
v.dumpVertexList("Props", n.Props)
v.dumpTokenList("SeparatorTkns", n.SeparatorTkns)
v.dumpToken("SemiColonTkn", n.SemiColonTkn)
@ -787,7 +787,7 @@ func (v *Dumper) StmtSwitch(n *ast.StmtSwitch) {
v.dumpToken("ColonTkn", n.ColonTkn)
v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn)
v.dumpToken("CaseSeparatorTkn", n.CaseSeparatorTkn)
v.dumpVertexList("CaseList", n.CaseList)
v.dumpVertexList("Cases", n.Cases)
v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
v.dumpToken("EndSwitchTkn", n.EndSwitchTkn)
v.dumpToken("SemiColonTkn", n.SemiColonTkn)
@ -815,7 +815,7 @@ func (v *Dumper) StmtTrait(n *ast.StmtTrait) {
v.dumpPosition(n.Position)
v.dumpToken("TraitTkn", n.TraitTkn)
v.dumpVertex("TraitName", n.TraitName)
v.dumpVertex("Name", n.Name)
v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn)
v.dumpVertexList("Stmts", n.Stmts)
v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
@ -907,14 +907,14 @@ func (v *Dumper) StmtUnset(n *ast.StmtUnset) {
v.print(v.indent, "},\n")
}
func (v *Dumper) StmtUse(n *ast.StmtUse) {
v.print(0, "&ast.StmtUse{\n")
func (v *Dumper) StmtUse(n *ast.StmtUseList) {
v.print(0, "&ast.StmtUseList{\n")
v.indent++
v.dumpPosition(n.Position)
v.dumpToken("UseTkn", n.UseTkn)
v.dumpVertex("Type", n.Type)
v.dumpVertexList("UseDeclarations", n.UseDeclarations)
v.dumpVertexList("Uses", n.Uses)
v.dumpTokenList("SeparatorTkns", n.SeparatorTkns)
v.dumpToken("SemiColonTkn", n.SemiColonTkn)
@ -922,8 +922,8 @@ func (v *Dumper) StmtUse(n *ast.StmtUse) {
v.print(v.indent, "},\n")
}
func (v *Dumper) StmtGroupUse(n *ast.StmtGroupUse) {
v.print(0, "&ast.StmtGroupUse{\n")
func (v *Dumper) StmtGroupUse(n *ast.StmtGroupUseList) {
v.print(0, "&ast.StmtGroupUseList{\n")
v.indent++
v.dumpPosition(n.Position)
@ -933,7 +933,7 @@ func (v *Dumper) StmtGroupUse(n *ast.StmtGroupUse) {
v.dumpVertex("Prefix", n.Prefix)
v.dumpToken("NsSeparatorTkn", n.NsSeparatorTkn)
v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn)
v.dumpVertexList("UseDeclarations", n.UseDeclarations)
v.dumpVertexList("Uses", n.Uses)
v.dumpTokenList("SeparatorTkns", n.SeparatorTkns)
v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
v.dumpToken("SemiColonTkn", n.SemiColonTkn)
@ -942,14 +942,14 @@ func (v *Dumper) StmtGroupUse(n *ast.StmtGroupUse) {
v.print(v.indent, "},\n")
}
func (v *Dumper) StmtUseDeclaration(n *ast.StmtUseDeclaration) {
v.print(0, "&ast.StmtUseDeclaration{\n")
func (v *Dumper) StmtUseDeclaration(n *ast.StmtUse) {
v.print(0, "&ast.StmtUse{\n")
v.indent++
v.dumpPosition(n.Position)
v.dumpVertex("Type", n.Type)
v.dumpToken("NsSeparatorTkn", n.NsSeparatorTkn)
v.dumpVertex("Use", n.Use)
v.dumpVertex("Uses", n.Use)
v.dumpToken("AsTkn", n.AsTkn)
v.dumpVertex("Alias", n.Alias)
@ -1084,7 +1084,7 @@ func (v *Dumper) ExprClassConstFetch(n *ast.ExprClassConstFetch) {
v.dumpPosition(n.Position)
v.dumpVertex("Class", n.Class)
v.dumpToken("DoubleColonTkn", n.DoubleColonTkn)
v.dumpVertex("ConstantName", n.ConstantName)
v.dumpVertex("Const", n.Const)
v.indent--
v.print(v.indent, "},\n")
@ -1116,7 +1116,7 @@ func (v *Dumper) ExprClosure(n *ast.ExprClosure) {
v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn)
v.dumpToken("UseTkn", n.UseTkn)
v.dumpToken("UseOpenParenthesisTkn", n.UseOpenParenthesisTkn)
v.dumpVertexList("Use", n.Use)
v.dumpVertexList("Uses", n.Uses)
v.dumpTokenList("UseSeparatorTkns", n.UseSeparatorTkns)
v.dumpToken("UseCloseParenthesisTkn", n.UseCloseParenthesisTkn)
v.dumpToken("ColonTkn", n.ColonTkn)
@ -1213,7 +1213,7 @@ func (v *Dumper) ExprFunctionCall(n *ast.ExprFunctionCall) {
v.dumpPosition(n.Position)
v.dumpVertex("Function", n.Function)
v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn)
v.dumpVertexList("Arguments", n.Arguments)
v.dumpVertexList("Args", n.Args)
v.dumpTokenList("SeparatorTkns", n.SeparatorTkns)
v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn)
@ -1299,7 +1299,7 @@ func (v *Dumper) ExprMethodCall(n *ast.ExprMethodCall) {
v.dumpVertex("Method", n.Method)
v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn)
v.dumpVertexList("Arguments", n.Arguments)
v.dumpVertexList("Args", n.Args)
v.dumpTokenList("SeparatorTkns", n.SeparatorTkns)
v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn)
@ -1315,7 +1315,7 @@ func (v *Dumper) ExprNew(n *ast.ExprNew) {
v.dumpToken("NewTkn", n.NewTkn)
v.dumpVertex("Class", n.Class)
v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn)
v.dumpVertexList("Arguments", n.Arguments)
v.dumpVertexList("Args", n.Args)
v.dumpTokenList("SeparatorTkns", n.SeparatorTkns)
v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn)
@ -1391,7 +1391,7 @@ func (v *Dumper) ExprPropertyFetch(n *ast.ExprPropertyFetch) {
v.dumpVertex("Var", n.Var)
v.dumpToken("ObjectOperatorTkn", n.ObjectOperatorTkn)
v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn)
v.dumpVertex("Property", n.Property)
v.dumpVertex("Prop", n.Prop)
v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
v.indent--
@ -1446,7 +1446,7 @@ func (v *Dumper) ExprStaticCall(n *ast.ExprStaticCall) {
v.dumpVertex("Call", n.Call)
v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn)
v.dumpVertexList("Arguments", n.Arguments)
v.dumpVertexList("Args", n.Args)
v.dumpTokenList("SeparatorTkns", n.SeparatorTkns)
v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn)
@ -1461,7 +1461,7 @@ func (v *Dumper) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) {
v.dumpPosition(n.Position)
v.dumpVertex("Class", n.Class)
v.dumpToken("DoubleColonTkn", n.DoubleColonTkn)
v.dumpVertex("Property", n.Property)
v.dumpVertex("Prop", n.Prop)
v.indent--
v.print(v.indent, "},\n")
@ -1472,7 +1472,7 @@ func (v *Dumper) ExprTernary(n *ast.ExprTernary) {
v.indent++
v.dumpPosition(n.Position)
v.dumpVertex("Condition", n.Condition)
v.dumpVertex("Cond", n.Cond)
v.dumpToken("QuestionTkn", n.QuestionTkn)
v.dumpVertex("IfTrue", n.IfTrue)
v.dumpToken("ColonTkn", n.ColonTkn)
@ -1513,7 +1513,7 @@ func (v *Dumper) ExprVariable(n *ast.ExprVariable) {
v.dumpPosition(n.Position)
v.dumpToken("DollarTkn", n.DollarTkn)
v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn)
v.dumpVertex("VarName", n.VarName)
v.dumpVertex("Name", n.Name)
v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
v.indent--
@ -1528,7 +1528,7 @@ func (v *Dumper) ExprYield(n *ast.ExprYield) {
v.dumpToken("YieldTkn", n.YieldTkn)
v.dumpVertex("Key", n.Key)
v.dumpToken("DoubleArrowTkn", n.DoubleArrowTkn)
v.dumpVertex("Value", n.Value)
v.dumpVertex("Val", n.Val)
v.indent--
v.print(v.indent, "},\n")
@ -2183,7 +2183,7 @@ func (v *Dumper) ScalarDnumber(n *ast.ScalarDnumber) {
v.dumpPosition(n.Position)
v.dumpToken("NumberTkn", n.NumberTkn)
v.dumpValue("Value", n.Value)
v.dumpValue("Val", n.Value)
v.indent--
v.print(v.indent, "},\n")
@ -2208,7 +2208,7 @@ func (v *Dumper) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) {
v.dumpPosition(n.Position)
v.dumpToken("EncapsedStrTkn", n.EncapsedStrTkn)
v.dumpValue("Value", n.Value)
v.dumpValue("Val", n.Value)
v.indent--
v.print(v.indent, "},\n")
@ -2220,7 +2220,7 @@ func (v *Dumper) ScalarEncapsedStringVar(n *ast.ScalarEncapsedStringVar) {
v.dumpPosition(n.Position)
v.dumpToken("DollarOpenCurlyBracketTkn", n.DollarOpenCurlyBracketTkn)
v.dumpVertex("VarName", n.VarName)
v.dumpVertex("Name", n.Name)
v.dumpToken("OpenSquareBracketTkn", n.OpenSquareBracketTkn)
v.dumpVertex("Dim", n.Dim)
v.dumpToken("CloseSquareBracketTkn", n.CloseSquareBracketTkn)
@ -2262,7 +2262,7 @@ func (v *Dumper) ScalarLnumber(n *ast.ScalarLnumber) {
v.dumpPosition(n.Position)
v.dumpToken("NumberTkn", n.NumberTkn)
v.dumpValue("Value", n.Value)
v.dumpValue("Val", n.Value)
v.indent--
v.print(v.indent, "},\n")
@ -2274,7 +2274,7 @@ func (v *Dumper) ScalarMagicConstant(n *ast.ScalarMagicConstant) {
v.dumpPosition(n.Position)
v.dumpToken("MagicConstTkn", n.MagicConstTkn)
v.dumpValue("Value", n.Value)
v.dumpValue("Val", n.Value)
v.indent--
v.print(v.indent, "},\n")
@ -2287,14 +2287,14 @@ func (v *Dumper) ScalarString(n *ast.ScalarString) {
v.dumpPosition(n.Position)
v.dumpToken("MinusTkn", n.MinusTkn)
v.dumpToken("StringTkn", n.StringTkn)
v.dumpValue("Value", n.Value)
v.dumpValue("Val", n.Value)
v.indent--
v.print(v.indent, "},\n")
}
func (v *Dumper) NameName(n *ast.NameName) {
v.print(0, "&ast.NameName{\n")
func (v *Dumper) NameName(n *ast.Name) {
v.print(0, "&ast.Name{\n")
v.indent++
v.dumpPosition(n.Position)
@ -2332,13 +2332,13 @@ func (v *Dumper) NameRelative(n *ast.NameRelative) {
v.print(v.indent, "},\n")
}
func (v *Dumper) NameNamePart(n *ast.NameNamePart) {
v.print(0, "&ast.NameNamePart{\n")
func (v *Dumper) NameNamePart(n *ast.NamePart) {
v.print(0, "&ast.NamePart{\n")
v.indent++
v.dumpPosition(n.Position)
v.dumpToken("StringTkn", n.StringTkn)
v.dumpValue("Value", n.Value)
v.dumpValue("Val", n.Value)
v.indent--
v.print(v.indent, "},\n")

View File

@ -56,7 +56,7 @@ func TestDumper_root(t *testing.T) {
FreeFloating: []*token.Token{
{
ID: token.T_WHITESPACE,
Value: []byte(" "),
Val: []byte(" "),
Position: &position.Position{
StartLine: 1,
EndLine: 2,

View File

@ -267,14 +267,14 @@ func (f *formatter) StmtClass(n *ast.StmtClass) {
n.ClassTkn = f.newToken(token.T_CLASS, []byte("class"))
f.addFreeFloating(token.T_WHITESPACE, []byte(" "))
n.ClassName.Accept(f)
n.Name.Accept(f)
n.OpenParenthesisTkn = nil
n.CloseParenthesisTkn = nil
if len(n.Arguments) > 0 {
if len(n.Args) > 0 {
n.OpenParenthesisTkn = f.newToken('(', []byte("("))
n.SeparatorTkns = f.formatList(n.Arguments, ',')
n.SeparatorTkns = f.formatList(n.Args, ',')
n.CloseParenthesisTkn = f.newToken(')', []byte(")"))
}
@ -333,7 +333,7 @@ func (f *formatter) StmtClassMethod(n *ast.StmtClassMethod) {
n.AmpersandTkn = f.newToken('&', []byte("&"))
}
n.MethodName.Accept(f)
n.Name.Accept(f)
n.OpenParenthesisTkn = f.newToken('(', []byte("("))
@ -564,7 +564,7 @@ func (f *formatter) StmtFunction(n *ast.StmtFunction) {
n.AmpersandTkn = f.newToken('&', []byte("&"))
}
n.FunctionName.Accept(f)
n.Name.Accept(f)
n.OpenParenthesisTkn = f.newToken('(', []byte("("))
@ -661,7 +661,7 @@ func (f *formatter) StmtInterface(n *ast.StmtInterface) {
n.InterfaceTkn = f.newToken(token.T_INTERFACE, []byte("interface"))
f.addFreeFloating(token.T_WHITESPACE, []byte(" "))
n.InterfaceName.Accept(f)
n.Name.Accept(f)
f.addFreeFloating(token.T_WHITESPACE, []byte(" "))
if n.Extends != nil {
@ -685,7 +685,7 @@ func (f *formatter) StmtInterface(n *ast.StmtInterface) {
}
func (f *formatter) StmtLabel(n *ast.StmtLabel) {
n.LabelName.Accept(f)
n.Name.Accept(f)
n.ColonTkn = f.newToken(':', []byte(":"))
}
@ -746,7 +746,7 @@ func (f *formatter) StmtPropertyList(n *ast.StmtPropertyList) {
f.addFreeFloating(token.T_WHITESPACE, []byte(" "))
}
n.SeparatorTkns = f.formatList(n.Properties, ',')
n.SeparatorTkns = f.formatList(n.Props, ',')
n.SemiColonTkn = f.newSemicolonTkn()
}
@ -816,9 +816,9 @@ func (f *formatter) StmtSwitch(n *ast.StmtSwitch) {
f.addFreeFloating(token.T_WHITESPACE, []byte(" "))
n.OpenCurlyBracketTkn = f.newToken('{', []byte("{"))
if len(n.CaseList) > 0 {
if len(n.Cases) > 0 {
f.indent++
f.formatStmts(&n.CaseList)
f.formatStmts(&n.Cases)
f.indent--
f.addFreeFloating(token.T_WHITESPACE, []byte("\n"))
@ -841,7 +841,7 @@ func (f *formatter) StmtTrait(n *ast.StmtTrait) {
n.TraitTkn = f.newToken(token.T_TRAIT, []byte("trait"))
f.addFreeFloating(token.T_WHITESPACE, []byte(" "))
n.TraitName.Accept(f)
n.Name.Accept(f)
f.addFreeFloating(token.T_WHITESPACE, []byte(" "))
n.OpenCurlyBracketTkn = f.newToken('{', []byte("{"))
@ -964,7 +964,7 @@ func (f *formatter) StmtUnset(n *ast.StmtUnset) {
n.SemiColonTkn = f.newSemicolonTkn()
}
func (f *formatter) StmtUse(n *ast.StmtUse) {
func (f *formatter) StmtUse(n *ast.StmtUseList) {
n.UseTkn = f.newToken(token.T_USE, []byte("use"))
f.addFreeFloating(token.T_WHITESPACE, []byte(" "))
@ -973,12 +973,12 @@ func (f *formatter) StmtUse(n *ast.StmtUse) {
f.addFreeFloating(token.T_WHITESPACE, []byte(" "))
}
n.SeparatorTkns = f.formatList(n.UseDeclarations, ',')
n.SeparatorTkns = f.formatList(n.Uses, ',')
n.SemiColonTkn = f.newSemicolonTkn()
}
func (f *formatter) StmtGroupUse(n *ast.StmtGroupUse) {
func (f *formatter) StmtGroupUse(n *ast.StmtGroupUseList) {
n.UseTkn = f.newToken(token.T_USE, []byte("use"))
f.addFreeFloating(token.T_WHITESPACE, []byte(" "))
@ -993,13 +993,13 @@ func (f *formatter) StmtGroupUse(n *ast.StmtGroupUse) {
n.NsSeparatorTkn = f.newToken(token.T_NS_SEPARATOR, []byte("\\"))
n.OpenCurlyBracketTkn = f.newToken('{', []byte("{"))
n.SeparatorTkns = f.formatList(n.UseDeclarations, ',')
n.SeparatorTkns = f.formatList(n.Uses, ',')
n.CloseCurlyBracketTkn = f.newToken('}', []byte("}"))
n.SemiColonTkn = f.newSemicolonTkn()
}
func (f *formatter) StmtUseDeclaration(n *ast.StmtUseDeclaration) {
func (f *formatter) StmtUseDeclaration(n *ast.StmtUse) {
if n.Type != nil {
n.Type.Accept(f)
f.addFreeFloating(token.T_WHITESPACE, []byte(" "))
@ -1113,7 +1113,7 @@ func (f *formatter) ExprBrackets(n *ast.ExprBrackets) {
func (f *formatter) ExprClassConstFetch(n *ast.ExprClassConstFetch) {
n.Class.Accept(f)
n.DoubleColonTkn = f.newToken(token.T_PAAMAYIM_NEKUDOTAYIM, []byte("::"))
n.ConstantName.Accept(f)
n.Const.Accept(f)
}
func (f *formatter) ExprClone(n *ast.ExprClone) {
@ -1145,11 +1145,11 @@ func (f *formatter) ExprClosure(n *ast.ExprClosure) {
n.UseOpenParenthesisTkn = nil
n.UseCloseParenthesisTkn = nil
n.UseSeparatorTkns = nil
if len(n.Use) > 0 {
if len(n.Uses) > 0 {
f.addFreeFloating(token.T_WHITESPACE, []byte(" "))
n.UseTkn = f.newToken(token.T_USE, []byte("use"))
n.OpenParenthesisTkn = f.newToken('(', []byte("("))
n.SeparatorTkns = f.formatList(n.Use, ',')
n.SeparatorTkns = f.formatList(n.Uses, ',')
n.CloseParenthesisTkn = f.newToken(')', []byte(")"))
}
@ -1221,8 +1221,8 @@ func (f *formatter) ExprFunctionCall(n *ast.ExprFunctionCall) {
n.Function.Accept(f)
n.OpenParenthesisTkn = f.newToken('(', []byte("("))
n.SeparatorTkns = nil
if len(n.Arguments) > 0 {
n.SeparatorTkns = f.formatList(n.Arguments, ',')
if len(n.Args) > 0 {
n.SeparatorTkns = f.formatList(n.Args, ',')
}
n.CloseParenthesisTkn = f.newToken(')', []byte(")"))
}
@ -1281,8 +1281,8 @@ func (f *formatter) ExprMethodCall(n *ast.ExprMethodCall) {
n.OpenParenthesisTkn = f.newToken('(', []byte("("))
n.SeparatorTkns = nil
if len(n.Arguments) > 0 {
n.SeparatorTkns = f.formatList(n.Arguments, ',')
if len(n.Args) > 0 {
n.SeparatorTkns = f.formatList(n.Args, ',')
}
n.CloseParenthesisTkn = f.newToken(')', []byte(")"))
}
@ -1296,9 +1296,9 @@ func (f *formatter) ExprNew(n *ast.ExprNew) {
n.SeparatorTkns = nil
n.OpenParenthesisTkn = nil
n.CloseParenthesisTkn = nil
if len(n.Arguments) > 0 {
if len(n.Args) > 0 {
n.OpenParenthesisTkn = f.newToken('(', []byte("("))
n.SeparatorTkns = f.formatList(n.Arguments, ',')
n.SeparatorTkns = f.formatList(n.Args, ',')
n.CloseParenthesisTkn = f.newToken(')', []byte(")"))
}
}
@ -1336,7 +1336,7 @@ func (f *formatter) ExprPropertyFetch(n *ast.ExprPropertyFetch) {
n.OpenCurlyBracketTkn = nil
n.CloseCurlyBracketTkn = nil
switch n.Property.(type) {
switch n.Prop.(type) {
case *ast.Identifier:
case *ast.ExprVariable:
default:
@ -1344,7 +1344,7 @@ func (f *formatter) ExprPropertyFetch(n *ast.ExprPropertyFetch) {
n.CloseCurlyBracketTkn = f.newToken('}', []byte("}"))
}
n.Property.Accept(f)
n.Prop.Accept(f)
}
func (f *formatter) ExprRequire(n *ast.ExprRequire) {
@ -1385,8 +1385,8 @@ func (f *formatter) ExprStaticCall(n *ast.ExprStaticCall) {
n.OpenParenthesisTkn = f.newToken('(', []byte("("))
n.SeparatorTkns = nil
if len(n.Arguments) > 0 {
n.SeparatorTkns = f.formatList(n.Arguments, ',')
if len(n.Args) > 0 {
n.SeparatorTkns = f.formatList(n.Args, ',')
}
n.CloseParenthesisTkn = f.newToken(')', []byte(")"))
}
@ -1394,11 +1394,11 @@ func (f *formatter) ExprStaticCall(n *ast.ExprStaticCall) {
func (f *formatter) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) {
n.Class.Accept(f)
n.DoubleColonTkn = f.newToken(token.T_PAAMAYIM_NEKUDOTAYIM, []byte("::"))
n.Property.Accept(f)
n.Prop.Accept(f)
}
func (f *formatter) ExprTernary(n *ast.ExprTernary) {
n.Condition.Accept(f)
n.Cond.Accept(f)
f.addFreeFloating(token.T_WHITESPACE, []byte(" "))
n.QuestionTkn = f.newToken('?', []byte("?"))
if n.IfTrue != nil {
@ -1422,13 +1422,13 @@ func (f *formatter) ExprUnaryPlus(n *ast.ExprUnaryPlus) {
}
func (f *formatter) ExprVariable(n *ast.ExprVariable) {
if _, ok := n.VarName.(*ast.Identifier); !ok {
if _, ok := n.Name.(*ast.Identifier); !ok {
n.DollarTkn = f.newToken('$', []byte("$"))
}
n.OpenCurlyBracketTkn = nil
n.CloseCurlyBracketTkn = nil
switch n.VarName.(type) {
switch n.Name.(type) {
case *ast.Identifier:
case *ast.ExprVariable:
default:
@ -1436,7 +1436,7 @@ func (f *formatter) ExprVariable(n *ast.ExprVariable) {
n.CloseCurlyBracketTkn = f.newToken('}', []byte("}"))
}
n.VarName.Accept(f)
n.Name.Accept(f)
}
func (f *formatter) ExprYield(n *ast.ExprYield) {
@ -1450,7 +1450,7 @@ func (f *formatter) ExprYield(n *ast.ExprYield) {
f.addFreeFloating(token.T_WHITESPACE, []byte(" "))
}
n.Value.Accept(f)
n.Val.Accept(f)
}
func (f *formatter) ExprYieldFrom(n *ast.ExprYieldFrom) {
@ -1942,7 +1942,7 @@ func (f *formatter) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) {
func (f *formatter) ScalarEncapsedStringVar(n *ast.ScalarEncapsedStringVar) {
n.DollarOpenCurlyBracketTkn = f.newToken(token.T_DOLLAR_OPEN_CURLY_BRACES, []byte("${"))
n.VarName.Accept(f)
n.Name.Accept(f)
n.OpenSquareBracketTkn = nil
n.CloseSquareBracketTkn = nil
@ -1993,7 +1993,7 @@ func (f *formatter) ScalarString(n *ast.ScalarString) {
}
}
func (f *formatter) NameName(n *ast.NameName) {
func (f *formatter) NameName(n *ast.Name) {
separatorTkns := make([]*token.Token, len(n.Parts)-1)
for i, v := range n.Parts {
v.Accept(f)
@ -2031,7 +2031,7 @@ func (f *formatter) NameRelative(n *ast.NameRelative) {
}
}
func (f *formatter) NameNamePart(n *ast.NameNamePart) {
func (f *formatter) NameNamePart(n *ast.NamePart) {
if n.StringTkn == nil {
n.StringTkn = f.newToken(token.T_STRING, n.Value)
} else {

File diff suppressed because it is too large Load Diff

View File

@ -41,32 +41,32 @@ func (nsr *NamespaceResolver) StmtNamespace(n *ast.StmtNamespace) {
if n.Name == nil {
nsr.Namespace = NewNamespace("")
} else {
NSParts := n.Name.(*ast.NameName).Parts
NSParts := n.Name.(*ast.Name).Parts
nsr.Namespace = NewNamespace(concatNameParts(NSParts))
}
}
func (nsr *NamespaceResolver) StmtUse(n *ast.StmtUse) {
func (nsr *NamespaceResolver) StmtUse(n *ast.StmtUseList) {
useType := ""
if n.Type != nil {
useType = string(n.Type.(*ast.Identifier).Value)
}
for _, nn := range n.UseDeclarations {
for _, nn := range n.Uses {
nsr.AddAlias(useType, nn, nil)
}
nsr.goDeep = false
}
func (nsr *NamespaceResolver) StmtGroupUse(n *ast.StmtGroupUse) {
func (nsr *NamespaceResolver) StmtGroupUse(n *ast.StmtGroupUseList) {
useType := ""
if n.Type != nil {
useType = string(n.Type.(*ast.Identifier).Value)
}
for _, nn := range n.UseDeclarations {
nsr.AddAlias(useType, nn, n.Prefix.(*ast.NameName).Parts)
for _, nn := range n.Uses {
nsr.AddAlias(useType, nn, n.Prefix.(*ast.Name).Parts)
}
nsr.goDeep = false
@ -83,8 +83,8 @@ func (nsr *NamespaceResolver) StmtClass(n *ast.StmtClass) {
}
}
if n.ClassName != nil {
nsr.AddNamespacedName(n, string(n.ClassName.(*ast.Identifier).Value))
if n.Name != nil {
nsr.AddNamespacedName(n, string(n.Name.(*ast.Identifier).Value))
}
}
@ -95,15 +95,15 @@ func (nsr *NamespaceResolver) StmtInterface(n *ast.StmtInterface) {
}
}
nsr.AddNamespacedName(n, string(n.InterfaceName.(*ast.Identifier).Value))
nsr.AddNamespacedName(n, string(n.Name.(*ast.Identifier).Value))
}
func (nsr *NamespaceResolver) StmtTrait(n *ast.StmtTrait) {
nsr.AddNamespacedName(n, string(n.TraitName.(*ast.Identifier).Value))
nsr.AddNamespacedName(n, string(n.Name.(*ast.Identifier).Value))
}
func (nsr *NamespaceResolver) StmtFunction(n *ast.StmtFunction) {
nsr.AddNamespacedName(n, string(n.FunctionName.(*ast.Identifier).Value))
nsr.AddNamespacedName(n, string(n.Name.(*ast.Identifier).Value))
for _, parameter := range n.Params {
nsr.ResolveType(parameter.(*ast.Parameter).Type)
@ -218,15 +218,15 @@ func (nsr *NamespaceResolver) LeaveNode(n ast.Vertex) {
// AddAlias adds a new alias
func (nsr *NamespaceResolver) AddAlias(useType string, nn ast.Vertex, prefix []ast.Vertex) {
switch use := nn.(type) {
case *ast.StmtUseDeclaration:
case *ast.StmtUse:
if use.Type != nil {
useType = string(use.Type.(*ast.Identifier).Value)
}
useNameParts := use.Use.(*ast.NameName).Parts
useNameParts := use.Use.(*ast.Name).Parts
var alias string
if use.Alias == nil {
alias = string(useNameParts[len(useNameParts)-1].(*ast.NameNamePart).Value)
alias = string(useNameParts[len(useNameParts)-1].(*ast.NamePart).Value)
} else {
alias = string(use.Alias.(*ast.Identifier).Value)
}
@ -257,7 +257,7 @@ func (nsr *NamespaceResolver) ResolveType(n ast.Vertex) {
switch nn := n.(type) {
case *ast.Nullable:
nsr.ResolveType(nn.Expr)
case *ast.NameName:
case *ast.Name:
nsr.ResolveName(n, "")
case *ast.NameRelative:
nsr.ResolveName(n, "")
@ -308,16 +308,16 @@ func (ns *Namespace) ResolveName(nameNode ast.Vertex, aliasType string) (string,
}
return ns.Namespace + "\\" + concatNameParts(n.Parts), nil
case *ast.NameName:
case *ast.Name:
if aliasType == "const" && len(n.Parts) == 1 {
part := strings.ToLower(string(n.Parts[0].(*ast.NameNamePart).Value))
part := strings.ToLower(string(n.Parts[0].(*ast.NamePart).Value))
if part == "true" || part == "false" || part == "null" {
return part, nil
}
}
if aliasType == "" && len(n.Parts) == 1 {
part := strings.ToLower(string(n.Parts[0].(*ast.NameNamePart).Value))
part := strings.ToLower(string(n.Parts[0].(*ast.NamePart).Value))
switch part {
case "self":
@ -366,9 +366,9 @@ func (ns *Namespace) ResolveName(nameNode ast.Vertex, aliasType string) (string,
// ResolveAlias returns alias or error if not found
func (ns *Namespace) ResolveAlias(nameNode ast.Vertex, aliasType string) (string, error) {
aliasType = strings.ToLower(aliasType)
nameParts := nameNode.(*ast.NameName).Parts
nameParts := nameNode.(*ast.Name).Parts
firstPartStr := string(nameParts[0].(*ast.NameNamePart).Value)
firstPartStr := string(nameParts[0].(*ast.NamePart).Value)
if len(nameParts) > 1 { // resolve aliases for qualified names, always against class alias type
firstPartStr = strings.ToLower(firstPartStr)
@ -393,9 +393,9 @@ func concatNameParts(parts ...[]ast.Vertex) string {
for _, p := range parts {
for _, n := range p {
if str == "" {
str = string(n.(*ast.NameNamePart).Value)
str = string(n.(*ast.NamePart).Value)
} else {
str = str + "\\" + string(n.(*ast.NameNamePart).Value)
str = str + "\\" + string(n.(*ast.NamePart).Value)
}
}
}

View File

@ -11,14 +11,14 @@ import (
)
func TestResolveStaticCall(t *testing.T) {
nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}}
nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}}
stxTree := &ast.StmtStmtList{
Stmts: []ast.Vertex{
&ast.StmtUseList{
Uses: []ast.Vertex{
&ast.StmtUse{
UseDeclarations: []ast.Vertex{
&ast.StmtUseDeclaration{
Use: nameAB,
},
},
@ -41,21 +41,21 @@ func TestResolveStaticCall(t *testing.T) {
}
func TestResolveStaticPropertyFetch(t *testing.T) {
nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}}
nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}}
stxTree := &ast.StmtStmtList{
Stmts: []ast.Vertex{
&ast.StmtUseList{
Uses: []ast.Vertex{
&ast.StmtUse{
UseDeclarations: []ast.Vertex{
&ast.StmtUseDeclaration{
Use: nameAB,
},
},
},
&ast.ExprStaticPropertyFetch{
Class: nameBC,
Property: &ast.Identifier{Value: []byte("foo")},
Prop: &ast.Identifier{Value: []byte("foo")},
},
},
}
@ -71,21 +71,21 @@ func TestResolveStaticPropertyFetch(t *testing.T) {
}
func TestResolveClassConstFetch(t *testing.T) {
nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}}
nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}}
stxTree := &ast.StmtStmtList{
Stmts: []ast.Vertex{
&ast.StmtUseList{
Uses: []ast.Vertex{
&ast.StmtUse{
UseDeclarations: []ast.Vertex{
&ast.StmtUseDeclaration{
Use: nameAB,
},
},
},
&ast.ExprClassConstFetch{
Class: nameBC,
ConstantName: &ast.Identifier{Value: []byte("FOO")},
Const: &ast.Identifier{Value: []byte("FOO")},
},
},
}
@ -101,14 +101,14 @@ func TestResolveClassConstFetch(t *testing.T) {
}
func TestResolveNew(t *testing.T) {
nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}}
nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}}
stxTree := &ast.StmtStmtList{
Stmts: []ast.Vertex{
&ast.StmtUseList{
Uses: []ast.Vertex{
&ast.StmtUse{
UseDeclarations: []ast.Vertex{
&ast.StmtUseDeclaration{
Use: nameAB,
},
},
@ -130,20 +130,20 @@ func TestResolveNew(t *testing.T) {
}
func TestResolveInstanceOf(t *testing.T) {
nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}}
nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}}
stxTree := &ast.StmtStmtList{
Stmts: []ast.Vertex{
&ast.StmtUseList{
Uses: []ast.Vertex{
&ast.StmtUse{
UseDeclarations: []ast.Vertex{
&ast.StmtUseDeclaration{
Use: nameAB,
},
},
},
&ast.ExprInstanceOf{
Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}},
Expr: &ast.ExprVariable{Name: &ast.Identifier{Value: []byte("foo")}},
Class: nameBC,
},
},
@ -160,20 +160,20 @@ func TestResolveInstanceOf(t *testing.T) {
}
func TestResolveInstanceCatch(t *testing.T) {
nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}}
nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}}
nameDE := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("D")}, &ast.NameNamePart{Value: []byte("E")}}}
nameF := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("F")}}}
nameDE := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("D")}, &ast.NamePart{Value: []byte("E")}}}
nameF := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("F")}}}
stxTree := &ast.StmtStmtList{
Stmts: []ast.Vertex{
&ast.StmtUseList{
Uses: []ast.Vertex{
&ast.StmtUse{
UseDeclarations: []ast.Vertex{
&ast.StmtUseDeclaration{
Use: nameAB,
},
&ast.StmtUseDeclaration{
&ast.StmtUse{
Use: nameDE,
Alias: &ast.Identifier{Value: []byte("F")},
},
@ -187,7 +187,7 @@ func TestResolveInstanceCatch(t *testing.T) {
nameBC,
nameF,
},
Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}},
Var: &ast.ExprVariable{Name: &ast.Identifier{Value: []byte("foo")}},
Stmts: []ast.Vertex{},
},
},
@ -207,15 +207,15 @@ func TestResolveInstanceCatch(t *testing.T) {
}
func TestResolveFunctionCall(t *testing.T) {
nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}}}
nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
nameB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}}}
stxTree := &ast.StmtStmtList{
Stmts: []ast.Vertex{
&ast.StmtUse{
&ast.StmtUseList{
Type: &ast.Identifier{Value: []byte("function")},
UseDeclarations: []ast.Vertex{
&ast.StmtUseDeclaration{
Uses: []ast.Vertex{
&ast.StmtUse{
Use: nameAB,
},
},
@ -237,15 +237,15 @@ func TestResolveFunctionCall(t *testing.T) {
}
func TestResolveConstFetch(t *testing.T) {
nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}}}
nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
nameB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}}}
stxTree := &ast.StmtStmtList{
Stmts: []ast.Vertex{
&ast.StmtUse{
&ast.StmtUseList{
Type: &ast.Identifier{Value: []byte("const")},
UseDeclarations: []ast.Vertex{
&ast.StmtUseDeclaration{
Uses: []ast.Vertex{
&ast.StmtUse{
Use: nameAB,
},
},
@ -267,32 +267,32 @@ func TestResolveConstFetch(t *testing.T) {
}
func TestResolveGroupUse(t *testing.T) {
nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameBD := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("D")}}}
nameE := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("E")}}}
nameC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("C")}}}
nameF := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("F")}}}
nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
nameBD := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("D")}}}
nameE := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("E")}}}
nameC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("C")}}}
nameF := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("F")}}}
stxTree := &ast.StmtStmtList{
Stmts: []ast.Vertex{
&ast.StmtGroupUse{
&ast.StmtGroupUseList{
Prefix: nameAB,
UseDeclarations: []ast.Vertex{
&ast.StmtUseDeclaration{
Uses: []ast.Vertex{
&ast.StmtUse{
Type: &ast.Identifier{Value: []byte("Function")},
Use: nameF,
},
&ast.StmtUseDeclaration{
&ast.StmtUse{
Type: &ast.Identifier{Value: []byte("const")},
Use: nameC,
},
},
},
&ast.StmtGroupUse{
&ast.StmtGroupUseList{
Prefix: nameBD,
Type: &ast.Identifier{Value: []byte("Function")},
UseDeclarations: []ast.Vertex{
&ast.StmtUseDeclaration{
Uses: []ast.Vertex{
&ast.StmtUse{
Use: nameE,
},
},
@ -322,20 +322,20 @@ func TestResolveGroupUse(t *testing.T) {
}
func TestResolveTraitUse(t *testing.T) {
nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}}}
nameD := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("D")}}}
nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
nameB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}}}
nameD := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("D")}}}
fullyQualifiedNameB := &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}}}
fullyQualifiedNameBC := &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}}
relativeNameB := &ast.NameRelative{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}}}
relativeNameBC := &ast.NameRelative{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}}
fullyQualifiedNameB := &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}}}
fullyQualifiedNameBC := &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}}
relativeNameB := &ast.NameRelative{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}}}
relativeNameBC := &ast.NameRelative{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}}
stxTree := &ast.StmtStmtList{
Stmts: []ast.Vertex{
&ast.StmtUseList{
Uses: []ast.Vertex{
&ast.StmtUse{
UseDeclarations: []ast.Vertex{
&ast.StmtUseDeclaration{
Use: nameAB,
},
},
@ -382,11 +382,11 @@ func TestResolveTraitUse(t *testing.T) {
}
func TestResolveClassName(t *testing.T) {
nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}}
nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}}
class := &ast.StmtClass{
ClassName: &ast.Identifier{Value: []byte("A")},
Name: &ast.Identifier{Value: []byte("A")},
Extends: nameAB,
Implements: []ast.Vertex{
nameBC,
@ -412,11 +412,11 @@ func TestResolveClassName(t *testing.T) {
}
func TestResolveInterfaceName(t *testing.T) {
nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}}
nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}}
interfaceNode := &ast.StmtInterface{
InterfaceName: &ast.Identifier{Value: []byte("A")},
Name: &ast.Identifier{Value: []byte("A")},
Extends: []ast.Vertex{
nameAB,
nameBC,
@ -443,7 +443,7 @@ func TestResolveInterfaceName(t *testing.T) {
func TestResolveTraitName(t *testing.T) {
traitNode := &ast.StmtTrait{
TraitName: &ast.Identifier{Value: []byte("A")},
Name: &ast.Identifier{Value: []byte("A")},
Stmts: []ast.Vertex{},
}
@ -464,15 +464,15 @@ func TestResolveTraitName(t *testing.T) {
}
func TestResolveFunctionName(t *testing.T) {
nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}}
nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}}
functionNode := &ast.StmtFunction{
FunctionName: &ast.Identifier{Value: []byte("A")},
Name: &ast.Identifier{Value: []byte("A")},
Params: []ast.Vertex{
&ast.Parameter{
Type: nameAB,
Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}},
Var: &ast.ExprVariable{Name: &ast.Identifier{Value: []byte("foo")}},
},
},
ReturnType: &ast.Nullable{Expr: nameBC},
@ -498,15 +498,15 @@ func TestResolveFunctionName(t *testing.T) {
}
func TestResolveMethodName(t *testing.T) {
nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}}
nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}}
methodNode := &ast.StmtClassMethod{
MethodName: &ast.Identifier{Value: []byte("A")},
Name: &ast.Identifier{Value: []byte("A")},
Params: []ast.Vertex{
&ast.Parameter{
Type: nameAB,
Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}},
Var: &ast.ExprVariable{Name: &ast.Identifier{Value: []byte("foo")}},
},
},
ReturnType: &ast.Nullable{Expr: nameBC},
@ -527,14 +527,14 @@ func TestResolveMethodName(t *testing.T) {
}
func TestResolveClosureName(t *testing.T) {
nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}}
nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}}
closureNode := &ast.ExprClosure{
Params: []ast.Vertex{
&ast.Parameter{
Type: nameAB,
Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}},
Var: &ast.ExprVariable{Name: &ast.Identifier{Value: []byte("foo")}},
},
},
ReturnType: &ast.Nullable{Expr: nameBC},
@ -553,7 +553,7 @@ func TestResolveClosureName(t *testing.T) {
}
func TestResolveConstantsName(t *testing.T) {
nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
constantB := &ast.StmtConstant{
Name: &ast.Identifier{Value: []byte("B")},
@ -590,13 +590,13 @@ func TestResolveConstantsName(t *testing.T) {
}
func TestResolveNamespaces(t *testing.T) {
namespaceAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
namespaceCD := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("C")}, &ast.NameNamePart{Value: []byte("D")}}}
namespaceAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
namespaceCD := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("C")}, &ast.NamePart{Value: []byte("D")}}}
nameAC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("C")}}}
nameCF := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("C")}, &ast.NameNamePart{Value: []byte("F")}}}
nameFG := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("F")}, &ast.NameNamePart{Value: []byte("G")}}}
relativeNameCE := &ast.NameRelative{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("C")}, &ast.NameNamePart{Value: []byte("E")}}}
nameAC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("C")}}}
nameCF := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("C")}, &ast.NamePart{Value: []byte("F")}}}
nameFG := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("F")}, &ast.NamePart{Value: []byte("G")}}}
relativeNameCE := &ast.NameRelative{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("C")}, &ast.NamePart{Value: []byte("E")}}}
constantB := &ast.StmtConstant{
Name: &ast.Identifier{Value: []byte("B")},
@ -628,9 +628,9 @@ func TestResolveNamespaces(t *testing.T) {
&ast.StmtNamespace{
Name: namespaceCD,
Stmts: []ast.Vertex{
&ast.StmtUseList{
Uses: []ast.Vertex{
&ast.StmtUse{
UseDeclarations: []ast.Vertex{
&ast.StmtUseDeclaration{
Use: nameAC,
},
},
@ -666,7 +666,7 @@ func TestResolveStaticCallDinamicClassName(t *testing.T) {
stxTree := &ast.StmtStmtList{
Stmts: []ast.Vertex{
&ast.ExprStaticCall{
Class: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}},
Class: &ast.ExprVariable{Name: &ast.Identifier{Value: []byte("foo")}},
Call: &ast.Identifier{Value: []byte("foo")},
},
},
@ -681,23 +681,23 @@ func TestResolveStaticCallDinamicClassName(t *testing.T) {
}
func TestDoNotResolveReservedConstants(t *testing.T) {
namespaceName := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}
namespaceName := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}}
constantTrue := &ast.NameName{
constantTrue := &ast.Name{
Parts: []ast.Vertex{
&ast.NameNamePart{Value: []byte("True")},
&ast.NamePart{Value: []byte("True")},
},
}
constantFalse := &ast.NameName{
constantFalse := &ast.Name{
Parts: []ast.Vertex{
&ast.NameNamePart{Value: []byte("False")},
&ast.NamePart{Value: []byte("False")},
},
}
constantNull := &ast.NameName{
constantNull := &ast.Name{
Parts: []ast.Vertex{
&ast.NameNamePart{Value: []byte("NULL")},
&ast.NamePart{Value: []byte("NULL")},
},
}
@ -738,91 +738,91 @@ func TestDoNotResolveReservedConstants(t *testing.T) {
func TestDoNotResolveReservedNames(t *testing.T) {
nameInt := &ast.NameName{
nameInt := &ast.Name{
Parts: []ast.Vertex{
&ast.NameNamePart{Value: []byte("int")},
&ast.NamePart{Value: []byte("int")},
},
}
nameFloat := &ast.NameName{
nameFloat := &ast.Name{
Parts: []ast.Vertex{
&ast.NameNamePart{Value: []byte("float")},
&ast.NamePart{Value: []byte("float")},
},
}
nameBool := &ast.NameName{
nameBool := &ast.Name{
Parts: []ast.Vertex{
&ast.NameNamePart{Value: []byte("bool")},
&ast.NamePart{Value: []byte("bool")},
},
}
nameString := &ast.NameName{
nameString := &ast.Name{
Parts: []ast.Vertex{
&ast.NameNamePart{Value: []byte("string")},
&ast.NamePart{Value: []byte("string")},
},
}
nameVoid := &ast.NameName{
nameVoid := &ast.Name{
Parts: []ast.Vertex{
&ast.NameNamePart{Value: []byte("void")},
&ast.NamePart{Value: []byte("void")},
},
}
nameIterable := &ast.NameName{
nameIterable := &ast.Name{
Parts: []ast.Vertex{
&ast.NameNamePart{Value: []byte("iterable")},
&ast.NamePart{Value: []byte("iterable")},
},
}
nameObject := &ast.NameName{
nameObject := &ast.Name{
Parts: []ast.Vertex{
&ast.NameNamePart{Value: []byte("object")},
&ast.NamePart{Value: []byte("object")},
},
}
function := &ast.StmtFunction{
FunctionName: &ast.Identifier{Value: []byte("bar")},
Name: &ast.Identifier{Value: []byte("bar")},
Params: []ast.Vertex{
&ast.Parameter{
Type: nameInt,
Var: &ast.ExprVariable{
VarName: &ast.Identifier{Value: []byte("Int")},
Name: &ast.Identifier{Value: []byte("Int")},
},
},
&ast.Parameter{
Type: nameFloat,
Var: &ast.ExprVariable{
VarName: &ast.Identifier{Value: []byte("Float")},
Name: &ast.Identifier{Value: []byte("Float")},
},
},
&ast.Parameter{
Type: nameBool,
Var: &ast.ExprVariable{
VarName: &ast.Identifier{Value: []byte("Bool")},
Name: &ast.Identifier{Value: []byte("Bool")},
},
},
&ast.Parameter{
Type: nameString,
Var: &ast.ExprVariable{
VarName: &ast.Identifier{Value: []byte("String")},
Name: &ast.Identifier{Value: []byte("String")},
},
},
&ast.Parameter{
Type: nameVoid,
Var: &ast.ExprVariable{
VarName: &ast.Identifier{Value: []byte("Void")},
Name: &ast.Identifier{Value: []byte("Void")},
},
},
&ast.Parameter{
Type: nameIterable,
Var: &ast.ExprVariable{
VarName: &ast.Identifier{Value: []byte("Iterable")},
Name: &ast.Identifier{Value: []byte("Iterable")},
},
},
&ast.Parameter{
Type: nameObject,
Var: &ast.ExprVariable{
VarName: &ast.Identifier{Value: []byte("Object")},
Name: &ast.Identifier{Value: []byte("Object")},
},
},
},
@ -831,9 +831,9 @@ func TestDoNotResolveReservedNames(t *testing.T) {
stxTree := &ast.StmtStmtList{
Stmts: []ast.Vertex{
&ast.StmtNamespace{
Name: &ast.NameName{
Name: &ast.Name{
Parts: []ast.Vertex{
&ast.NameNamePart{Value: []byte("Foo")},
&ast.NamePart{Value: []byte("Foo")},
},
},
},
@ -860,26 +860,26 @@ func TestDoNotResolveReservedNames(t *testing.T) {
func TestDoNotResolveReservedSpecialNames(t *testing.T) {
nameSelf := &ast.NameName{
nameSelf := &ast.Name{
Parts: []ast.Vertex{
&ast.NameNamePart{Value: []byte("Self")},
&ast.NamePart{Value: []byte("Self")},
},
}
nameStatic := &ast.NameName{
nameStatic := &ast.Name{
Parts: []ast.Vertex{
&ast.NameNamePart{Value: []byte("Static")},
&ast.NamePart{Value: []byte("Static")},
},
}
nameParent := &ast.NameName{
nameParent := &ast.Name{
Parts: []ast.Vertex{
&ast.NameNamePart{Value: []byte("Parent")},
&ast.NamePart{Value: []byte("Parent")},
},
}
cls := &ast.StmtClass{
ClassName: &ast.Identifier{Value: []byte("Bar")},
Name: &ast.Identifier{Value: []byte("Bar")},
Stmts: []ast.Vertex{
&ast.StmtExpression{
Expr: &ast.ExprStaticCall{
@ -905,9 +905,9 @@ func TestDoNotResolveReservedSpecialNames(t *testing.T) {
stxTree := &ast.StmtStmtList{
Stmts: []ast.Vertex{
&ast.StmtNamespace{
Name: &ast.NameName{
Name: &ast.Name{
Parts: []ast.Vertex{
&ast.NameNamePart{Value: []byte("Foo")},
&ast.NamePart{Value: []byte("Foo")},
},
},
},
@ -928,9 +928,9 @@ func TestDoNotResolveReservedSpecialNames(t *testing.T) {
assert.DeepEqual(t, expected, nsResolver.ResolvedNames)
}
func TestResolvePropertyTypeName(t *testing.T) {
nameSimple := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameRelative := &ast.NameRelative{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameFullyQualified := &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}}
nameSimple := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
nameRelative := &ast.NameRelative{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
nameFullyQualified := &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}}
propertyNodeSimple := &ast.StmtPropertyList{
Type: nameSimple,
@ -945,7 +945,7 @@ func TestResolvePropertyTypeName(t *testing.T) {
}
classNode := &ast.StmtClass{
ClassName: &ast.Identifier{Value: []byte("Bar")},
Name: &ast.Identifier{Value: []byte("Bar")},
Stmts: []ast.Vertex{
propertyNodeSimple,
propertyNodeRelative,
@ -956,9 +956,9 @@ func TestResolvePropertyTypeName(t *testing.T) {
stmts := &ast.StmtStmtList{
Stmts: []ast.Vertex{
&ast.StmtNamespace{
Name: &ast.NameName{
Name: &ast.Name{
Parts: []ast.Vertex{
&ast.NameNamePart{Value: []byte("Foo")},
&ast.NamePart{Value: []byte("Foo")},
},
},
},

View File

@ -214,15 +214,15 @@ func (v *Null) StmtUnset(_ *ast.StmtUnset) {
// do nothing
}
func (v *Null) StmtUse(_ *ast.StmtUse) {
func (v *Null) StmtUse(_ *ast.StmtUseList) {
// do nothing
}
func (v *Null) StmtGroupUse(_ *ast.StmtGroupUse) {
func (v *Null) StmtGroupUse(_ *ast.StmtGroupUseList) {
// do nothing
}
func (v *Null) StmtUseDeclaration(_ *ast.StmtUseDeclaration) {
func (v *Null) StmtUseDeclaration(_ *ast.StmtUse) {
// do nothing
}
@ -626,7 +626,7 @@ func (v *Null) ScalarString(_ *ast.ScalarString) {
// do nothing
}
func (v *Null) NameName(_ *ast.NameName) {
func (v *Null) NameName(_ *ast.Name) {
// do nothing
}
@ -638,6 +638,6 @@ func (v *Null) NameRelative(_ *ast.NameRelative) {
// do nothing
}
func (v *Null) NameNamePart(_ *ast.NameNamePart) {
func (v *Null) NameNamePart(_ *ast.NamePart) {
// do nothing
}

View File

@ -190,10 +190,10 @@ func (p *printer) StmtCatch(n *ast.StmtCatch) {
func (p *printer) StmtClass(n *ast.StmtClass) {
p.printList(n.Modifiers)
p.printToken(n.ClassTkn, []byte("class"))
p.printNode(n.ClassName)
p.printToken(n.OpenParenthesisTkn, p.ifNodeList(n.Arguments, []byte("(")))
p.printSeparatedList(n.Arguments, n.SeparatorTkns, []byte(","))
p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Arguments, []byte(")")))
p.printNode(n.Name)
p.printToken(n.OpenParenthesisTkn, p.ifNodeList(n.Args, []byte("(")))
p.printSeparatedList(n.Args, n.SeparatorTkns, []byte(","))
p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Args, []byte(")")))
p.printToken(n.ExtendsTkn, p.ifNode(n.Extends, []byte("extends")))
p.printNode(n.Extends)
p.printToken(n.ImplementsTkn, p.ifNodeList(n.Implements, []byte("implements")))
@ -214,7 +214,7 @@ func (p *printer) StmtClassMethod(n *ast.StmtClassMethod) {
p.printList(n.Modifiers)
p.printToken(n.FunctionTkn, []byte("function"))
p.printToken(n.AmpersandTkn, nil)
p.printNode(n.MethodName)
p.printNode(n.Name)
p.printToken(n.OpenParenthesisTkn, []byte("("))
p.printSeparatedList(n.Params, n.SeparatorTkns, []byte(","))
p.printToken(n.CloseParenthesisTkn, []byte(")"))
@ -366,7 +366,7 @@ func (p *printer) StmtForeach(n *ast.StmtForeach) {
func (p *printer) StmtFunction(n *ast.StmtFunction) {
p.printToken(n.FunctionTkn, []byte("function"))
p.printToken(n.AmpersandTkn, nil)
p.printNode(n.FunctionName)
p.printNode(n.Name)
p.printToken(n.OpenParenthesisTkn, []byte("("))
p.printSeparatedList(n.Params, n.SeparatorTkns, []byte(","))
p.printToken(n.CloseParenthesisTkn, []byte(")"))
@ -427,7 +427,7 @@ func (p *printer) StmtInlineHtml(n *ast.StmtInlineHtml) {
func (p *printer) StmtInterface(n *ast.StmtInterface) {
p.printToken(n.InterfaceTkn, []byte("interface"))
p.printNode(n.InterfaceName)
p.printNode(n.Name)
p.printToken(n.ExtendsTkn, p.ifNodeList(n.Extends, []byte("extends")))
p.printSeparatedList(n.Extends, n.ExtendsSeparatorTkns, []byte(","))
p.printToken(n.OpenCurlyBracketTkn, []byte("{"))
@ -436,7 +436,7 @@ func (p *printer) StmtInterface(n *ast.StmtInterface) {
}
func (p *printer) StmtLabel(n *ast.StmtLabel) {
p.printNode(n.LabelName)
p.printNode(n.Name)
p.printToken(n.ColonTkn, []byte(":"))
}
@ -462,7 +462,7 @@ func (p *printer) StmtProperty(n *ast.StmtProperty) {
func (p *printer) StmtPropertyList(n *ast.StmtPropertyList) {
p.printList(n.Modifiers)
p.printNode(n.Type)
p.printSeparatedList(n.Properties, n.SeparatorTkns, []byte(","))
p.printSeparatedList(n.Props, n.SeparatorTkns, []byte(","))
p.printToken(n.SemiColonTkn, []byte(";"))
}
@ -498,7 +498,7 @@ func (p *printer) StmtSwitch(n *ast.StmtSwitch) {
p.printToken(n.ColonTkn, nil)
p.printToken(n.OpenCurlyBracketTkn, p.ifNotToken(n.ColonTkn, []byte("{")))
p.printToken(n.CaseSeparatorTkn, nil)
p.printList(n.CaseList)
p.printList(n.Cases)
p.printToken(n.CloseCurlyBracketTkn, p.ifNotToken(n.ColonTkn, []byte("}")))
p.printToken(n.EndSwitchTkn, p.ifToken(n.ColonTkn, []byte("endswitch"), nil))
p.printToken(n.SemiColonTkn, p.ifToken(n.ColonTkn, []byte(";"), nil))
@ -512,7 +512,7 @@ func (p *printer) StmtThrow(n *ast.StmtThrow) {
func (p *printer) StmtTrait(n *ast.StmtTrait) {
p.printToken(n.TraitTkn, []byte("trait"))
p.printNode(n.TraitName)
p.printNode(n.Name)
p.printToken(n.OpenCurlyBracketTkn, []byte("{"))
p.printList(n.Stmts)
p.printToken(n.CloseCurlyBracketTkn, []byte("}"))
@ -563,26 +563,26 @@ func (p *printer) StmtUnset(n *ast.StmtUnset) {
p.printToken(n.SemiColonTkn, []byte(";"))
}
func (p *printer) StmtUse(n *ast.StmtUse) {
func (p *printer) StmtUse(n *ast.StmtUseList) {
p.printToken(n.UseTkn, []byte("use"))
p.printNode(n.Type)
p.printSeparatedList(n.UseDeclarations, n.SeparatorTkns, []byte(","))
p.printSeparatedList(n.Uses, n.SeparatorTkns, []byte(","))
p.printToken(n.SemiColonTkn, []byte(";"))
}
func (p *printer) StmtGroupUse(n *ast.StmtGroupUse) {
func (p *printer) StmtGroupUse(n *ast.StmtGroupUseList) {
p.printToken(n.UseTkn, []byte("use"))
p.printNode(n.Type)
p.printToken(n.LeadingNsSeparatorTkn, nil)
p.printNode(n.Prefix)
p.printToken(n.NsSeparatorTkn, []byte("\\"))
p.printToken(n.OpenCurlyBracketTkn, []byte("{"))
p.printSeparatedList(n.UseDeclarations, n.SeparatorTkns, []byte(","))
p.printSeparatedList(n.Uses, n.SeparatorTkns, []byte(","))
p.printToken(n.CloseCurlyBracketTkn, []byte("}"))
p.printToken(n.SemiColonTkn, []byte(";"))
}
func (p *printer) StmtUseDeclaration(n *ast.StmtUseDeclaration) {
func (p *printer) StmtUseDeclaration(n *ast.StmtUse) {
p.printNode(n.Type)
p.printToken(n.NsSeparatorTkn, nil)
p.printNode(n.Use)
@ -661,7 +661,7 @@ func (p *printer) ExprBrackets(n *ast.ExprBrackets) {
func (p *printer) ExprClassConstFetch(n *ast.ExprClassConstFetch) {
p.printNode(n.Class)
p.printToken(n.DoubleColonTkn, []byte("::"))
p.printNode(n.ConstantName)
p.printNode(n.Const)
}
func (p *printer) ExprClone(n *ast.ExprClone) {
@ -676,10 +676,10 @@ func (p *printer) ExprClosure(n *ast.ExprClosure) {
p.printToken(n.OpenParenthesisTkn, []byte("("))
p.printSeparatedList(n.Params, n.SeparatorTkns, []byte(","))
p.printToken(n.CloseParenthesisTkn, []byte(")"))
p.printToken(n.UseTkn, p.ifNodeList(n.Use, []byte("use")))
p.printToken(n.UseOpenParenthesisTkn, p.ifNodeList(n.Use, []byte("(")))
p.printSeparatedList(n.Use, n.UseSeparatorTkns, []byte(","))
p.printToken(n.UseCloseParenthesisTkn, p.ifNodeList(n.Use, []byte(")")))
p.printToken(n.UseTkn, p.ifNodeList(n.Uses, []byte("use")))
p.printToken(n.UseOpenParenthesisTkn, p.ifNodeList(n.Uses, []byte("(")))
p.printSeparatedList(n.Uses, n.UseSeparatorTkns, []byte(","))
p.printToken(n.UseCloseParenthesisTkn, p.ifNodeList(n.Uses, []byte(")")))
p.printToken(n.ColonTkn, p.ifNode(n.ReturnType, []byte(":")))
p.printNode(n.ReturnType)
p.printToken(n.OpenCurlyBracketTkn, []byte("{"))
@ -725,7 +725,7 @@ func (p *printer) ExprExit(n *ast.ExprExit) {
func (p *printer) ExprFunctionCall(n *ast.ExprFunctionCall) {
p.printNode(n.Function)
p.printToken(n.OpenParenthesisTkn, []byte("("))
p.printSeparatedList(n.Arguments, n.SeparatorTkns, []byte(","))
p.printSeparatedList(n.Args, n.SeparatorTkns, []byte(","))
p.printToken(n.CloseParenthesisTkn, []byte(")"))
}
@ -766,16 +766,16 @@ func (p *printer) ExprMethodCall(n *ast.ExprMethodCall) {
p.printNode(n.Method)
p.printToken(n.CloseCurlyBracketTkn, nil)
p.printToken(n.OpenParenthesisTkn, []byte("("))
p.printSeparatedList(n.Arguments, n.SeparatorTkns, []byte(","))
p.printSeparatedList(n.Args, n.SeparatorTkns, []byte(","))
p.printToken(n.CloseParenthesisTkn, []byte(")"))
}
func (p *printer) ExprNew(n *ast.ExprNew) {
p.printToken(n.NewTkn, []byte("new"))
p.printNode(n.Class)
p.printToken(n.OpenParenthesisTkn, p.ifNodeList(n.Arguments, []byte("(")))
p.printSeparatedList(n.Arguments, n.SeparatorTkns, []byte(","))
p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Arguments, []byte(")")))
p.printToken(n.OpenParenthesisTkn, p.ifNodeList(n.Args, []byte("(")))
p.printSeparatedList(n.Args, n.SeparatorTkns, []byte(","))
p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Args, []byte(")")))
}
func (p *printer) ExprPostDec(n *ast.ExprPostDec) {
@ -807,7 +807,7 @@ func (p *printer) ExprPropertyFetch(n *ast.ExprPropertyFetch) {
p.printNode(n.Var)
p.printToken(n.ObjectOperatorTkn, []byte("->"))
p.printToken(n.OpenCurlyBracketTkn, nil)
p.printNode(n.Property)
p.printNode(n.Prop)
p.printToken(n.CloseCurlyBracketTkn, nil)
}
@ -833,19 +833,19 @@ func (p *printer) ExprStaticCall(n *ast.ExprStaticCall) {
p.printToken(n.OpenCurlyBracketTkn, nil)
p.printNode(n.Call)
p.printToken(n.CloseCurlyBracketTkn, nil)
p.printToken(n.OpenParenthesisTkn, p.ifNodeList(n.Arguments, []byte("(")))
p.printSeparatedList(n.Arguments, n.SeparatorTkns, []byte(","))
p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Arguments, []byte(")")))
p.printToken(n.OpenParenthesisTkn, p.ifNodeList(n.Args, []byte("(")))
p.printSeparatedList(n.Args, n.SeparatorTkns, []byte(","))
p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Args, []byte(")")))
}
func (p *printer) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) {
p.printNode(n.Class)
p.printToken(n.DoubleColonTkn, []byte("::"))
p.printNode(n.Property)
p.printNode(n.Prop)
}
func (p *printer) ExprTernary(n *ast.ExprTernary) {
p.printNode(n.Condition)
p.printNode(n.Cond)
p.printToken(n.QuestionTkn, []byte("?"))
p.printNode(n.IfTrue)
p.printToken(n.ColonTkn, []byte(":"))
@ -865,7 +865,7 @@ func (p *printer) ExprUnaryPlus(n *ast.ExprUnaryPlus) {
func (p *printer) ExprVariable(n *ast.ExprVariable) {
p.printToken(n.DollarTkn, nil)
p.printToken(n.OpenCurlyBracketTkn, nil)
p.printNode(n.VarName)
p.printNode(n.Name)
p.printToken(n.CloseCurlyBracketTkn, nil)
}
@ -873,7 +873,7 @@ func (p *printer) ExprYield(n *ast.ExprYield) {
p.printToken(n.YieldTkn, []byte("yield"))
p.printNode(n.Key)
p.printToken(n.DoubleArrowTkn, p.ifNode(n.Key, []byte("=>")))
p.printNode(n.Value)
p.printNode(n.Val)
}
func (p *printer) ExprYieldFrom(n *ast.ExprYieldFrom) {
@ -1185,7 +1185,7 @@ func (p *printer) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) {
func (p *printer) ScalarEncapsedStringVar(n *ast.ScalarEncapsedStringVar) {
p.printToken(n.DollarOpenCurlyBracketTkn, []byte("${"))
p.printNode(n.VarName)
p.printNode(n.Name)
p.printToken(n.OpenSquareBracketTkn, p.ifNode(n.Dim, []byte("[")))
p.printNode(n.Dim)
p.printToken(n.CloseSquareBracketTkn, p.ifNode(n.Dim, []byte("]")))
@ -1217,7 +1217,7 @@ func (p *printer) ScalarString(n *ast.ScalarString) {
p.printToken(n.StringTkn, n.Value)
}
func (p *printer) NameName(n *ast.NameName) {
func (p *printer) NameName(n *ast.Name) {
p.printSeparatedList(n.Parts, n.SeparatorTkns, []byte("\\"))
}
@ -1232,6 +1232,6 @@ func (p *printer) NameRelative(n *ast.NameRelative) {
p.printSeparatedList(n.Parts, n.SeparatorTkns, []byte("\\"))
}
func (p *printer) NameNamePart(n *ast.NameNamePart) {
func (p *printer) NameNamePart(n *ast.NamePart) {
p.printToken(n.StringTkn, n.Value)
}

View File

@ -36,8 +36,8 @@ abstract class Bar extends Baz
// change namespace
parts := &rootNode.(*ast.Root).Stmts[0].(*ast.StmtNamespace).Name.(*ast.NameName).Parts
*parts = append(*parts, &ast.NameNamePart{Value: []byte("Quuz")})
parts := &rootNode.(*ast.Root).Stmts[0].(*ast.StmtNamespace).Name.(*ast.Name).Parts
*parts = append(*parts, &ast.NamePart{Value: []byte("Quuz")})
// print

File diff suppressed because it is too large Load Diff

View File

@ -85,8 +85,8 @@ func (t *Traverser) StmtClass(n *ast.StmtClass) {
for _, nn := range n.Modifiers {
nn.Accept(t)
}
t.Traverse(n.ClassName)
for _, nn := range n.Arguments {
t.Traverse(n.Name)
for _, nn := range n.Args {
nn.Accept(t)
}
t.Traverse(n.Extends)
@ -115,7 +115,7 @@ func (t *Traverser) StmtClassMethod(n *ast.StmtClassMethod) {
for _, nn := range n.Modifiers {
nn.Accept(t)
}
t.Traverse(n.MethodName)
t.Traverse(n.Name)
for _, nn := range n.Params {
nn.Accept(t)
}
@ -230,7 +230,7 @@ func (t *Traverser) StmtForeach(n *ast.StmtForeach) {
func (t *Traverser) StmtFunction(n *ast.StmtFunction) {
n.Accept(t.v)
t.Traverse(n.FunctionName)
t.Traverse(n.Name)
for _, nn := range n.Params {
nn.Accept(t)
}
@ -276,7 +276,7 @@ func (t *Traverser) StmtInlineHtml(n *ast.StmtInlineHtml) {
func (t *Traverser) StmtInterface(n *ast.StmtInterface) {
n.Accept(t.v)
t.Traverse(n.InterfaceName)
t.Traverse(n.Name)
for _, nn := range n.Extends {
nn.Accept(t)
}
@ -288,7 +288,7 @@ func (t *Traverser) StmtInterface(n *ast.StmtInterface) {
func (t *Traverser) StmtLabel(n *ast.StmtLabel) {
n.Accept(t.v)
t.Traverse(n.LabelName)
t.Traverse(n.Name)
}
func (t *Traverser) StmtNamespace(n *ast.StmtNamespace) {
@ -318,7 +318,7 @@ func (t *Traverser) StmtPropertyList(n *ast.StmtPropertyList) {
nn.Accept(t)
}
t.Traverse(n.Type)
for _, nn := range n.Properties {
for _, nn := range n.Props {
nn.Accept(t)
}
}
@ -356,7 +356,7 @@ func (t *Traverser) StmtSwitch(n *ast.StmtSwitch) {
n.Accept(t.v)
t.Traverse(n.Cond)
for _, nn := range n.CaseList {
for _, nn := range n.Cases {
nn.Accept(t)
}
}
@ -370,7 +370,7 @@ func (t *Traverser) StmtThrow(n *ast.StmtThrow) {
func (t *Traverser) StmtTrait(n *ast.StmtTrait) {
n.Accept(t.v)
t.Traverse(n.TraitName)
t.Traverse(n.Name)
for _, nn := range n.Stmts {
nn.Accept(t)
}
@ -426,26 +426,26 @@ func (t *Traverser) StmtUnset(n *ast.StmtUnset) {
}
}
func (t *Traverser) StmtUse(n *ast.StmtUse) {
func (t *Traverser) StmtUse(n *ast.StmtUseList) {
n.Accept(t.v)
t.Traverse(n.Type)
for _, nn := range n.UseDeclarations {
for _, nn := range n.Uses {
nn.Accept(t)
}
}
func (t *Traverser) StmtGroupUse(n *ast.StmtGroupUse) {
func (t *Traverser) StmtGroupUse(n *ast.StmtGroupUseList) {
n.Accept(t.v)
t.Traverse(n.Type)
t.Traverse(n.Prefix)
for _, nn := range n.UseDeclarations {
for _, nn := range n.Uses {
nn.Accept(t)
}
}
func (t *Traverser) StmtUseDeclaration(n *ast.StmtUseDeclaration) {
func (t *Traverser) StmtUseDeclaration(n *ast.StmtUse) {
n.Accept(t.v)
t.Traverse(n.Type)
@ -514,7 +514,7 @@ func (t *Traverser) ExprClassConstFetch(n *ast.ExprClassConstFetch) {
n.Accept(t.v)
t.Traverse(n.Class)
t.Traverse(n.ConstantName)
t.Traverse(n.Const)
}
func (t *Traverser) ExprClone(n *ast.ExprClone) {
@ -529,7 +529,7 @@ func (t *Traverser) ExprClosure(n *ast.ExprClosure) {
for _, nn := range n.Params {
nn.Accept(t)
}
for _, nn := range n.Use {
for _, nn := range n.Uses {
nn.Accept(t)
}
t.Traverse(n.ReturnType)
@ -578,7 +578,7 @@ func (t *Traverser) ExprFunctionCall(n *ast.ExprFunctionCall) {
n.Accept(t.v)
t.Traverse(n.Function)
for _, nn := range n.Arguments {
for _, nn := range n.Args {
nn.Accept(t)
}
}
@ -623,7 +623,7 @@ func (t *Traverser) ExprMethodCall(n *ast.ExprMethodCall) {
t.Traverse(n.Var)
t.Traverse(n.Method)
for _, nn := range n.Arguments {
for _, nn := range n.Args {
nn.Accept(t)
}
}
@ -632,7 +632,7 @@ func (t *Traverser) ExprNew(n *ast.ExprNew) {
n.Accept(t.v)
t.Traverse(n.Class)
for _, nn := range n.Arguments {
for _, nn := range n.Args {
nn.Accept(t)
}
}
@ -671,7 +671,7 @@ func (t *Traverser) ExprPropertyFetch(n *ast.ExprPropertyFetch) {
n.Accept(t.v)
t.Traverse(n.Var)
t.Traverse(n.Property)
t.Traverse(n.Prop)
}
func (t *Traverser) ExprRequire(n *ast.ExprRequire) {
@ -699,7 +699,7 @@ func (t *Traverser) ExprStaticCall(n *ast.ExprStaticCall) {
t.Traverse(n.Class)
t.Traverse(n.Call)
for _, nn := range n.Arguments {
for _, nn := range n.Args {
nn.Accept(t)
}
}
@ -708,13 +708,13 @@ func (t *Traverser) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) {
n.Accept(t.v)
t.Traverse(n.Class)
t.Traverse(n.Property)
t.Traverse(n.Prop)
}
func (t *Traverser) ExprTernary(n *ast.ExprTernary) {
n.Accept(t.v)
t.Traverse(n.Condition)
t.Traverse(n.Cond)
t.Traverse(n.IfTrue)
t.Traverse(n.IfFalse)
}
@ -734,14 +734,14 @@ func (t *Traverser) ExprUnaryPlus(n *ast.ExprUnaryPlus) {
func (t *Traverser) ExprVariable(n *ast.ExprVariable) {
n.Accept(t.v)
t.Traverse(n.VarName)
t.Traverse(n.Name)
}
func (t *Traverser) ExprYield(n *ast.ExprYield) {
n.Accept(t.v)
t.Traverse(n.Key)
t.Traverse(n.Value)
t.Traverse(n.Val)
}
func (t *Traverser) ExprYieldFrom(n *ast.ExprYieldFrom) {
@ -1105,7 +1105,7 @@ func (t *Traverser) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) {
func (t *Traverser) ScalarEncapsedStringVar(n *ast.ScalarEncapsedStringVar) {
n.Accept(t.v)
t.Traverse(n.VarName)
t.Traverse(n.Name)
t.Traverse(n.Dim)
}
@ -1135,7 +1135,7 @@ func (t *Traverser) ScalarString(n *ast.ScalarString) {
n.Accept(t.v)
}
func (t *Traverser) NameName(n *ast.NameName) {
func (t *Traverser) NameName(n *ast.Name) {
n.Accept(t.v)
for _, nn := range n.Parts {
@ -1159,6 +1159,6 @@ func (t *Traverser) NameRelative(n *ast.NameRelative) {
}
}
func (t *Traverser) NameNamePart(n *ast.NameNamePart) {
func (t *Traverser) NameNamePart(n *ast.NamePart) {
n.Accept(t.v)
}