From 598f79ab5005a73245f8c349b8b474cc3f84ca56 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Sat, 4 Apr 2020 21:05:22 -0400 Subject: [PATCH] allow selectors to begin with 0-9 --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 5d9b00f..2584f27 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -282,7 +282,7 @@ impl<'a> StyleSheetParser<'a> { let mut rules: Vec = Vec::new(); while let Some(Token { kind, .. }) = self.lexer.peek() { match kind { - 'a'..='z' | 'A'..='Z' | '_' | '-' + 'a'..='z' | 'A'..='Z' | '_' | '-' | '0'..='9' | '[' | '#' | ':' | '*' | '%' | '.' | '>' => rules .extend(self.eat_rules(&Selector::new(), &mut Scope::new())?), &'\t' | &'\n' | ' ' => { @@ -397,7 +397,7 @@ impl<'a> StyleSheetParser<'a> { return Err("expected selector.".into()); } _ => match dbg!(self.lexer.next()) { - Some(Token { pos, .. }) => self.error(pos, "unexpected toplevel token"), + Some(..) => todo!("unexpected toplevel token"), _ => unsafe { std::hint::unreachable_unchecked() }, } };