changeset 105:47d11f038cd4

Better wrapping of long string literals.
author Martin Geisler <mg@lazybytes.net>
date Fri, 17 Jul 2009 11:49:37 +0200
parents 874e71d7aa8c
children ee8991b037b9
files pysmcl/bad_calls.py pysmcl/secret_ifs.py
diffstat 2 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/bad_calls.py	Fri Jul 10 13:25:40 2009 +0200
+++ b/pysmcl/bad_calls.py	Fri Jul 17 11:49:37 2009 +0200
@@ -10,10 +10,10 @@
         if(isinstance(node, ast.Call)):
             if(not isinstance(node.func, ast.Name)):
                 if(any([expr_secret(i, e) for i in node.args])):
-                    util.error("Call of non-fixed function \
-with secret argument", node)
+                    util.error("Call of non-fixed function "
+                               "with secret argument", node)
             elif(node.func.id in non_compromising_functions):
                 return
             elif(any([expr_secret(i, e) for i in node.args])):
-                util.error("Call of non-secret\
-function with secret argument", node)
+                util.error("Call of non-secret "
+                           "function with secret argument", node)
--- a/pysmcl/secret_ifs.py	Fri Jul 10 13:25:40 2009 +0200
+++ b/pysmcl/secret_ifs.py	Fri Jul 17 11:49:37 2009 +0200
@@ -19,7 +19,7 @@
     def visit_Assign(self, node):
         varname = node.targets[0].id
         if varname in self.assigned:
-            error("Error: cannot assign several times"+
+            error("Error: cannot assign several times "
                   "to \"%s\" in a secret if" % varname, node)
         ## TODO only single-target assignment
         self.assigned[varname] = node.value
@@ -35,10 +35,9 @@
     for i in body:
         if not (isinstance(i, ast.Assign) or
                 isinstance(i, ast.Pass)):
-            error("Error,\
- inside secret if statements, we only allow \
-assignments, but found a %s." % type(i),
-                  i)
+            error("Error, "
+                  "inside secret if statements, we only allow "
+                  "assignments, but found a %s." % type(i), i)
 
 
 class TransformIfs(ast.NodeTransformer):