about summary refs log tree commit diff stats
path: root/miasm2/expression/expression.py
diff options
context:
space:
mode:
authorserpilliere <fabrice.desclaux@cea.fr>2015-10-27 23:16:49 +0100
committerserpilliere <fabrice.desclaux@cea.fr>2015-10-28 18:53:31 +0100
commit0e7160cd6b3c5c0a94d1bef53c07d2c7d30cb4f7 (patch)
tree1bd149cc5da8f730f3863c9fc9d087bf8905c5b9 /miasm2/expression/expression.py
parent89b7cc0b3bdcff8ef57dba232c9aae544c3ded35 (diff)
downloadmiasm-0e7160cd6b3c5c0a94d1bef53c07d2c7d30cb4f7.tar.gz
miasm-0e7160cd6b3c5c0a94d1bef53c07d2c7d30cb4f7.zip
Expression: enhance exprop repr
Diffstat (limited to 'miasm2/expression/expression.py')
-rw-r--r--miasm2/expression/expression.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/miasm2/expression/expression.py b/miasm2/expression/expression.py
index 5ceb17d6..f49b31df 100644
--- a/miasm2/expression/expression.py
+++ b/miasm2/expression/expression.py
@@ -793,11 +793,13 @@ class ExprOp(Expr):
     def __str__(self):
         if self.is_associative():
             return '(' + self._op.join([str(arg) for arg in self._args]) + ')'
+        if (self._op.startswith('call_func_') or
+            len(self._args) > 2 or
+            self._op in ['parity', 'segm']):
+            return self._op + '(' + ', '.join([str(arg) for arg in self._args]) + ')'
         if len(self._args) == 2:
             return ('(' + str(self._args[0]) +
                     ' ' + self.op + ' ' + str(self._args[1]) + ')')
-        elif len(self._args) > 2:
-            return self._op + '(' + ', '.join([str(arg) for arg in self._args]) + ')'
         else:
             return reduce(lambda x, y: x + ' ' + str(y),
                           self._args,