|
8 | 8 | from pathos.pools import ProcessPool # type: ignore
|
9 | 9 | from pyk.cli_utils import dir_path, file_path
|
10 | 10 | from pyk.cterm import CTerm, build_rule
|
11 |
| -from pyk.kast.inner import KApply, KInner, KRewrite, KToken |
12 |
| -from pyk.kast.manip import get_cell, minimize_term, push_down_rewrites |
| 11 | +from pyk.kast.inner import KApply, KInner, KRewrite |
| 12 | +from pyk.kast.manip import minimize_term, push_down_rewrites |
13 | 13 | from pyk.kast.outer import KDefinition, KFlatModule, KImport, KRequire, KRule
|
14 | 14 | from pyk.kcfg import KCFG
|
15 | 15 | from pyk.kcfg_viewer.app import KCFGViewer
|
@@ -428,27 +428,9 @@ def exec_foundry_show(
|
428 | 428 | srcmap_file = srcmap_dir / f'{contract}.json'
|
429 | 429 | foundry = Foundry(definition_dir, profile=profile, use_directory=use_directory, srcmap_file=srcmap_file)
|
430 | 430 |
|
431 |
| - def _node_pretty(_ct: CTerm) -> List[str]: |
432 |
| - k_cell = foundry.pretty_print(get_cell(_ct.config, 'K_CELL')).replace('\n', ' ') |
433 |
| - if len(k_cell) > 80: |
434 |
| - k_cell = k_cell[0:80] + ' ...' |
435 |
| - k_str = f'k: {k_cell}' |
436 |
| - calldepth_str = f'callDepth: {foundry.pretty_print(get_cell(_ct.config, "CALLDEPTH_CELL"))}' |
437 |
| - statuscode_str = f'statusCode: {foundry.pretty_print(get_cell(_ct.config, "STATUSCODE_CELL"))}' |
438 |
| - _pc = get_cell(_ct.config, 'PC_CELL') |
439 |
| - pc_str = f'pc: {foundry.pretty_print(_pc)}' |
440 |
| - ret_strs = [k_str, calldepth_str, statuscode_str, pc_str] |
441 |
| - if type(_pc) is KToken and srcmap is not None: |
442 |
| - pc = int(_pc.token) |
443 |
| - if pc in srcmap: |
444 |
| - ret_strs.append(f'srcmap: {srcmap[pc]}') |
445 |
| - else: |
446 |
| - _LOGGER.warning(f'pc not found in srcmap: {pc}') |
447 |
| - return ret_strs |
448 |
| - |
449 | 431 | with open(kcfg_file, 'r') as kf:
|
450 | 432 | kcfg = KCFG.from_dict(json.loads(kf.read()))
|
451 |
| - list(map(print, kcfg.pretty(foundry, minimize=minimize, node_printer=_node_pretty))) |
| 433 | + list(map(print, kcfg.pretty(foundry, minimize=minimize, node_printer=foundry.short_info))) |
452 | 434 | for node_id in nodes:
|
453 | 435 | kast = kcfg.node(node_id).cterm.kast
|
454 | 436 | if minimize:
|
@@ -549,7 +531,7 @@ def exec_foundry_view_kcfg(foundry_out: Path, test: str, profile: bool, **kwargs
|
549 | 531 | kcfg_file = kcfgs_dir / f'{test}.json'
|
550 | 532 | use_directory.mkdir(parents=True, exist_ok=True)
|
551 | 533 | foundry = Foundry(definition_dir, profile=profile, use_directory=use_directory)
|
552 |
| - viewer = KCFGViewer(kcfg_file, foundry) |
| 534 | + viewer = KCFGViewer(kcfg_file, foundry, node_printer=foundry.short_info) |
553 | 535 | viewer.run()
|
554 | 536 |
|
555 | 537 |
|
|
0 commit comments