Removed a feature which disallowed comments in functios

pull/1/head
ondra05 2021-12-14 21:10:58 +01:00
parent 3358234914
commit a722ea00d5
1 changed files with 10 additions and 3 deletions

View File

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