Commit c5854bb
fix(parser): handle EOF after augmented
The proptest panic fuzzer found that token streams like `1 not` panic the
parser. When `consume_binary_expression_left_associative` consumed a
`not` and the following augmented operator was missing, the error path
called `require_current_token().expect("there has to be a token")` —
which panics on end-of-input.
Return an `Error::end_of_input` instead, falling back to the previous
"unexpected token" message when a current token does exist. The
regression seed found by proptest is now in `panic.regressions`.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>not without panicking 🪤1 parent ee5ad8f commit c5854bb
2 files changed
Lines changed: 13 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
183 | 182 | | |
184 | 183 | | |
185 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
0 commit comments