ruff/crates/ruff_python_parser/tests
Dhruv Manilawala 9c1b6ec411
Use correct range to highlight line continuation error (#12016)
## Summary

This PR fixes the range highlighted for the line continuation error.

Previously, it would highlight an incorrect range:
```
1 | call(a, b, \\\
  |           ^^ Syntax Error: unexpected character after line continuation character
2 | 
3 | def bar():
  |
```

And now:
```
  |
1 | call(a, b, \\\
  |             ^ Syntax Error: unexpected character after line continuation character
2 | 
3 | def bar():
  |
```

This is implemented by avoiding to update the token range for the
`Unknown` token which is emitted when there's a lexical error. Instead,
the `push_error` helper method will be responsible to update the range
to the error location.

This actually becomes a requirement which can be seen in follow-up PRs.

## Test Plan

Update and validate the snapshot.
2024-06-25 13:35:24 +05:30
..
snapshots Use correct range to highlight line continuation error (#12016) 2024-06-25 13:35:24 +05:30
fixtures.rs Update E999 to show all syntax errors (#11900) 2024-06-19 13:09:54 +05:30
generate_inline_tests.rs Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30