summaryrefslogtreecommitdiff
path: root/gerbonara/aperture_macros/expression.py
diff options
context:
space:
mode:
Diffstat (limited to 'gerbonara/aperture_macros/expression.py')
-rw-r--r--gerbonara/aperture_macros/expression.py20
1 files changed, 0 insertions, 20 deletions
diff --git a/gerbonara/aperture_macros/expression.py b/gerbonara/aperture_macros/expression.py
index c9c0470..7c291cb 100644
--- a/gerbonara/aperture_macros/expression.py
+++ b/gerbonara/aperture_macros/expression.py
@@ -31,9 +31,6 @@ class Expression:
def converted(self, unit):
return self
- def replace_mixed_subexpressions(self, unit):
- return self
-
def calculate(self, variable_binding={}, unit=None):
expr = self.converted(unit).optimized(variable_binding)
if not isinstance(expr, ConstantExpression):
@@ -104,9 +101,6 @@ class UnitExpression(Expression):
def __repr__(self):
return f'<UE {self.expr.to_gerber()} {self.unit}>'
- def replace_mixed_subexpressions(self, unit):
- return self.converted(unit).replace_mixed_subexpressions(unit)
-
def converted(self, unit):
if self.unit is None or unit is None or self.unit == unit:
return self.expr
@@ -198,9 +192,6 @@ class VariableExpression(Expression):
def __eq__(self, other):
return type(self) == type(other) and self.expr == other.expr
- def replace_mixed_subexpressions(self, unit):
- return VariableExpression(self.expr.replace_mixed_subexpressions(unit))
-
def to_gerber(self, register_variable=None, unit=None):
if register_variable is None:
return self.expr.to_gerber(None, unit)
@@ -356,17 +347,6 @@ class OperatorExpression(Expression):
return expr(rv).optimized(variable_binding)
- def replace_mixed_subexpressions(self, unit):
- l = self.l.replace_mixed_subexpressions(unit)
- if l._operator not in (None, self.op):
- l = VariableExpression(self.l)
-
- r = self.r.replace_mixed_subexpressions(unit)
- if r._operator not in (None, self.op):
- r = VariableExpression(self.r)
-
- return OperatorExpression(self.op, l, r)
-
def to_gerber(self, register_variable=None, unit=None):
lval = self.l.to_gerber(register_variable, unit)
rval = self.r.to_gerber(register_variable, unit)