Commit Graph

3 Commits

Author SHA1 Message Date
Josh Brown
f39c1141d8 Revert "Merge pull request #257 from microsoft/jb1/reapply-22.1-tmp"
This reverts commit 6d496ee073, reversing
changes made to 866977b6c5.
2025-08-11 12:45:01 -07:00
Josh Brown
5fb45c89e9 Revert "Merge pull request #251 from microsoft/jb1/upstream-zipslip"
This reverts commit 4dfa5d2858, reversing
changes made to 8cd58aa6e8.
2025-07-10 14:57:38 -07:00
Taus
e04821e9e3 Python: Allow use of match as an identifier
This previously only worked in certain circumstances. In particular,
assignments such as `match[1] = ...` or even just `match[1]` would fail
to parse correctly.

Fixing this turned out to be less trivial than anticipated. Consider the
fact that
```
match [1]: case (...)
```
can either look the start of a `match` statement, or it could be a type
ascription, ascribing the value of `case(...)` (a call) to the item at
index 1 of `match`.

To fix this, then, we give `match` the identifier and `match` the
statement the same precendence in the grammar, and additionally also
mark a conflict between `match_statement` and `primary_expression`. This
causes the conflict to be resolved dynamically, and seems to do the
right thing in all cases.
2025-06-26 15:33:00 +00:00