parser: skip comments above trait statements

This commit is contained in:
Ryan Chandler 2022-11-30 00:33:56 +00:00
parent 9e441143c5
commit 19213d2d05
No known key found for this signature in database
GPG Key ID: F113BCADDB3B0CCA

View File

@ -697,6 +697,7 @@ impl Parser {
let mut body = Block::new();
while self.current.kind != TokenKind::RightBrace {
self.skip_comments();
match self.class_statement()? {
Statement::ClassConstant { .. } => {
return Err(ParseError::TraitCannotContainConstant(self.current.span))