Add deparsed_find() used by the trepan debuggers

This commit is contained in:
rocky
2018-02-15 10:42:00 -05:00
parent b5a825f4d8
commit 083ae5f3fd
2 changed files with 56 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
import pytest
from uncompyle6.semantics.fragments import deparse_code as deparse
from uncompyle6.semantics.fragments import deparse_code as deparse, deparsed_find
from uncompyle6 import PYTHON_VERSION, PYTHON3
def map_stmts(x, y):
@@ -42,6 +42,7 @@ def check_expect(expect, parsed, fn_name):
"%s: ran out if items in testing node" % fn_name)
nodeInfo = parsed.offsets[name, offset]
node = nodeInfo.node
nodeInfo2 = deparsed_find((name, offset), parsed, code)
extractInfo = parsed.extract_node_info(node)
assert expect[i] == extractInfo.selectedLine, \