changeset 249:a210979cbd5d

runtime_sugar: renaming and cleanup
author Sigurd Meldgaard <stm@daimi.au.dk>
date Wed, 06 Jan 2010 12:19:27 +0100
parents 3f35fc6e5951
children cbee252910f3
files pysmcl/runtime_sugar.py
diffstat 1 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/runtime_sugar.py	Wed Jan 06 12:19:04 2010 +0100
+++ b/pysmcl/runtime_sugar.py	Wed Jan 06 12:19:27 2010 +0100
@@ -48,17 +48,18 @@
                 yield_exp = ast.Yield(value=node)
                 ast.copy_location(yield_exp, node)
                 return yield_exp
-            if(self.is_function(node, "input")):
-                r = ast.Attribute(value=runtime,
-                                  attr="input",
-                                  ctx=ast.Load())
-                ast.copy_location(r, node.func)
-                node.func = r
-                return node
-            if(node.func.id in pysmcl.secret_annotator.annotated_functions):
+            # if(self.is_function(node, "input")):
+            #     r = ast.Attribute(value=runtime,
+            #                       attr="input",
+            #                       ctx=ast.Load())
+            #     ast.copy_location(r, node.func)
+            #     node.func = r
+            #     return node
+            if(node.func.id in pysmcl.secret_annotator.annotated_functions
+               or node.func.id == "input"):
                 node.args.insert(0, runtime)
-                num = ast.copy_location(ast.Num(0), node)
-                slice = ast.copy_location(ast.Index(num), node)
+                # num = ast.copy_location(ast.Num(0), node)
+                # slice = ast.copy_location(ast.Index(num), node)
 #                return ast.copy_location(ast.Subscript(value=node,
 #                                                       slice=slice,
 #                                                       ctx=ast.Load()),node)