Fix crash encountering --

This commit is contained in:
ConnorSkees 2020-02-14 13:27:08 -05:00
parent 3af2292d5b
commit c95ecc0825
2 changed files with 6 additions and 0 deletions

View File

@ -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),

View File

@ -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"
);