handle no value after /

This commit is contained in:
ConnorSkees 2020-04-02 02:32:32 -04:00
parent 562a9da820
commit b440258027
2 changed files with 7 additions and 0 deletions

View File

@ -599,6 +599,9 @@ impl Value {
} }
'/' => { '/' => {
toks.next(); toks.next();
if toks.peek().is_none() {
return Err("Expected expression.".into());
}
if '*' == toks.peek().unwrap().kind { if '*' == toks.peek().unwrap().kind {
toks.next(); toks.next();
eat_comment(toks, &Scope::new(), &Selector::new())?; eat_comment(toks, &Scope::new(), &Selector::new())?;

View File

@ -53,3 +53,7 @@ error!(
"a{l {color: foo;}}", "Error: expected selector." "a{l {color: foo;}}", "Error: expected selector."
); );
error!(backtick_in_selector, "a`{}", "Error: expected selector."); error!(backtick_in_selector, "a`{}", "Error: expected selector.");
error!(
no_value_after_forward_slash,
"a {color: 303/;}", "Error: Expected expression."
);