We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c762c1 commit 122b387Copy full SHA for 122b387
src/lib.rs
@@ -74,11 +74,19 @@ pub trait UnicodeXID {
74
impl UnicodeXID for char {
75
#[inline]
76
fn is_xid_start(self) -> bool {
77
- derived_property::XID_Start(self)
+ // Fast-path for ascii idents
78
+ ('a' <= self && self <= 'z')
79
+ || ('A' <= self && self <= 'Z')
80
+ || (self > '\x7f' && derived_property::XID_Start(self))
81
}
82
83
84
fn is_xid_continue(self) -> bool {
- derived_property::XID_Continue(self)
85
86
87
88
+ || ('0' <= self && self <= '9')
89
+ || self == '_'
90
+ || (self > '\x7f' && derived_property::XID_Continue(self))
91
92
0 commit comments