mirror of
https://github.com/danog/parser.git
synced 2024-11-30 04:29:13 +01:00
parser: skip some more comments
This commit is contained in:
parent
6ac532becb
commit
a76b8d54ef
@ -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()?;
|
||||||
|
Loading…
Reference in New Issue
Block a user