changeset 207:caf5c50b89d0

editor_info: reporting bad calls and syntax errors.
author Sigurd Meldgaard <stm@daimi.au.dk>
date Mon, 21 Dec 2009 12:01:00 +0100
parents 43ad3e80db15
children 87a8f29541b5
files pysmcl/editor_info.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/editor_info.py	Mon Dec 21 11:59:25 2009 +0100
+++ b/pysmcl/editor_info.py	Mon Dec 21 12:01:00 2009 +0100
@@ -6,12 +6,15 @@
 from pysmcl.range_analysis import RangeAnalysis
 from pysmcl.secret_annotator import secret_analysis, expr_secret
 import pysmcl.secret_ifs as secret_ifs
+from pysmcl.util import error
+from pysmcl.bad_calls import bad_calls
 
 
 def main():
     try:
         prog = ast.parse(file(sys.argv[1]).read())
-    except SyntaxError:
+    except SyntaxError as e:
+        error(e.msg)
         exit(2)  # Exit code signalling syntax error.
     for i in prog.body:
         if isinstance(i, ast.FunctionDef):
@@ -30,6 +33,7 @@
                 transform_ifs.reset()
                 i = transform_ifs.visit(i)
             secret_analysis(i)
+            bad_calls(i)
             func_string = pp.pprint_string(i)
             print "!transformed: %d %d %d (%s)" % (i.lineno, i.col_offset,
                                                 len(i.name), func_string)