Closed GreasySlug closed 1 year ago
Parsing EOF with Parser may consume EOF in rare cases This causes a panic because it cannot get the token with debug_exit_info!
debug_exit_info!
cargo dprs
a = ( 1
let rparen = self.lpop(); <- consume EOF if let Expr::Tuple(Tuple::Normal(tup)) = &mut expr { tup.elems.paren = Some((lparen, rparen)); }
Syntax error
panic
No response
0.6.4
Python3.11
Windows 10
I fixed this issue and introduced a useful macro expect_pop!.
expect_pop!
This macro expects a specific token at the current position and returns an error if not.
Describe the bug?
Parsing EOF with Parser may consume EOF in rare cases This causes a panic because it cannot get the token with
debug_exit_info!
Reproducible code
cargo dprs
Expected result
Syntax error
Actual result
panic
Additional context
No response
Erg version
0.6.4
Python version
Python3.11
OS
Windows 10