Fixed BF code parsing

trunk v0.5.4
ondra05 2023-05-18 23:49:54 +02:00
parent dbaa390113
commit 4d6b30bcd0
No known key found for this signature in database
GPG Key ID: 0DA6D2BB2285E881
1 changed files with 4 additions and 10 deletions

View File

@ -462,16 +462,10 @@ impl<'source> Parser<'source> {
let mut code: Vec<u8> = vec![]; let mut code: Vec<u8> = vec![];
loop { loop {
match self.checked_next()? { match self.lexer.next() {
Token::Plus Some(Ok(Token::RightCurly)) => break,
| Token::Minus Some(_) => code.push(self.lexer.slice().as_bytes()[0]),
| Token::Comma None => return Err(Error::unexpected_eoi(self.lexer.span().start)),
| Token::LeftBracket
| Token::RightBracket
| Token::LessThan
| Token::GreaterThan => code.push(self.lexer.slice().as_bytes()[0]),
Token::RightCurly => break,
_ => (),
} }
} }