split Switch and AltSwitch nodes
This commit is contained in:
708
php7/php7.go
708
php7/php7.go
File diff suppressed because it is too large
Load Diff
@@ -552,7 +552,11 @@ statement:
|
||||
}
|
||||
| T_SWITCH '(' expr ')' switch_case_list
|
||||
{
|
||||
$$ = stmt.NewSwitch($3, $5.nodes)
|
||||
if ($5.endToken.Value == ";") {
|
||||
$$ = stmt.NewAltSwitch($3, $5.nodes)
|
||||
} else {
|
||||
$$ = stmt.NewSwitch($3, $5.nodes)
|
||||
}
|
||||
positions.AddPosition($$, positionBuilder.NewTokensPosition($1, $5.endToken))
|
||||
comments.AddComments($$, $1.Comments())
|
||||
}
|
||||
|
||||
@@ -1423,7 +1423,7 @@ CAD;
|
||||
},
|
||||
},
|
||||
},
|
||||
&stmt.Switch{
|
||||
&stmt.AltSwitch{
|
||||
Cond: &scalar.Lnumber{Value: "1"},
|
||||
Cases: []node.Node{
|
||||
&stmt.Case{
|
||||
@@ -1439,7 +1439,7 @@ CAD;
|
||||
},
|
||||
},
|
||||
},
|
||||
&stmt.Switch{
|
||||
&stmt.AltSwitch{
|
||||
Cond: &scalar.Lnumber{Value: "1"},
|
||||
Cases: []node.Node{
|
||||
&stmt.Case{
|
||||
|
||||
Reference in New Issue
Block a user