php5 test coverage

This commit is contained in:
z7zmey
2018-02-14 12:14:08 +02:00
parent b13d520387
commit 4cac863d8f
4 changed files with 225 additions and 35 deletions

View File

@@ -2565,12 +2565,6 @@ dynamic_class_name_reference:
positions.AddPosition($$, positionBuilder.NewNodesPosition($$, nn))
comments.AddComments(nn, comments[$1])
fmt.Println("343"); $$ = nn
case *expr.MethodCall:
nn.Variable = $$
positions.AddPosition($$, positionBuilder.NewNodesPosition($$, nn))
comments.AddComments(nn, comments[$1])
fmt.Println("344"); $$ = nn
}
}
@@ -2587,12 +2581,6 @@ dynamic_class_name_reference:
positions.AddPosition($$, positionBuilder.NewNodesPosition($$, nn))
comments.AddComments(nn, comments[$1])
fmt.Println("346"); $$ = nn
case *expr.MethodCall:
nn.Variable = $$
positions.AddPosition($$, positionBuilder.NewNodesPosition($$, nn))
comments.AddComments(nn, comments[$1])
fmt.Println("347"); $$ = nn
}
}
}

View File

@@ -357,6 +357,10 @@ CAD;
"foo"[0];
foo[0];
static::foo;
new $foo;
new $a->b[0];
new $a->b{$b ?: null}->$c->d[0];
`
expectedParams := []node.Node{
@@ -2800,6 +2804,51 @@ CAD;
ConstantName: &node.Identifier{Value: "foo"},
},
},
&stmt.Expression{
Expr: &expr.New{
Class: &expr.Variable{VarName: &node.Identifier{Value: "$foo"}},
},
},
&stmt.Expression{
Expr: &expr.New{
Class: &expr.ArrayDimFetch{
Variable: &expr.PropertyFetch{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Property: &node.Identifier{Value: "b"},
},
Dim: &scalar.Lnumber{Value: "0"},
},
},
},
&stmt.Expression{
Expr: &expr.New{
Class: &expr.ArrayDimFetch{
Variable: &expr.PropertyFetch{
Variable: &expr.PropertyFetch{
Variable: &expr.ArrayDimFetch{
Variable: &expr.PropertyFetch{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Property: &node.Identifier{Value: "b"},
},
Dim: &expr.Ternary{
Condition: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
IfFalse: &expr.ConstFetch{
Constant: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "null"},
},
},
},
},
},
Property: &expr.Variable{VarName: &node.Identifier{Value: "$c"}},
},
Property: &node.Identifier{Value: "d"},
},
Dim: &scalar.Lnumber{Value: "0"},
},
},
},
},
}