remove unwrap from variable value parsing

This commit is contained in:
ConnorSkees 2020-06-18 01:13:23 -04:00
parent d90ef7fa41
commit 0352c82c88
2 changed files with 7 additions and 1 deletions

View File

@ -123,7 +123,9 @@ impl<'a> Parser<'a> {
}
Some(..) | None => {}
}
val_toks.push(self.toks.next().unwrap());
if let Some(tok) = self.toks.next() {
val_toks.push(tok);
}
}
'{' => break,
'}' => {

View File

@ -143,3 +143,7 @@ error!(
invalid_escape,
"$\\110000: red;", "Error: Invalid escape sequence."
);
error!(
nothing_after_hash_in_variable_decl,
"$color: #", "Error: Expected identifier."
);