parser: Allow StmtKind to parse itself (whoops!)

This commit is contained in:
John 2024-02-26 16:03:18 -06:00
parent 66deb41301
commit c36eec216a

View File

@ -439,12 +439,7 @@ impl<'t> Parser<'t> {
const PARSING: Parsing = Parsing::Stmt; const PARSING: Parsing = Parsing::Stmt;
let start = self.loc(); let start = self.loc();
Ok(Stmt { Ok(Stmt {
kind: match self.peek_type(PARSING)? { kind: self.stmtkind()?,
Type::Semi => Ok(StmtKind::Empty),
Type::Keyword(Keyword::Let) => self.stmtkind_local(),
item_like!() => self.stmtkind_item(),
_ => self.stmtkind_expr(),
}?,
semi: match self.peek_type(PARSING) { semi: match self.peek_type(PARSING) {
Ok(Type::Semi) => { Ok(Type::Semi) => {
self.consume_peeked(); self.consume_peeked();