mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2024-11-23 05:00:07 +00:00
Ensure no parens on subscript slice
This commit is contained in:
parent
219cb0606a
commit
6f112ec5b2
@ -45,6 +45,9 @@ maxint = sys.maxsize
|
||||
# say to 100, to make sure we avoid additional prenthesis in
|
||||
# call((.. op ..)).
|
||||
|
||||
NO_PARENTHESIS_EVER = 100
|
||||
|
||||
# fmt: off
|
||||
PRECEDENCE = {
|
||||
"named_expr": 40, # :=
|
||||
"yield": 38, # Needs to be below named_expr
|
||||
@ -240,8 +243,19 @@ TABLE_DIRECT = {
|
||||
(0, "expr", PRECEDENCE["subscript"]),
|
||||
(1, "expr"),
|
||||
),
|
||||
"subscript": ("%p[%c]", (0, "expr", PRECEDENCE["subscript"]), (1, "expr")),
|
||||
"subscript2": ("%p[%c]", (0, "expr", PRECEDENCE["subscript"]), (1, "expr")),
|
||||
|
||||
"subscript": (
|
||||
"%p[%p]",
|
||||
(0, "expr", PRECEDENCE["subscript"]),
|
||||
(1, "expr", NO_PARENTHESIS_EVER)
|
||||
),
|
||||
|
||||
"subscript2": (
|
||||
"%p[%p]",
|
||||
(0, "expr", PRECEDENCE["subscript"]),
|
||||
(1, "expr", NO_PARENTHESIS_EVER)
|
||||
),
|
||||
|
||||
"store_subscript": ("%p[%c]", (0, "expr", PRECEDENCE["subscript"]), (1, "expr")),
|
||||
"STORE_FAST": ("%{pattr}",),
|
||||
"STORE_NAME": ("%{pattr}",),
|
||||
|
Loading…
Reference in New Issue
Block a user