fix: handle opening and closing tags in more places

This commit is contained in:
Ryan Chandler 2022-12-09 23:22:49 +00:00
parent c8608eab92
commit bf0eda2ea3
No known key found for this signature in database
GPG Key ID: F113BCADDB3B0CCA
2 changed files with 4 additions and 0 deletions

View File

@ -136,6 +136,7 @@ pub fn switch_statement(state: &mut State) -> ParseResult<Statement> {
state.next(); state.next();
utils::skip_any_of(state, &[TokenKind::Colon, TokenKind::SemiColon])?; utils::skip_any_of(state, &[TokenKind::Colon, TokenKind::SemiColon])?;
utils::skip_close_tag(state)?;
let mut body = Block::new(); let mut body = Block::new();

View File

@ -100,6 +100,9 @@ fn top_level_statement(state: &mut State) -> ParseResult<Statement> {
fn statement(state: &mut State) -> ParseResult<Statement> { fn statement(state: &mut State) -> ParseResult<Statement> {
let has_attributes = attributes::gather_attributes(state)?; 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 { let statement = if has_attributes {
match &state.current.kind { match &state.current.kind {
TokenKind::Abstract => classes::parse(state)?, TokenKind::Abstract => classes::parse(state)?,