allow non-ascii characters in idents
This commit is contained in:
parent
1e5dc99793
commit
9c690140ec
16
src/utils.rs
16
src/utils.rs
@ -375,7 +375,13 @@ pub(crate) fn eat_ident<I: Iterator<Item = Token>>(
|
||||
return Err("Expected identifier.".into());
|
||||
}
|
||||
}
|
||||
'a'..='z' | 'A'..='Z' | '0'..='9' | '-' | '_' => s.push(toks.next().unwrap().kind),
|
||||
_ if tok.kind.is_ascii_alphanumeric()
|
||||
|| tok.kind == '-'
|
||||
|| tok.kind == '_'
|
||||
|| (!tok.kind.is_ascii() && !tok.kind.is_control()) =>
|
||||
{
|
||||
s.push(toks.next().unwrap().kind)
|
||||
}
|
||||
'\\' => {
|
||||
toks.next();
|
||||
let mut n = String::new();
|
||||
@ -422,7 +428,13 @@ pub(crate) fn eat_ident_no_interpolation<I: Iterator<Item = Token>>(
|
||||
'#' => {
|
||||
break;
|
||||
}
|
||||
'a'..='z' | 'A'..='Z' | '0'..='9' | '-' | '_' => s.push(toks.next().unwrap().kind),
|
||||
_ if tok.kind.is_ascii_alphanumeric()
|
||||
|| tok.kind == '-'
|
||||
|| tok.kind == '_'
|
||||
|| (!tok.kind.is_ascii() && !tok.kind.is_control()) =>
|
||||
{
|
||||
s.push(toks.next().unwrap().kind)
|
||||
}
|
||||
'\\' => {
|
||||
s.push('\\');
|
||||
toks.next();
|
||||
|
@ -365,7 +365,11 @@ impl Value {
|
||||
Ok(parse_hex(toks, scope, super_selector)?)
|
||||
}
|
||||
}
|
||||
'a'..='z' | 'A'..='Z' | '_' | '\\' => {
|
||||
_ if kind.is_ascii_alphabetic()
|
||||
|| kind == '_'
|
||||
|| kind == '\\'
|
||||
|| (!kind.is_ascii() && !kind.is_control()) =>
|
||||
{
|
||||
let mut s = eat_ident(toks, scope, super_selector)?;
|
||||
match toks.peek() {
|
||||
Some(Token { kind: '(', .. }) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user