about summary refs log tree commit diff stats
path: root/example/expression/simplification_tools.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2019-02-25 11:09:54 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2019-03-05 16:52:49 +0100
commit02bbb30efea4980c9d133947cbbf69fb599071ad (patch)
tree3fea6826fcc5354840a27cb1dc99ff31eef81896 /example/expression/simplification_tools.py
parenteab809932871f91d6f4aa770fc321af9e156e0f5 (diff)
downloadfocaccia-miasm-02bbb30efea4980c9d133947cbbf69fb599071ad.tar.gz
focaccia-miasm-02bbb30efea4980c9d133947cbbf69fb599071ad.zip
Support python2/python3
Diffstat (limited to 'example/expression/simplification_tools.py')
-rw-r--r--example/expression/simplification_tools.py35
1 files changed, 18 insertions, 17 deletions
diff --git a/example/expression/simplification_tools.py b/example/expression/simplification_tools.py
index cb062fb3..a9bcc429 100644
--- a/example/expression/simplification_tools.py
+++ b/example/expression/simplification_tools.py
@@ -1,10 +1,11 @@
+from __future__ import print_function
 from miasm2.expression.expression import *
 from pdb import pm
 
-print """
+print("""
 Expression simplification demo.
 (and regression test)
-"""
+""")
 
 
 a = ExprId('a', 32)
@@ -39,26 +40,26 @@ def replace_expr(e):
     return e
 
 
-print x
+print(x)
 y = x.visit(replace_expr)
-print y
-print x.copy()
-print y.copy()
-print y == y.copy()
-print repr(y), repr(y.copy())
+print(y)
+print(x.copy())
+print(y.copy())
+print(y == y.copy())
+print(repr(y), repr(y.copy()))
 
 
 z = ExprCompose(a[5:5 + 8], b[:16], x[:8])
-print z
-print z.copy()
-print z[:31].copy().visit(replace_expr)
+print(z)
+print(z.copy())
+print(z[:31].copy().visit(replace_expr))
 
-print 'replace'
-print x.replace_expr({c + ExprInt(0x42, 32): d,
-                      a + b: c, })
-print z.replace_expr({c + ExprInt(0x42, 32): d,
-                      a + b: c, })
+print('replace')
+print(x.replace_expr({c + ExprInt(0x42, 32): d,
+                      a + b: c, }))
+print(z.replace_expr({c + ExprInt(0x42, 32): d,
+                      a + b: c, }))
 
 
 u = z.copy()
-print u
+print(u)