[refactoring] update ast structure of "Parameter", "Class", "FunctionCall", "MethodCall", "New" and "StaticCall" nodes
This commit is contained in:
1155
internal/php5/php5.go
generated
1155
internal/php5/php5.go
generated
File diff suppressed because it is too large
Load Diff
@@ -2028,40 +2028,6 @@ non_empty_parameter_list:
|
||||
parameter:
|
||||
optional_class_type is_reference is_variadic T_VARIABLE
|
||||
{
|
||||
var variable ast.Vertex
|
||||
variable = &ast.ExprVariable{
|
||||
Node: ast.Node{
|
||||
Position: position.NewTokenPosition($4),
|
||||
},
|
||||
VarName: &ast.Identifier{
|
||||
Node: ast.Node{
|
||||
Position: position.NewTokenPosition($4),
|
||||
},
|
||||
IdentifierTkn: $4,
|
||||
Value: $4.Value,
|
||||
},
|
||||
}
|
||||
|
||||
if $3 != nil {
|
||||
variable = &ast.Variadic{
|
||||
Node: ast.Node{
|
||||
Position: position.NewTokensPosition($3, $4),
|
||||
},
|
||||
VariadicTkn: $3,
|
||||
Var: variable,
|
||||
}
|
||||
}
|
||||
|
||||
if $2 != nil {
|
||||
variable = &ast.Reference{
|
||||
Node: ast.Node{
|
||||
Position: position.NewTokensPosition($2, $4),
|
||||
},
|
||||
AmpersandTkn: $2,
|
||||
Var: variable,
|
||||
}
|
||||
}
|
||||
|
||||
pos := position.NewTokenPosition($4)
|
||||
if $1 != nil {
|
||||
pos = position.NewNodeTokenPosition($1, $4)
|
||||
@@ -2075,46 +2041,25 @@ parameter:
|
||||
Node: ast.Node{
|
||||
Position: pos,
|
||||
},
|
||||
Type: $1,
|
||||
Var: variable,
|
||||
Type: $1,
|
||||
AmpersandTkn: $2,
|
||||
VariadicTkn: $3,
|
||||
Var: &ast.ExprVariable{
|
||||
Node: ast.Node{
|
||||
Position: position.NewTokenPosition($4),
|
||||
},
|
||||
VarName: &ast.Identifier{
|
||||
Node: ast.Node{
|
||||
Position: position.NewTokenPosition($4),
|
||||
},
|
||||
IdentifierTkn: $4,
|
||||
Value: $4.Value,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
| optional_class_type is_reference is_variadic T_VARIABLE '=' expr
|
||||
{
|
||||
var variable ast.Vertex
|
||||
variable = &ast.ExprVariable{
|
||||
Node: ast.Node{
|
||||
Position: position.NewTokenPosition($4),
|
||||
},
|
||||
VarName: &ast.Identifier{
|
||||
Node: ast.Node{
|
||||
Position: position.NewTokenPosition($4),
|
||||
},
|
||||
IdentifierTkn: $4,
|
||||
Value: $4.Value,
|
||||
},
|
||||
}
|
||||
|
||||
if $3 != nil {
|
||||
variable = &ast.Variadic{
|
||||
Node: ast.Node{
|
||||
Position: position.NewTokensPosition($3, $4),
|
||||
},
|
||||
VariadicTkn: $3,
|
||||
Var: variable,
|
||||
}
|
||||
}
|
||||
|
||||
if $2 != nil {
|
||||
variable = &ast.Reference{
|
||||
Node: ast.Node{
|
||||
Position: position.NewTokensPosition($2, $4),
|
||||
},
|
||||
AmpersandTkn: $2,
|
||||
Var: variable,
|
||||
}
|
||||
}
|
||||
|
||||
pos := position.NewTokenNodePosition($4, $6)
|
||||
if $1 != nil {
|
||||
pos = position.NewNodesPosition($1, $6)
|
||||
@@ -2129,7 +2074,20 @@ parameter:
|
||||
Position: pos,
|
||||
},
|
||||
Type: $1,
|
||||
Var: variable,
|
||||
AmpersandTkn: $2,
|
||||
VariadicTkn: $3,
|
||||
Var: &ast.ExprVariable{
|
||||
Node: ast.Node{
|
||||
Position: position.NewTokenPosition($4),
|
||||
},
|
||||
VarName: &ast.Identifier{
|
||||
Node: ast.Node{
|
||||
Position: position.NewTokenPosition($4),
|
||||
},
|
||||
IdentifierTkn: $4,
|
||||
Value: $4.Value,
|
||||
},
|
||||
},
|
||||
EqualTkn: $5,
|
||||
DefaultValue: $6,
|
||||
}
|
||||
@@ -3116,6 +3074,7 @@ new_expr:
|
||||
Class: $2,
|
||||
OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
Arguments: $3.(*ast.ArgumentList).Arguments,
|
||||
SeparatorTkns: $3.(*ast.ArgumentList).SeparatorTkns,
|
||||
CloseParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
}
|
||||
} else {
|
||||
@@ -3185,6 +3144,7 @@ expr_without_variable:
|
||||
Class: $5,
|
||||
OpenParenthesisTkn: $6.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
Arguments: $6.(*ast.ArgumentList).Arguments,
|
||||
SeparatorTkns: $6.(*ast.ArgumentList).SeparatorTkns,
|
||||
CloseParenthesisTkn: $6.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
}
|
||||
} else {
|
||||
@@ -4228,6 +4188,7 @@ function_call:
|
||||
},
|
||||
OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
Arguments: $2.(*ast.ArgumentList).Arguments,
|
||||
SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns,
|
||||
CloseParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
}
|
||||
}
|
||||
@@ -4247,6 +4208,7 @@ function_call:
|
||||
},
|
||||
OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
Arguments: $4.(*ast.ArgumentList).Arguments,
|
||||
SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns,
|
||||
CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
}
|
||||
}
|
||||
@@ -4265,6 +4227,7 @@ function_call:
|
||||
},
|
||||
OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
Arguments: $3.(*ast.ArgumentList).Arguments,
|
||||
SeparatorTkns: $3.(*ast.ArgumentList).SeparatorTkns,
|
||||
CloseParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
}
|
||||
}
|
||||
@@ -4279,6 +4242,7 @@ function_call:
|
||||
Call: $3,
|
||||
OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
Arguments: $4.(*ast.ArgumentList).Arguments,
|
||||
SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns,
|
||||
CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
}
|
||||
}
|
||||
@@ -4293,6 +4257,7 @@ function_call:
|
||||
Call: $3,
|
||||
OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
Arguments: $4.(*ast.ArgumentList).Arguments,
|
||||
SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns,
|
||||
CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
}
|
||||
}
|
||||
@@ -4307,6 +4272,7 @@ function_call:
|
||||
Call: $3,
|
||||
OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
Arguments: $4.(*ast.ArgumentList).Arguments,
|
||||
SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns,
|
||||
CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
}
|
||||
}
|
||||
@@ -4321,6 +4287,7 @@ function_call:
|
||||
Call: $3,
|
||||
OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
Arguments: $4.(*ast.ArgumentList).Arguments,
|
||||
SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns,
|
||||
CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
}
|
||||
}
|
||||
@@ -4333,6 +4300,7 @@ function_call:
|
||||
Function: $1,
|
||||
OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
Arguments: $2.(*ast.ArgumentList).Arguments,
|
||||
SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns,
|
||||
CloseParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
}
|
||||
}
|
||||
@@ -5462,6 +5430,7 @@ variable:
|
||||
},
|
||||
OpenParenthesisTkn: mc.OpenParenthesisTkn,
|
||||
Arguments: mc.Arguments,
|
||||
SeparatorTkns: mc.SeparatorTkns,
|
||||
CloseParenthesisTkn: mc.OpenParenthesisTkn,
|
||||
},
|
||||
)
|
||||
@@ -5555,6 +5524,7 @@ variable_property:
|
||||
},
|
||||
OpenParenthesisTkn: mc.OpenParenthesisTkn,
|
||||
Arguments: mc.Arguments,
|
||||
SeparatorTkns: mc.SeparatorTkns,
|
||||
CloseParenthesisTkn: mc.OpenParenthesisTkn,
|
||||
},
|
||||
)
|
||||
@@ -5610,6 +5580,7 @@ method:
|
||||
},
|
||||
OpenParenthesisTkn: $1.(*ast.ArgumentList).OpenParenthesisTkn,
|
||||
Arguments: $1.(*ast.ArgumentList).Arguments,
|
||||
SeparatorTkns: $1.(*ast.ArgumentList).SeparatorTkns,
|
||||
CloseParenthesisTkn: $1.(*ast.ArgumentList).CloseParenthesisTkn,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user