refactoring: update ast structure of "StaticCall" node

This commit is contained in:
Vadym Slizov
2020-12-27 23:19:49 +02:00
parent 0f2341bfa9
commit ad884c99df
9 changed files with 432 additions and 321 deletions

410
internal/php5/php5.go generated

File diff suppressed because it is too large Load Diff

View File

@@ -3688,7 +3688,7 @@ function_call:
}
| class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list
{
$$ = &ast.ExprStaticCall{
staticCall := &ast.ExprStaticCall{
Position: yylex.(*Parser).builder.NewNodesPosition($1, $4),
Class: $1,
DoubleColonTkn: $2,
@@ -3698,6 +3698,14 @@ function_call:
SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn,
}
if brackets, ok := $3.(*ast.ParserBrackets); ok {
staticCall.OpenCurlyBracketTkn = brackets.OpenBracketTkn
staticCall.Call = brackets.Child
staticCall.CloseCurlyBracketTkn = brackets.CloseBracketTkn
}
$$ = staticCall
}
| class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list
{
@@ -3714,7 +3722,7 @@ function_call:
}
| variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list
{
$$ = &ast.ExprStaticCall{
staticCall := &ast.ExprStaticCall{
Position: yylex.(*Parser).builder.NewNodesPosition($1, $4),
Class: $1,
DoubleColonTkn: $2,
@@ -3724,6 +3732,14 @@ function_call:
SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns,
CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn,
}
if brackets, ok := $3.(*ast.ParserBrackets); ok {
staticCall.OpenCurlyBracketTkn = brackets.OpenBracketTkn
staticCall.Call = brackets.Child
staticCall.CloseCurlyBracketTkn = brackets.CloseBracketTkn
}
$$ = staticCall
}
| variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list
{