diff --git a/src/lexer.rs b/src/lexer.rs index 74404a3..5041066 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -59,6 +59,7 @@ impl<'a> Iterator for Lexer<'a> { s.push_str(&kw.to_string()); TokenKind::Ident(s) } + TokenKind::Symbol(Symbol::Minus) => TokenKind::Ident(String::from("--")), _ => unsafe { std::hint::unreachable_unchecked() }, }, _ => TokenKind::Symbol(Symbol::Minus), diff --git a/tests/interpolation.rs b/tests/interpolation.rs index aeff296..4a7c8eb 100644 --- a/tests/interpolation.rs +++ b/tests/interpolation.rs @@ -18,3 +18,8 @@ test!( "a {\n color: a#{foo}1;\n}\n", "a {\n color: afoo1;\n}\n" ); +test!( + double_hyphen_before_interpolation, + "a {\n --#{foo}: red;\n}\n", + "a {\n --foo: red;\n}\n" +);