split Exit and Die nodes
This commit is contained in:
266
php7/php7.go
266
php7/php7.go
File diff suppressed because it is too large
Load Diff
@@ -1844,7 +1844,11 @@ expr_without_variable:
|
||||
}
|
||||
| T_EXIT exit_expr
|
||||
{
|
||||
$$ = expr.NewExit($2, strings.EqualFold($1.Value, "die"))
|
||||
if (strings.EqualFold($1.Value, "die")) {
|
||||
$$ = expr.NewDie($2)
|
||||
} else {
|
||||
$$ = expr.NewExit($2)
|
||||
}
|
||||
positions.AddPosition($$, positionBuilder.NewTokenNodePosition($1, $2))
|
||||
comments.AddComments($$, $1.Comments())
|
||||
}
|
||||
|
||||
@@ -2206,25 +2206,19 @@ CAD;
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &expr.Exit{
|
||||
IsDie: false,
|
||||
},
|
||||
Expr: &expr.Exit{},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &expr.Exit{
|
||||
IsDie: false,
|
||||
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &expr.Exit{
|
||||
IsDie: true,
|
||||
},
|
||||
Expr: &expr.Die{},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &expr.Exit{
|
||||
IsDie: true,
|
||||
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &expr.Die{
|
||||
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
|
||||
Reference in New Issue
Block a user