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