emit proper error for toplevel "

This commit is contained in:
ConnorSkees 2020-05-21 13:39:37 -04:00
parent 4cba3dfd4e
commit 2bd8232a00
2 changed files with 4 additions and 2 deletions

View File

@ -387,8 +387,9 @@ pub(crate) fn eat_expr<I: Iterator<Item = Token>>(
} }
} }
'\\' => { '\\' => {
values.push(toks.next().unwrap()); let next = toks.next().unwrap();
values.push(toks.next().unwrap()); values.push(next);
values.push(toks.next().ok_or(("expected \"}\".", next.pos))?);
} }
// todo: this should only apply to special functions // todo: this should only apply to special functions
// it is causing us to emit nothing on malformed input // it is causing us to emit nothing on malformed input

View File

@ -123,6 +123,7 @@ error!(
"#{", "Error: expected \"}\"." "#{", "Error: expected \"}\"."
); );
error!(toplevel_hash, "#", "Error: expected \"{\"."); error!(toplevel_hash, "#", "Error: expected \"{\".");
error!(toplevel_backslash, "\\", "Error: expected \"}\".");
error!(toplevel_var_no_colon, "$r", "Error: expected \":\"."); error!(toplevel_var_no_colon, "$r", "Error: expected \":\".");
error!(bar_in_value, "a {color: a|b;}", "Error: expected \";\"."); error!(bar_in_value, "a {color: a|b;}", "Error: expected \";\".");
error!( error!(