mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
GH-128682: Spill the stack pointer in labels, as well as instructions (GH-129618)
This commit is contained in:
parent
d3c54f3788
commit
2effea4dab
15 changed files with 277 additions and 102 deletions
|
@ -153,6 +153,7 @@ class Pseudo(Node):
|
|||
@dataclass
|
||||
class LabelDef(Node):
|
||||
name: str
|
||||
spilled: bool
|
||||
block: Block
|
||||
|
||||
|
||||
|
@ -176,12 +177,15 @@ class Parser(PLexer):
|
|||
|
||||
@contextual
|
||||
def label_def(self) -> LabelDef | None:
|
||||
spilled = False
|
||||
if self.expect(lx.SPILLED):
|
||||
spilled = True
|
||||
if self.expect(lx.LABEL):
|
||||
if self.expect(lx.LPAREN):
|
||||
if tkn := self.expect(lx.IDENTIFIER):
|
||||
if self.expect(lx.RPAREN):
|
||||
if block := self.block():
|
||||
return LabelDef(tkn.text, block)
|
||||
return LabelDef(tkn.text, spilled, block)
|
||||
return None
|
||||
|
||||
@contextual
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue