mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
GH-120024: Tidy up case generator code a bit. (GH-122780)
This commit is contained in:
parent
0d9c123d1a
commit
81c739e2dc
11 changed files with 175 additions and 103 deletions
|
@ -66,6 +66,7 @@ class Node:
|
|||
assert context is not None
|
||||
return context.owner.tokens[context.begin]
|
||||
|
||||
|
||||
@dataclass
|
||||
class Block(Node):
|
||||
# This just holds a context which has the list of tokens.
|
||||
|
@ -426,7 +427,9 @@ class Parser(PLexer):
|
|||
raise self.make_syntax_error("Expected {")
|
||||
if members := self.members():
|
||||
if self.expect(lx.RBRACE) and self.expect(lx.SEMI):
|
||||
return Pseudo(tkn.text, inp, outp, flags, members)
|
||||
return Pseudo(
|
||||
tkn.text, inp, outp, flags, members
|
||||
)
|
||||
return None
|
||||
|
||||
def members(self) -> list[str] | None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue