File tree Expand file tree Collapse file tree 3 files changed +2133
-10
lines changed Expand file tree Collapse file tree 3 files changed +2133
-10
lines changed Original file line number Diff line number Diff line change @@ -42,9 +42,10 @@ module.exports = {
4242 } else {
4343 this . expect ( [ "{" , ":" ] ) ;
4444 }
45+ this . next ( ) ;
4546 // OPTIONNAL ';'
4647 // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L570
47- if ( this . next ( ) . token === ";" ) {
48+ if ( this . token === ";" ) {
4849 this . next ( ) ;
4950 }
5051 // EXTRACTING CASES
@@ -66,20 +67,20 @@ module.exports = {
6667 read_case_list : function ( stopToken ) {
6768 const result = this . node ( "case" ) ;
6869 let test = null ;
69- let body = null ;
70- const items = [ ] ;
7170 if ( this . token === this . tok . T_CASE ) {
7271 test = this . next ( ) . read_expr ( ) ;
7372 } else if ( this . token === this . tok . T_DEFAULT ) {
74- // the defaut entry - no condition
73+ // the default entry - no condition
7574 this . next ( ) ;
7675 } else {
7776 this . expect ( [ this . tok . T_CASE , this . tok . T_DEFAULT ] ) ;
7877 }
78+ // case_separator
7979 this . expect ( [ ":" , ";" ] ) && this . next ( ) ;
80- body = this . node ( "block" ) ;
80+ const body = this . node ( "block" ) ;
81+ const items = [ ] ;
8182 while (
82- this . token != this . EOF &&
83+ this . token !== this . EOF &&
8384 this . token !== stopToken &&
8485 this . token !== this . tok . T_CASE &&
8586 this . token !== this . tok . T_DEFAULT
You can’t perform that action at this time.
0 commit comments