blob: 4235d2648ad3a903ab9d71655d16bdf70323f7ba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
use unicode_xid::UnicodeXID;
pub fn is_ident_start(c: char) -> bool {
(c >= 'a' && c <= 'z')
|| (c >= 'A' && c <= 'Z')
|| c == '_'
|| (c > '\x7f' && UnicodeXID::is_xid_start(c))
}
pub fn is_ident_continue(c: char) -> bool {
(c >= 'a' && c <= 'z')
|| (c >= 'A' && c <= 'Z')
|| (c >= '0' && c <= '9')
|| c == '_'
|| (c > '\x7f' && UnicodeXID::is_xid_continue(c))
}
pub fn is_whitespace(c: char) -> bool {
//FIXME: use is_pattern_whitespace
//https://github.com/behnam/rust-unic/issues/192
c.is_whitespace()
}
pub fn is_dec_digit(c: char) -> bool {
'0' <= c && c <= '9'
}
|