remove panic for missing equal

This commit is contained in:
ConnorSkees 2020-05-23 11:50:25 -04:00
parent bc12c0b4e7
commit a3548b0044
2 changed files with 5 additions and 1 deletions

View File

@ -858,7 +858,7 @@ impl Value {
}
'=' => {
let mut span = toks.next().unwrap().pos();
if let Token { kind: '=', pos } = toks.next().unwrap() {
if let Some(Token { kind: '=', pos }) = toks.next() {
span = span.merge(pos);
IntermediateValue::Op(Op::Equal).span(span)
} else {

View File

@ -167,3 +167,7 @@ error!(
operator_mul,
"a {color: 5 - *;}", "Error: Expected expression."
);
error!(
ends_with_single_eq,
"a {color: 1 =", "Error: expected \"=\"."
);