Skip to content

Commit

Permalink
Parse Python 3.9+ parenthesized context managers
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
andersk committed Dec 12, 2022
1 parent 751f9d3 commit 052dee7
Show file tree
Hide file tree
Showing 4 changed files with 2,413 additions and 86 deletions.
Loading

0 comments on commit 052dee7

Please sign in to comment.