disassemble -> ingest where appropriate

As part of tokenization for (de)parsing, we need to do something like a
disassembly, but is is really a little different.

Disassembly, strictly speaking, is done by the xdis module now.
What "ingestion" does is massage the instruction tokens to a form that is
more amenable for parsing.

In sum, ingestion is different than disassembly, although disassembly is
generally the first part of ingestion.
This commit is contained in:
rocky
2016-09-04 11:43:02 -04:00
parent 979bca4fe0
commit c7788e4545
19 changed files with 37 additions and 43 deletions

View File

@@ -229,10 +229,10 @@ def cmp_code_objects(version, is_pypy, code_obj1, code_obj2,
# which would get confusing.
scanner.setTokenClass(Token)
try:
# disassemble both code-objects
tokens1, customize = scanner.disassemble(code_obj1)
# ingest both code-objects
tokens1, customize = scanner.ingest(code_obj1)
del customize # save memory
tokens2, customize = scanner.disassemble(code_obj2)
tokens2, customize = scanner.ingest(code_obj2)
del customize # save memory
finally:
scanner.resetTokenClass() # restore Token class