mirror of
https://github.com/RustPython/Parser.git
synced 2025-08-31 23:57:57 +00:00
Parse Python 3.9+ parenthesized context managers
Since the upstream grammar for this is not LR(1), we abuse LALRPOP macros and the Into/TryInto traits to build a cover grammar that converts to either tuples or `with` items after additional validation. It’s annoying and ugly, but something like this is basically our only option short of switching to a more powerful parser algorithm. Fixes #4145. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
parent
dec0bf571f
commit
bfd847d04c
4 changed files with 2412 additions and 85 deletions
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue