mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-109287: Desugar inst(X) to op(X); macro(X) = X (#109294)
This makes the internal representation in the code generator simpler: there's a list of ops, and a list of macros, and there's no special-casing needed for ops that aren't macros. (There's now special-casing for ops that are also macros, but that's simpler.)
This commit is contained in:
parent
47af188593
commit
a7a079798d
5 changed files with 111 additions and 164 deletions
|
@ -53,7 +53,6 @@ class Instruction:
|
|||
|
||||
# Parts of the underlying instruction definition
|
||||
inst: parsing.InstDef
|
||||
kind: typing.Literal["inst", "op"]
|
||||
name: str
|
||||
block: parsing.Block
|
||||
block_text: list[str] # Block.text, less curlies, less PREDICT() calls
|
||||
|
@ -77,7 +76,6 @@ class Instruction:
|
|||
|
||||
def __init__(self, inst: parsing.InstDef):
|
||||
self.inst = inst
|
||||
self.kind = inst.kind
|
||||
self.name = inst.name
|
||||
self.block = inst.block
|
||||
self.block_text, self.check_eval_breaker, self.block_line = extract_block_text(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue