parser: skip some more comments

This commit is contained in:
Ryan Chandler 2022-08-09 21:02:36 +01:00
parent 6ac532becb
commit a76b8d54ef
No known key found for this signature in database
GPG Key ID: F113BCADDB3B0CCA

View File

@ -313,6 +313,7 @@ impl Parser {
self.lbrace()?; self.lbrace()?;
let mut body = Block::new(); let mut body = Block::new();
self.skip_comments();
while self.current.kind != TokenKind::RightBrace { while self.current.kind != TokenKind::RightBrace {
match self.current.kind { match self.current.kind {
TokenKind::Public => { TokenKind::Public => {
@ -364,7 +365,9 @@ impl Parser {
body.push(Statement::Method { name: name.into(), params, body: vec![], return_type, flags: vec![] }) body.push(Statement::Method { name: name.into(), params, body: vec![], return_type, flags: vec![] })
}, },
_ => return Err(ParseError::UnexpectedToken(self.current.kind.to_string(), self.current.span)), _ => return Err(ParseError::UnexpectedToken(self.current.kind.to_string(), self.current.span)),
} };
self.skip_comments();
} }
self.rbrace()?; self.rbrace()?;