split Exit and Die nodes
This commit is contained in:
450
php5/php5.go
450
php5/php5.go
File diff suppressed because it is too large
Load Diff
@@ -2226,7 +2226,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())
|
||||
}
|
||||
|
||||
@@ -2119,25 +2119,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