Python: Allow except* to be written as except *

Turns out, `except*` is actually not a token on its own according to the
Python grammar. This means it's legal to write `except *foo: ...`, which
we previously would consider a syntax error.

To fix it, we simply break up the `except*` into two separate tokens.
This commit is contained in:
Taus
2024-10-22 15:39:29 +00:00
parent 7ceefb509b
commit 9c913902c5
3 changed files with 28 additions and 2 deletions

View File

@@ -309,7 +309,8 @@ module.exports = grammar({
),
except_group_clause: $ => seq(
'except*',
'except',
'*',
seq(
field('type', $.expression),
optional(seq(