changeset 242:c452e05a342c

editor_info: refactor Used a Python idiom for emulation a do_while loop.
author Sigurd Meldgaard <stm@daimi.au.dk>
date Tue, 05 Jan 2010 14:44:23 +0100
parents e70d728fdc13
children d6200b882b17 2ec1672bb6be
files pysmcl/editor_info.py
diffstat 1 files changed, 5 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/editor_info.py	Tue Jan 05 14:43:30 2010 +0100
+++ b/pysmcl/editor_info.py	Tue Jan 05 14:44:23 2010 +0100
@@ -21,17 +21,13 @@
             decorator = ast.get_ideal_functionality(i)
             if decorator is None:
                 continue
-            secret_analysis(i)
-
-            RangeAnalysis(pysmcl.setup.Zp.modulus).apply(i, {})
-
-            transform_ifs = secret_ifs.TransformIfs()
-            i = transform_ifs.visit(i)
-            while transform_ifs.changed:
+            while True:
                 secret_analysis(i)
-                RangeAnalysis(pysmcl.setup.Zp.modulus).apply(i, {})
-                transform_ifs.reset()
+                RangeAnalysis().apply(i, {})
+                transform_ifs = secret_ifs.TransformIfs()
                 i = transform_ifs.visit(i)
+                if not transform_ifs.changed:
+                    break
             secret_analysis(i)
             bad_calls(i)
             func_string = pp.pprint_string(i)