Revert "properly handle unicode characters in identifiers"

This reverts commit dea0610f9b12a8531ae63eee993c0c6d6546bb72.

This was not properly tested, and results in a number of breakages.
This commit is contained in:
ConnorSkees 2020-03-30 01:00:17 -04:00
parent dea0610f9b
commit 1e5dc99793
2 changed files with 3 additions and 9 deletions

View File

@ -375,7 +375,7 @@ pub(crate) fn eat_ident<I: Iterator<Item = Token>>(
return Err("Expected identifier.".into());
}
}
'-' | '_' | _ if tok.kind.is_alphanumeric() => s.push(toks.next().unwrap().kind),
'a'..='z' | 'A'..='Z' | '0'..='9' | '-' | '_' => s.push(toks.next().unwrap().kind),
'\\' => {
toks.next();
let mut n = String::new();
@ -407,9 +407,6 @@ pub(crate) fn eat_ident<I: Iterator<Item = Token>>(
s.push(c);
};
}
_ if !tok.kind.is_ascii() && !tok.kind.is_control() => {
s.push(toks.next().unwrap().kind)
}
_ => break,
}
}
@ -425,7 +422,7 @@ pub(crate) fn eat_ident_no_interpolation<I: Iterator<Item = Token>>(
'#' => {
break;
}
'-' | '_' | _ if tok.kind.is_alphanumeric() => s.push(toks.next().unwrap().kind),
'a'..='z' | 'A'..='Z' | '0'..='9' | '-' | '_' => s.push(toks.next().unwrap().kind),
'\\' => {
s.push('\\');
toks.next();
@ -439,9 +436,6 @@ pub(crate) fn eat_ident_no_interpolation<I: Iterator<Item = Token>>(
todo!()
}
}
_ if !tok.kind.is_ascii() && !tok.kind.is_control() => {
s.push(toks.next().unwrap().kind)
}
_ => break,
}
}

View File

@ -365,7 +365,7 @@ impl Value {
Ok(parse_hex(toks, scope, super_selector)?)
}
}
'_' | '\\' | _ if kind.is_alphabetic() || (!kind.is_ascii() && !kind.is_control()) => {
'a'..='z' | 'A'..='Z' | '_' | '\\' => {
let mut s = eat_ident(toks, scope, super_selector)?;
match toks.peek() {
Some(Token { kind: '(', .. }) => {