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()); 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(); toks.next();
let mut n = String::new(); let mut n = String::new();
@ -407,9 +407,6 @@ pub(crate) fn eat_ident<I: Iterator<Item = Token>>(
s.push(c); s.push(c);
}; };
} }
_ if !tok.kind.is_ascii() && !tok.kind.is_control() => {
s.push(toks.next().unwrap().kind)
}
_ => break, _ => break,
} }
} }
@ -425,7 +422,7 @@ pub(crate) fn eat_ident_no_interpolation<I: Iterator<Item = Token>>(
'#' => { '#' => {
break; 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('\\'); s.push('\\');
toks.next(); toks.next();
@ -439,9 +436,6 @@ pub(crate) fn eat_ident_no_interpolation<I: Iterator<Item = Token>>(
todo!() todo!()
} }
} }
_ if !tok.kind.is_ascii() && !tok.kind.is_control() => {
s.push(toks.next().unwrap().kind)
}
_ => break, _ => break,
} }
} }

View File

@ -365,7 +365,7 @@ impl Value {
Ok(parse_hex(toks, scope, super_selector)?) 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)?; let mut s = eat_ident(toks, scope, super_selector)?;
match toks.peek() { match toks.peek() {
Some(Token { kind: '(', .. }) => { Some(Token { kind: '(', .. }) => {