Skip to content

Commit 4033f2e

Browse files
committed
Add several debugging prints, triggerable by verbose command line option
1 parent e19770c commit 4033f2e

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

pythonect/internal/eval.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ def parse(source):
724724

725725
for ext, parser in parsers.get_parsers(os.path.abspath(os.path.join(os.path.dirname(parsers.__file__), '..', 'parsers'))).items():
726726

727-
logging.debug('Trying to parse with %s' % parser)
727+
logging.debug('Trying to parse %s with %s' % (source, parser))
728728

729729
tmp_graph = parser.parse(source)
730730

@@ -763,6 +763,8 @@ def eval(source, globals_={}, locals_={}):
763763

764764
if source != "pass":
765765

766+
logging.info('Program is meaningful')
767+
766768
return_value = []
767769

768770
return_values = []
@@ -775,12 +777,18 @@ def eval(source, globals_={}, locals_={}):
775777

776778
reduces = {}
777779

778-
if not isinstance(source, (networkx.DiGraph, _graph.Graph)):
780+
logging.debug('Evaluating %s with globals_ = %s and locals_ %s' % (source, globals_, locals_))
781+
782+
if not isinstance(source, networkx.DiGraph):
783+
784+
logging.info('Parsing program...')
779785

780786
graph = parse(source)
781787

782788
else:
783789

790+
logging.info('Program is already parsed! Using source AS IS')
791+
784792
graph = source
785793

786794
root_nodes = sorted([node for node, degree in graph.in_degree().items() if degree == 0])

0 commit comments

Comments
 (0)