mirror of
https://github.com/danog/parser.git
synced 2024-11-26 20:04:57 +01:00
fix: handle opening and closing tags in more places
This commit is contained in:
parent
c8608eab92
commit
bf0eda2ea3
@ -136,6 +136,7 @@ pub fn switch_statement(state: &mut State) -> ParseResult<Statement> {
|
||||
state.next();
|
||||
|
||||
utils::skip_any_of(state, &[TokenKind::Colon, TokenKind::SemiColon])?;
|
||||
utils::skip_close_tag(state)?;
|
||||
|
||||
let mut body = Block::new();
|
||||
|
||||
|
@ -100,6 +100,9 @@ fn top_level_statement(state: &mut State) -> ParseResult<Statement> {
|
||||
fn statement(state: &mut State) -> ParseResult<Statement> {
|
||||
let has_attributes = attributes::gather_attributes(state)?;
|
||||
|
||||
// FIXME: There's a better place to put this but night-time brain doesn't know where.
|
||||
utils::skip_open_tag(state)?;
|
||||
|
||||
let statement = if has_attributes {
|
||||
match &state.current.kind {
|
||||
TokenKind::Abstract => classes::parse(state)?,
|
||||
|
Loading…
Reference in New Issue
Block a user