File tree 3 files changed +2133
-10
lines changed
3 files changed +2133
-10
lines changed Original file line number Diff line number Diff line change @@ -42,9 +42,10 @@ module.exports = {
42
42
} else {
43
43
this . expect ( [ "{" , ":" ] ) ;
44
44
}
45
+ this . next ( ) ;
45
46
// OPTIONNAL ';'
46
47
// https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L570
47
- if ( this . next ( ) . token === ";" ) {
48
+ if ( this . token === ";" ) {
48
49
this . next ( ) ;
49
50
}
50
51
// EXTRACTING CASES
@@ -66,20 +67,20 @@ module.exports = {
66
67
read_case_list : function ( stopToken ) {
67
68
const result = this . node ( "case" ) ;
68
69
let test = null ;
69
- let body = null ;
70
- const items = [ ] ;
71
70
if ( this . token === this . tok . T_CASE ) {
72
71
test = this . next ( ) . read_expr ( ) ;
73
72
} else if ( this . token === this . tok . T_DEFAULT ) {
74
- // the defaut entry - no condition
73
+ // the default entry - no condition
75
74
this . next ( ) ;
76
75
} else {
77
76
this . expect ( [ this . tok . T_CASE , this . tok . T_DEFAULT ] ) ;
78
77
}
78
+ // case_separator
79
79
this . expect ( [ ":" , ";" ] ) && this . next ( ) ;
80
- body = this . node ( "block" ) ;
80
+ const body = this . node ( "block" ) ;
81
+ const items = [ ] ;
81
82
while (
82
- this . token != this . EOF &&
83
+ this . token !== this . EOF &&
83
84
this . token !== stopToken &&
84
85
this . token !== this . tok . T_CASE &&
85
86
this . token !== this . tok . T_DEFAULT
You can’t perform that action at this time.
0 commit comments