create ArgumentList node
This commit is contained in:
1348
php5/php5.go
1348
php5/php5.go
File diff suppressed because it is too large
Load Diff
75
php5/php5.y
75
php5/php5.y
@@ -242,6 +242,7 @@ import (
|
||||
%type <node> trait_use_statement function_call_parameter trait_adaptation_statement trait_precedence trait_alias
|
||||
%type <node> trait_method_reference_fully_qualified trait_method_reference trait_modifiers member_modifier method
|
||||
%type <node> static_scalar_value static_operation
|
||||
%type <node> ctor_arguments function_call_parameter_list
|
||||
|
||||
%type <list> top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations
|
||||
%type <list> inner_statement_list global_var_list static_var_list encaps_list isset_variables non_empty_array_pair_list
|
||||
@@ -258,7 +259,7 @@ import (
|
||||
|
||||
%type <simpleIndirectReference> simple_indirect_reference
|
||||
%type <foreachVariable> foreach_variable foreach_optional_arg
|
||||
%type <nodesWithEndToken> ctor_arguments function_call_parameter_list switch_case_list method_body trait_adaptations
|
||||
%type <nodesWithEndToken> switch_case_list method_body trait_adaptations
|
||||
%type <boolWithToken> is_reference is_variadic
|
||||
%type <altSyntaxNode> while_statement for_statement foreach_statement
|
||||
|
||||
@@ -1349,16 +1350,27 @@ optional_class_type:
|
||||
|
||||
function_call_parameter_list:
|
||||
'(' ')'
|
||||
{ $$ = &nodesWithEndToken{[]node.Node{}, $2} }
|
||||
{
|
||||
$$ = node.NewArgumentList(nil)
|
||||
|
||||
// save position
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2))
|
||||
}
|
||||
| '(' non_empty_function_call_parameter_list ')'
|
||||
{ $$ = &nodesWithEndToken{$2, $3} }
|
||||
{
|
||||
$$ = node.NewArgumentList($2)
|
||||
|
||||
// save position
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
||||
}
|
||||
| '(' yield_expr ')'
|
||||
{
|
||||
arg := node.NewArgument($2, false, false)
|
||||
yylex.(*Parser).positions.AddPosition(arg, yylex.(*Parser).positionBuilder.NewNodePosition($2))
|
||||
yylex.(*Parser).comments.AddComments(arg, yylex.(*Parser).comments[$2])
|
||||
$$ = node.NewArgumentList([]node.Node{arg})
|
||||
|
||||
$$ = &nodesWithEndToken{[]node.Node{arg}, $3}
|
||||
// save position
|
||||
yylex.(*Parser).positions.AddPosition(arg, yylex.(*Parser).positionBuilder.NewNodePosition($2))
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
||||
}
|
||||
;
|
||||
|
||||
@@ -1886,9 +1898,10 @@ instance_call:
|
||||
new_expr:
|
||||
T_NEW class_name_reference ctor_arguments
|
||||
{
|
||||
|
||||
if $3 != nil {
|
||||
$$ = expr.NewNew($2, $3.nodes)
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3.endToken))
|
||||
$$ = expr.NewNew($2, $3.(*node.ArgumentList))
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3))
|
||||
} else {
|
||||
$$ = expr.NewNew($2, nil)
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
||||
@@ -1923,12 +1936,14 @@ expr_without_variable:
|
||||
}
|
||||
| variable '=' '&' T_NEW class_name_reference ctor_arguments
|
||||
{
|
||||
_new := expr.NewNew($5, nil)
|
||||
yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $5))
|
||||
var _new *expr.New
|
||||
|
||||
if $6 != nil {
|
||||
_new = expr.NewNew($5, $6.nodes)
|
||||
yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokensPosition($4, $6.endToken))
|
||||
_new = expr.NewNew($5, $6.(*node.ArgumentList))
|
||||
yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6))
|
||||
} else {
|
||||
_new = expr.NewNew($5, nil)
|
||||
yylex.(*Parser).positions.AddPosition(_new, yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $5))
|
||||
}
|
||||
yylex.(*Parser).comments.AddComments(_new, yylex.(*Parser).comments[$1])
|
||||
|
||||
@@ -2519,8 +2534,8 @@ function_call:
|
||||
yylex.(*Parser).positions.AddPosition(name, yylex.(*Parser).positionBuilder.NewNodeListPosition($1))
|
||||
yylex.(*Parser).comments.AddComments(name, yylex.(*Parser).listGetFirstNodeComments($1))
|
||||
|
||||
$$ = expr.NewFunctionCall(name, $2.nodes)
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(name, $2.endToken))
|
||||
$$ = expr.NewFunctionCall(name, $2.(*node.ArgumentList))
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition(name, $2))
|
||||
yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[name])
|
||||
}
|
||||
| T_NAMESPACE T_NS_SEPARATOR namespace_name function_call_parameter_list
|
||||
@@ -2529,8 +2544,8 @@ function_call:
|
||||
yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3))
|
||||
yylex.(*Parser).comments.AddComments(funcName, $1.Comments())
|
||||
|
||||
$$ = expr.NewFunctionCall(funcName, $4.nodes)
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(funcName, $4.endToken))
|
||||
$$ = expr.NewFunctionCall(funcName, $4.(*node.ArgumentList))
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $4))
|
||||
yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[funcName])
|
||||
}
|
||||
| T_NS_SEPARATOR namespace_name function_call_parameter_list
|
||||
@@ -2539,38 +2554,38 @@ function_call:
|
||||
yylex.(*Parser).positions.AddPosition(funcName, yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2))
|
||||
yylex.(*Parser).comments.AddComments(funcName, $1.Comments())
|
||||
|
||||
$$ = expr.NewFunctionCall(funcName, $3.nodes)
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition(funcName, $3.endToken))
|
||||
$$ = expr.NewFunctionCall(funcName, $3.(*node.ArgumentList))
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $3))
|
||||
yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[funcName])
|
||||
}
|
||||
| class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list
|
||||
{
|
||||
$$ = expr.NewStaticCall($1, $3, $4.nodes)
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken))
|
||||
$$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList))
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4))
|
||||
yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1])
|
||||
}
|
||||
| class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list
|
||||
{
|
||||
$$ = expr.NewStaticCall($1, $3, $4.nodes)
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken))
|
||||
$$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList))
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4))
|
||||
yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1])
|
||||
}
|
||||
| variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list
|
||||
{
|
||||
$$ = expr.NewStaticCall($1, $3, $4.nodes)
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken))
|
||||
$$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList))
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4))
|
||||
yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1])
|
||||
}
|
||||
| variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list
|
||||
{
|
||||
$$ = expr.NewStaticCall($1, $3, $4.nodes)
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4.endToken))
|
||||
$$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList))
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4))
|
||||
yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1])
|
||||
}
|
||||
| variable_without_objects function_call_parameter_list
|
||||
{
|
||||
$$ = expr.NewFunctionCall($1, $2.nodes)
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2.endToken))
|
||||
$$ = expr.NewFunctionCall($1, $2.(*node.ArgumentList))
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2))
|
||||
yylex.(*Parser).comments.AddComments($$, yylex.(*Parser).comments[$1])
|
||||
}
|
||||
;
|
||||
@@ -3311,8 +3326,8 @@ array_method_dereference:
|
||||
method:
|
||||
function_call_parameter_list
|
||||
{
|
||||
$$ = expr.NewMethodCall(nil, nil, $1.nodes)
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1.nodes, $1.endToken))
|
||||
$$ = expr.NewMethodCall(nil, nil, $1.(*node.ArgumentList))
|
||||
yylex.(*Parser).positions.AddPosition($$, yylex.(*Parser).positionBuilder.NewNodePosition($1))
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
@@ -434,18 +434,22 @@ func TestPhp5(t *testing.T) {
|
||||
&stmt.Expression{
|
||||
Expr: &expr.FunctionCall{
|
||||
Function: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}},
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}},
|
||||
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}},
|
||||
ArgumentList: &node.ArgumentList{
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}},
|
||||
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &expr.FunctionCall{
|
||||
Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}},
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}},
|
||||
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}},
|
||||
ArgumentList: &node.ArgumentList{
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}},
|
||||
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -453,9 +457,11 @@ func TestPhp5(t *testing.T) {
|
||||
Expr: &expr.MethodCall{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}},
|
||||
Method: &node.Identifier{Value: "bar"},
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}},
|
||||
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}},
|
||||
ArgumentList: &node.ArgumentList{
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}},
|
||||
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -463,9 +469,11 @@ func TestPhp5(t *testing.T) {
|
||||
Expr: &expr.StaticCall{
|
||||
Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}},
|
||||
Call: &node.Identifier{Value: "bar"},
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}},
|
||||
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}},
|
||||
ArgumentList: &node.ArgumentList{
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}},
|
||||
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -473,18 +481,22 @@ func TestPhp5(t *testing.T) {
|
||||
Expr: &expr.StaticCall{
|
||||
Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}},
|
||||
Call: &node.Identifier{Value: "bar"},
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}},
|
||||
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}},
|
||||
ArgumentList: &node.ArgumentList{
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}},
|
||||
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &expr.New{
|
||||
Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}},
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}},
|
||||
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}},
|
||||
ArgumentList: &node.ArgumentList{
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}},
|
||||
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -665,9 +677,9 @@ func TestPhp5(t *testing.T) {
|
||||
Parts: []node.Node{
|
||||
&scalar.EncapsedStringPart{Value: "test "},
|
||||
&expr.MethodCall{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}},
|
||||
Method: &node.Identifier{Value: "bar"},
|
||||
Arguments: []node.Node{},
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}},
|
||||
Method: &node.Identifier{Value: "bar"},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1134,7 +1146,7 @@ func TestPhp5(t *testing.T) {
|
||||
&name.NamePart{Value: "foo"},
|
||||
},
|
||||
},
|
||||
Arguments: []node.Node{},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -2081,7 +2093,7 @@ func TestPhp5(t *testing.T) {
|
||||
&name.NamePart{Value: "foo"},
|
||||
},
|
||||
},
|
||||
Arguments: []node.Node{},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
@@ -2091,11 +2103,13 @@ func TestPhp5(t *testing.T) {
|
||||
&name.NamePart{Value: "foo"},
|
||||
},
|
||||
},
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{
|
||||
Variadic: false,
|
||||
IsReference: true,
|
||||
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
ArgumentList: &node.ArgumentList{
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{
|
||||
Variadic: false,
|
||||
IsReference: true,
|
||||
Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -2107,12 +2121,14 @@ func TestPhp5(t *testing.T) {
|
||||
&name.NamePart{Value: "foo"},
|
||||
},
|
||||
},
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{
|
||||
Variadic: false,
|
||||
IsReference: false,
|
||||
Expr: &expr.ShortArray{
|
||||
Items: []node.Node{},
|
||||
ArgumentList: &node.ArgumentList{
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{
|
||||
Variadic: false,
|
||||
IsReference: false,
|
||||
Expr: &expr.ShortArray{
|
||||
Items: []node.Node{},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -2121,12 +2137,14 @@ func TestPhp5(t *testing.T) {
|
||||
&stmt.Expression{
|
||||
Expr: &expr.FunctionCall{
|
||||
Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}},
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{
|
||||
Variadic: false,
|
||||
IsReference: false,
|
||||
Expr: &expr.Yield{
|
||||
Value: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
ArgumentList: &node.ArgumentList{
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{
|
||||
Variadic: false,
|
||||
IsReference: false,
|
||||
Expr: &expr.Yield{
|
||||
Value: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -2281,9 +2299,9 @@ func TestPhp5(t *testing.T) {
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &expr.MethodCall{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Method: &node.Identifier{Value: "foo"},
|
||||
Arguments: []node.Node{},
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Method: &node.Identifier{Value: "foo"},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
@@ -2302,7 +2320,7 @@ func TestPhp5(t *testing.T) {
|
||||
&name.NamePart{Value: "Foo"},
|
||||
},
|
||||
},
|
||||
Arguments: []node.Node{},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
@@ -2312,7 +2330,7 @@ func TestPhp5(t *testing.T) {
|
||||
&name.NamePart{Value: "Foo"},
|
||||
},
|
||||
},
|
||||
Arguments: []node.Node{},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
@@ -2346,8 +2364,8 @@ func TestPhp5(t *testing.T) {
|
||||
},
|
||||
Property: &node.Identifier{Value: "bar"},
|
||||
},
|
||||
Method: &node.Identifier{Value: "baz"},
|
||||
Arguments: []node.Node{},
|
||||
Method: &node.Identifier{Value: "baz"},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
Property: &node.Identifier{Value: "quux"},
|
||||
},
|
||||
@@ -2358,9 +2376,9 @@ func TestPhp5(t *testing.T) {
|
||||
Expr: &expr.ArrayDimFetch{
|
||||
Variable: &expr.ArrayDimFetch{
|
||||
Variable: &expr.MethodCall{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Method: &node.Identifier{Value: "foo"},
|
||||
Arguments: []node.Node{},
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Method: &node.Identifier{Value: "foo"},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
Dim: &scalar.Lnumber{Value: "1"},
|
||||
},
|
||||
@@ -2424,8 +2442,8 @@ func TestPhp5(t *testing.T) {
|
||||
&name.NamePart{Value: "Foo"},
|
||||
},
|
||||
},
|
||||
Call: &node.Identifier{Value: "bar"},
|
||||
Arguments: []node.Node{},
|
||||
Call: &node.Identifier{Value: "bar"},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
@@ -2435,8 +2453,8 @@ func TestPhp5(t *testing.T) {
|
||||
&name.NamePart{Value: "Foo"},
|
||||
},
|
||||
},
|
||||
Call: &node.Identifier{Value: "bar"},
|
||||
Arguments: []node.Node{},
|
||||
Call: &node.Identifier{Value: "bar"},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
@@ -2446,8 +2464,8 @@ func TestPhp5(t *testing.T) {
|
||||
&name.NamePart{Value: "Foo"},
|
||||
},
|
||||
},
|
||||
Call: &node.Identifier{Value: "bar"},
|
||||
Arguments: []node.Node{},
|
||||
Call: &node.Identifier{Value: "bar"},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
@@ -2457,15 +2475,15 @@ func TestPhp5(t *testing.T) {
|
||||
&name.NamePart{Value: "Foo"},
|
||||
},
|
||||
},
|
||||
Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}},
|
||||
Arguments: []node.Node{},
|
||||
Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &expr.StaticCall{
|
||||
Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}},
|
||||
Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}},
|
||||
Arguments: []node.Node{},
|
||||
Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}},
|
||||
Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
@@ -2815,11 +2833,13 @@ func TestPhp5(t *testing.T) {
|
||||
&name.NamePart{Value: "Foo"},
|
||||
},
|
||||
},
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{
|
||||
Variadic: false,
|
||||
IsReference: false,
|
||||
Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
ArgumentList: &node.ArgumentList{
|
||||
Arguments: []node.Node{
|
||||
&node.Argument{
|
||||
Variadic: false,
|
||||
IsReference: false,
|
||||
Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -2910,7 +2930,7 @@ func TestPhp5(t *testing.T) {
|
||||
&name.NamePart{Value: "Foo"},
|
||||
},
|
||||
},
|
||||
Arguments: []node.Node{},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
@@ -2922,10 +2942,10 @@ func TestPhp5(t *testing.T) {
|
||||
&name.NamePart{Value: "Foo"},
|
||||
},
|
||||
},
|
||||
Arguments: []node.Node{},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
Method: &node.Identifier{Value: "bar"},
|
||||
Arguments: []node.Node{},
|
||||
Method: &node.Identifier{Value: "bar"},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
Property: &node.Identifier{Value: "baz"},
|
||||
},
|
||||
@@ -2939,7 +2959,7 @@ func TestPhp5(t *testing.T) {
|
||||
&name.NamePart{Value: "Foo"},
|
||||
},
|
||||
},
|
||||
Arguments: []node.Node{},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
Dim: &scalar.Lnumber{Value: "0"},
|
||||
},
|
||||
@@ -2955,12 +2975,12 @@ func TestPhp5(t *testing.T) {
|
||||
&name.NamePart{Value: "Foo"},
|
||||
},
|
||||
},
|
||||
Arguments: []node.Node{},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
Dim: &scalar.Lnumber{Value: "0"},
|
||||
},
|
||||
Method: &node.Identifier{Value: "bar"},
|
||||
Arguments: []node.Node{},
|
||||
Method: &node.Identifier{Value: "bar"},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
@@ -3574,16 +3594,16 @@ func TestPhp5(t *testing.T) {
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &expr.FunctionCall{
|
||||
Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}},
|
||||
Arguments: []node.Node{},
|
||||
Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &expr.ArrayDimFetch{
|
||||
Variable: &expr.ArrayDimFetch{
|
||||
Variable: &expr.FunctionCall{
|
||||
Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}},
|
||||
Arguments: []node.Node{},
|
||||
Function: &expr.Variable{VarName: &node.Identifier{Value: "foo"}},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
Dim: &scalar.Lnumber{Value: "0"},
|
||||
},
|
||||
@@ -3601,9 +3621,9 @@ func TestPhp5(t *testing.T) {
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &expr.StaticCall{
|
||||
Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}},
|
||||
Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}},
|
||||
Arguments: []node.Node{},
|
||||
Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}},
|
||||
Call: &expr.Variable{VarName: &node.Identifier{Value: "bar"}},
|
||||
ArgumentList: &node.ArgumentList{},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
|
||||
Reference in New Issue
Block a user