File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -232,17 +232,19 @@ private function parseCharacter($bIsForIdentifier) {
232
232
return iconv ('utf-32le ' , $ this ->sCharset , $ sUtf32 );
233
233
}
234
234
if ($ bIsForIdentifier ) {
235
- if (preg_match ('/[a-zA-Z0-9]|-|_/u ' , $ this ->peek ()) === 1 ) {
235
+ $ peek = ord ($ this ->peek ());
236
+ // Ranges: a-z A-Z 0-9 - _
237
+ if (($ peek >= 97 && $ peek <= 122 ) ||
238
+ ($ peek >= 65 && $ peek <= 90 ) ||
239
+ ($ peek >= 48 && $ peek <= 57 ) ||
240
+ ($ peek === 45 ) ||
241
+ ($ peek === 95 ) ||
242
+ ($ peek > 0xa1 )) {
236
243
return $ this ->consume (1 );
237
- } else if (ord ($ this ->peek ()) > 0xa1 ) {
238
- return $ this ->consume (1 );
239
- } else {
240
- return null ;
241
244
}
242
245
} else {
243
246
return $ this ->consume (1 );
244
247
}
245
- // Does not reach here
246
248
return null ;
247
249
}
248
250
You can’t perform that action at this time.
0 commit comments