Change the lookahead in MacroParser::new.

As it happens, lookahead values of 0, 1, and 2 all work fine here, due
to the structure of the code. (Values or 3 or greater cause test
failures.) This commit changes the lookahead to zero because that will
facilitate cleanups in subsequent commits.
This commit is contained in:
Nicholas Nethercote 2024-12-11 14:13:04 +11:00
parent 1d35638dc3
commit 0bf6e82c54

View file

@ -1190,7 +1190,7 @@ impl<'a> MacroParser<'a> {
// (`(` ... `)` `=>` `{` ... `}`)*
fn parse(&mut self) -> Option<Macro> {
let mut branches = vec![];
while self.toks.look_ahead(1).is_some() {
while self.toks.look_ahead(0).is_some() {
branches.push(self.parse_branch()?);
}