diff --git a/src/lexer.rs b/src/lexer.rs index aa49ba6..9f25577 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -372,7 +372,7 @@ impl<'a> Lexer<'a> { self.pos.next_char(); let mut name = String::with_capacity(99); while let Some(c) = self.buf.peek() { - if !c.is_alphabetic() && c != &'-' && c != &'_' { + if !c.is_alphanumeric() && c != &'-' && c != &'_' { break; } let tok = self diff --git a/tests/main.rs b/tests/main.rs index 53e2cae..30ec77b 100644 --- a/tests/main.rs +++ b/tests/main.rs @@ -95,6 +95,11 @@ mod test_variables { "$a: red; a {\n color: #{#{$a}};\n}\n", "a {\n color: red;\n}\n" ); + test!( + numbers_in_variable, + "$var1: red; a {\n color: $var1;\n}\n", + "a {\n color: red;\n}\n" + ); } #[cfg(test)]