File tree Expand file tree Collapse file tree 1 file changed +20
-9
lines changed Expand file tree Collapse file tree 1 file changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,16 @@ module.exports = {
35
35
// check if current char can be a label
36
36
is_LABEL_START : function ( ) {
37
37
const ch = this . _input . charCodeAt ( this . offset - 1 ) ;
38
- return (
39
- ( ch > 96 && ch < 123 ) || ( ch > 64 && ch < 91 ) || ch === 95 || ch > 126
40
- ) ;
38
+ // A - Z
39
+ if ( ch > 64 && ch < 91 ) return true ;
40
+ // a - z
41
+ if ( ch > 96 && ch < 123 ) return true ;
42
+ // _ (95)
43
+ if ( ch === 95 ) return true ;
44
+ // utf8 / extended
45
+ if ( ch > 126 ) return true ;
46
+ // else
47
+ return false ;
41
48
} ,
42
49
43
50
// reads each char of the label
@@ -81,11 +88,15 @@ module.exports = {
81
88
// check if current char can be a hexadecimal number
82
89
is_HEX : function ( ) {
83
90
const ch = this . _input . charCodeAt ( this . offset - 1 ) ;
84
- return (
85
- ( ch > 47 && ch < 58 ) ||
86
- ( ch > 64 && ch < 71 ) ||
87
- ( ch > 96 && ch < 103 ) ||
88
- ch === 95
89
- ) ;
91
+ // 0 - 9
92
+ if ( ch > 47 && ch < 58 ) return true ;
93
+ // A - F
94
+ if ( ch > 64 && ch < 71 ) return true ;
95
+ // a - f
96
+ if ( ch > 96 && ch < 103 ) return true ;
97
+ // _ (code 95)
98
+ if ( ch === 95 ) return true ;
99
+ // else
100
+ return false ;
90
101
}
91
102
} ;
You can’t perform that action at this time.
0 commit comments