handle toplevel closing curly brace
This commit is contained in:
parent
a3548b0044
commit
eca952b201
@ -332,14 +332,15 @@ impl<'a> StyleSheetParser<'a> {
|
|||||||
.into())
|
.into())
|
||||||
}
|
}
|
||||||
c if c.is_control() => {
|
c if c.is_control() => {
|
||||||
return Err(("expected selector.", self.lexer.next().unwrap().pos()).into());
|
return Err(("expected selector.", self.lexer.next().unwrap().pos).into());
|
||||||
}
|
}
|
||||||
',' | '!' | '{' => {
|
',' | '!' | '{' => {
|
||||||
return Err(("expected \"{\".", self.lexer.next().unwrap().pos()).into());
|
return Err(("expected \"{\".", self.lexer.next().unwrap().pos).into());
|
||||||
}
|
}
|
||||||
'`' | '\'' | '"' => {
|
'`' | '\'' | '"' => {
|
||||||
return Err(("expected selector.", self.lexer.next().unwrap().pos()).into());
|
return Err(("expected selector.", self.lexer.next().unwrap().pos).into());
|
||||||
}
|
}
|
||||||
|
'}' => return Err(("unmatched \"}\".", self.lexer.next().unwrap().pos).into()),
|
||||||
_ => todo!("unexpected toplevel token: {:?}", kind),
|
_ => todo!("unexpected toplevel token: {:?}", kind),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -123,6 +123,7 @@ error!(
|
|||||||
"#{", "Error: expected \"}\"."
|
"#{", "Error: expected \"}\"."
|
||||||
);
|
);
|
||||||
error!(toplevel_hash, "#", "Error: expected \"{\".");
|
error!(toplevel_hash, "#", "Error: expected \"{\".");
|
||||||
|
error!(toplevel_closing_brace, "}", "Error: unmatched \"}\".");
|
||||||
error!(toplevel_at, "@", "Error: Expected identifier.");
|
error!(toplevel_at, "@", "Error: Expected identifier.");
|
||||||
error!(
|
error!(
|
||||||
toplevel_ampersand,
|
toplevel_ampersand,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user