File tree 1 file changed +2
-12
lines changed
1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -273,24 +273,14 @@ pub fn is_whitespace(c: char) -> bool {
273
273
/// a formal definition of valid identifier name.
274
274
pub fn is_id_start ( c : char ) -> bool {
275
275
// This is XID_Start OR '_' (which formally is not a XID_Start).
276
- // We also add fast-path for ascii idents
277
- ( 'a' ..='z' ) . contains ( & c)
278
- || ( 'A' ..='Z' ) . contains ( & c)
279
- || c == '_'
280
- || ( c > '\x7f' && unicode_xid:: UnicodeXID :: is_xid_start ( c) )
276
+ c == '_' || unicode_xid:: UnicodeXID :: is_xid_start ( c)
281
277
}
282
278
283
279
/// True if `c` is valid as a non-first character of an identifier.
284
280
/// See [Rust language reference](https://doc.rust-lang.org/reference/identifiers.html) for
285
281
/// a formal definition of valid identifier name.
286
282
pub fn is_id_continue ( c : char ) -> bool {
287
- // This is exactly XID_Continue.
288
- // We also add fast-path for ascii idents
289
- ( 'a' ..='z' ) . contains ( & c)
290
- || ( 'A' ..='Z' ) . contains ( & c)
291
- || ( '0' ..='9' ) . contains ( & c)
292
- || c == '_'
293
- || ( c > '\x7f' && unicode_xid:: UnicodeXID :: is_xid_continue ( c) )
283
+ unicode_xid:: UnicodeXID :: is_xid_continue ( c)
294
284
}
295
285
296
286
/// The passed string is lexically an identifier.
You can’t perform that action at this time.
0 commit comments