You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Double -a option show asm before tokenization
This commit is contained in:
@@ -17,7 +17,7 @@ import datetime
|
||||
import os
|
||||
import py_compile
|
||||
import sys
|
||||
from typing import Any, Tuple
|
||||
from typing import Any, Optional, Tuple
|
||||
|
||||
from xdis import iscode
|
||||
from xdis.load import load_module
|
||||
@@ -50,7 +50,7 @@ def decompile(
|
||||
co,
|
||||
bytecode_version: Tuple[int] = PYTHON_VERSION_TRIPLE,
|
||||
out=sys.stdout,
|
||||
showasm=None,
|
||||
showasm: Optional[str]=None,
|
||||
showast={},
|
||||
timestamp=None,
|
||||
showgrammar=False,
|
||||
@@ -107,14 +107,11 @@ def decompile(
|
||||
if source_size:
|
||||
write("# Size of source mod 2**32: %d bytes" % source_size)
|
||||
|
||||
# maybe a second -a will do before as well
|
||||
asm = "after" if showasm else None
|
||||
|
||||
grammar = dict(PARSER_DEFAULT_DEBUG)
|
||||
if showgrammar:
|
||||
grammar["reduce"] = True
|
||||
|
||||
debug_opts = {"asm": asm, "tree": showast, "grammar": grammar}
|
||||
debug_opts = {"asm": showasm, "tree": showast, "grammar": grammar}
|
||||
|
||||
try:
|
||||
if mapstream:
|
||||
@@ -244,7 +241,7 @@ def main(
|
||||
compiled_files: list,
|
||||
source_files: list,
|
||||
outfile=None,
|
||||
showasm=None,
|
||||
showasm: Optional[str] = None,
|
||||
showast={},
|
||||
do_verify=False,
|
||||
showgrammar=False,
|
||||
|
Reference in New Issue
Block a user