about summary refs log tree commit diff stats
path: root/miasm/core
diff options
context:
space:
mode:
Diffstat (limited to 'miasm/core')
-rw-r--r--miasm/core/cpu.py6
-rw-r--r--miasm/core/graph.py2
-rw-r--r--miasm/core/sembuilder.py4
-rw-r--r--miasm/core/utils.py2
4 files changed, 7 insertions, 7 deletions
diff --git a/miasm/core/cpu.py b/miasm/core/cpu.py
index 7a1cacff..7df9f991 100644
--- a/miasm/core/cpu.py
+++ b/miasm/core/cpu.py
@@ -393,7 +393,7 @@ variable = pyparsing.Word(pyparsing.alphas + "_$.", pyparsing.alphanums + "_")
 variable.setParseAction(cb_parse_id)
 operand = str_int | variable
 
-base_expr = pyparsing.operatorPrecedence(operand,
+base_expr = pyparsing.infixNotation(operand,
                                [(notop,   1, pyparsing.opAssoc.RIGHT, cb_op_not),
                                 (andop, 2, pyparsing.opAssoc.RIGHT, cb_op_and),
                                 (xorop, 2, pyparsing.opAssoc.RIGHT, cb_op_xor),
@@ -408,7 +408,7 @@ default_prio = 0x1337
 
 
 def isbin(s):
-    return re.match('[0-1]+$', s)
+    return re.match(r'[0-1]+$', s)
 
 
 def int2bin(i, l):
@@ -1301,7 +1301,7 @@ class cls_mn(with_metaclass(metamn, object)):
     @classmethod
     def fromstring(cls, text, loc_db, mode = None):
         global total_scans
-        name = re.search('(\S+)', text).groups()
+        name = re.search(r'(\S+)', text).groups()
         if not name:
             raise ValueError('cannot find name', text)
         name = name[0]
diff --git a/miasm/core/graph.py b/miasm/core/graph.py
index 0dfd7e6a..e680894c 100644
--- a/miasm/core/graph.py
+++ b/miasm/core/graph.py
@@ -20,7 +20,7 @@ class DiGraph(object):
         # N -> Nodes N2 with a edge (N2 -> N)
         self._nodes_pred = {}
 
-        self.escape_chars = re.compile('[' + re.escape('{}') + '&|<>' + ']')
+        self.escape_chars = re.compile(r'[\{\}&|<>]')
 
 
     def __repr__(self):
diff --git a/miasm/core/sembuilder.py b/miasm/core/sembuilder.py
index 24470656..9843ee6a 100644
--- a/miasm/core/sembuilder.py
+++ b/miasm/core/sembuilder.py
@@ -22,8 +22,8 @@ class MiasmTransformer(ast.NodeTransformer):
     """
 
     # Parsers
-    parse_integer = re.compile("^i([0-9]+)$")
-    parse_mem = re.compile("^mem([0-9]+)$")
+    parse_integer = re.compile(r"^i([0-9]+)$")
+    parse_mem = re.compile(r"^mem([0-9]+)$")
 
     # Visitors
     def visit_Call(self, node):
diff --git a/miasm/core/utils.py b/miasm/core/utils.py
index 41bf78c1..eb170576 100644
--- a/miasm/core/utils.py
+++ b/miasm/core/utils.py
@@ -26,7 +26,7 @@ COLOR_OP = "black"
 
 COLOR_MNEMO = "blue1"
 
-ESCAPE_CHARS = re.compile('[' + re.escape('{}') + '&|<>' + ']')
+ESCAPE_CHARS = re.compile(r'[\{\}&|<>]')
 
 def set_html_text_color(text, color):
     return '<font color="%s">%s</font>' % (color, text)