changeset 142:4e35d7cf4fe8

Info: moved
author Sigurd Meldgaard <stm@daimi.au.dk>
date Mon, 09 Nov 2009 10:49:45 +0100
parents 63c8b9645058
children f13a89c1a888
files pysmcl/editor_info.py pysmcl/emacs/info.py
diffstat 2 files changed, 29 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pysmcl/editor_info.py	Mon Nov 09 10:49:45 2009 +0100
@@ -0,0 +1,29 @@
+import pysmcl.ast_wrapper as ast
+import sys
+from pysmcl.secret_annotator import secret_analysis, expr_secret
+from pysmcl.pretty_print import  expr_string
+import StringIO
+
+
+def main():
+    try:
+        module = ast.parse(file(sys.argv[1]).read())
+    except SyntaxError:
+        exit(2)  # Exit code signalling syntax error.
+    for i in prog.body:
+        if isinstance(i, ast.FunctionDef):
+            secret_analysis(i)
+    for i in prog.body:
+        if(isinstance(i, ast.FunctionDef) and
+           any([decorator.id == 'ideal_functionality' for decorator in i.decorator_list])):
+            for j in ast.walk(i):
+                if isinstance(j, ast.stmt):
+                    e = j.out_values["secret"]
+                if isinstance(j, ast.expr):
+                    if expr_secret(j, e):
+                        output = StringIO.StringIO()
+                        print "%d %d %d" % (j.lineno, j.col_offset,
+                                              len(expr_string(j)))
+
+if __name__ == "__main__":
+    main()
--- a/pysmcl/emacs/info.py	Mon Nov 09 10:48:21 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-import pysmcl.ast_wrapper as ast
-import sys
-from pysmcl.secret_annotator import secret_analysis, expr_secret
-from pysmcl.pretty_print import  expr_string
-import StringIO
-
-
-def main():
-    try:
-        module = ast.parse(file(sys.argv[1]).read())
-    except SyntaxError:
-        exit(2)  # Exit code signalling syntax error.
-    for i in prog.body:
-        if isinstance(i, ast.FunctionDef):
-            secret_analysis(i)
-    for i in prog.body:
-        if(isinstance(i, ast.FunctionDef) and
-           any([decorator.id == 'ideal_functionality' for decorator in i.decorator_list])):
-            for j in ast.walk(i):
-                if isinstance(j, ast.stmt):
-                    e = j.out_values["secret"]
-                if isinstance(j, ast.expr):
-                    if expr_secret(j, e):
-                        output = StringIO.StringIO()
-                        print "%d %d %d" % (j.lineno, j.col_offset,
-                                              len(expr_string(j)))
-
-if __name__ == "__main__":
-    main()