Removed a feature which disallowed comments in functios

This commit is contained in:
Erin 2021-12-14 21:10:58 +01:00 committed by ondra05
parent a9d9c7aa27
commit 872a16578f

View file

@ -53,9 +53,16 @@ impl<'source> Parser<'source> {
/// ///
/// If EOF, return Error instead of None /// If EOF, return Error instead of None
fn checked_next(&mut self) -> Result<Token, Error> { fn checked_next(&mut self) -> Result<Token, Error> {
self.lexer loop {
.next() match self
.ok_or_else(|| Error::unexpected_eof(self.lexer.span().start)) .lexer
.next()
.ok_or_else(|| Error::unexpected_eof(self.lexer.span().start))?
{
Token::Comment => (),
token => break Ok(token),
}
}
} }
/// Parse a token /// Parse a token