Commit 2053e80d authored by Maxime Perrotin's avatar Maxime Perrotin

In progress: refactor range computation

parent c8f72edb
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
""" """
import logging import logging
import operator
from collections import defaultdict from collections import defaultdict
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
...@@ -67,14 +68,17 @@ class Expression(object): ...@@ -67,14 +68,17 @@ class Expression(object):
class ExprPlus(Expression): class ExprPlus(Expression):
operand = '+' operand = '+'
op = operator.add
class ExprMul(Expression): class ExprMul(Expression):
operand = '*' operand = '*'
op = operator.mul
class ExprMinus(Expression): class ExprMinus(Expression):
operand = '-' operand = '-'
op = operator.sub
class ExprOr(Expression): class ExprOr(Expression):
...@@ -120,14 +124,17 @@ class ExprLe(Expression): ...@@ -120,14 +124,17 @@ class ExprLe(Expression):
class ExprDiv(Expression): class ExprDiv(Expression):
operand = '/' operand = '/'
op = operator.div
class ExprMod(Expression): class ExprMod(Expression):
operand = 'mod' operand = 'mod'
op = operator.mod
class ExprRem(Expression): class ExprRem(Expression):
operand = 'rem' operand = 'rem'
op = operator.mod
class ExprNot(Expression): class ExprNot(Expression):
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment