mirror of
https://github.com/python/cpython.git
synced 2025-12-09 10:37:17 +00:00
GH-98831: Identify instructions that don't use oparg (#100957)
For these the instr_format field uses IX instead of IB. Register instructions use IX, IB, IBBX, IBBB, etc. Also: Include the closing '}' in Block.tokens, for completeness
This commit is contained in:
parent
6bde3d2fd3
commit
5134ef4878
3 changed files with 70 additions and 60 deletions
|
|
@ -338,13 +338,13 @@ class Parser(PLexer):
|
|||
tokens: list[lx.Token] = []
|
||||
level = 0
|
||||
while tkn := self.next(raw=True):
|
||||
tokens.append(tkn)
|
||||
if tkn.kind in (lx.LBRACE, lx.LPAREN, lx.LBRACKET):
|
||||
level += 1
|
||||
elif tkn.kind in (lx.RBRACE, lx.RPAREN, lx.RBRACKET):
|
||||
level -= 1
|
||||
if level <= 0:
|
||||
break
|
||||
tokens.append(tkn)
|
||||
return tokens
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue