File tree 2 files changed +8
-11
lines changed
2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ module.exports = {
183
183
*/
184
184
function read_constant_declaration ( ) {
185
185
var result = this . node ( 'classconstant' ) , name = null , value = null ;
186
- if ( this . is ( 'IDENTIFIER' ) || this . expect ( this . tok . T_STRING ) ) {
186
+ if ( this . token === this . tok . T_STRING || this . is ( 'IDENTIFIER' ) ) {
187
187
name = this . text ( ) ;
188
188
this . next ( ) ;
189
189
}
Original file line number Diff line number Diff line change @@ -127,23 +127,20 @@ module.exports = {
127
127
result = node ( result , offset ) ;
128
128
break ;
129
129
case this . tok . T_DOUBLE_COLON :
130
- var node = this . node ( 'staticlookup' ) , offset ;
131
- this . next ( ) ;
132
-
133
- if ( this . is ( 'IDENTIFIER' ) || this . token === this . tok . T_STRING
134
- || this . token === this . tok . T_CLASS
135
- ) {
136
- offset = this . node ( 'constref' ) ;
130
+ if ( ( this . next ( ) . token === this . tok . T_STRING || this . is ( 'IDENTIFIER' ) ) ) {
131
+ var node = this . node ( 'staticlookup' ) ;
132
+ var offset = this . node ( 'constref' ) ;
137
133
var name = this . text ( ) ;
134
+
138
135
this . next ( ) ;
139
136
offset = offset ( name ) ;
140
-
137
+
141
138
if ( this . token === this . tok . T_OBJECT_OPERATOR || this . token === this . tok . T_DOUBLE_COLON ) {
142
139
this . error ( ) ;
140
+ } else {
141
+ result = node ( result , offset ) ;
143
142
}
144
143
}
145
-
146
- result = node ( result , offset ) ;
147
144
break ;
148
145
case this . tok . T_OBJECT_OPERATOR :
149
146
var node = this . node ( 'propertylookup' ) ;
You can’t perform that action at this time.
0 commit comments