This commit is contained in:
Andrej730
2026-02-27 11:15:30 +05:00
parent 8834a51122
commit 92c979fbbf
27 changed files with 121 additions and 271 deletions
@@ -352,8 +352,7 @@ def get_cost_rate(
class CostValueUnserialiser:
def parse(self, formula: str):
l = lark.Lark(
"""start: formula
l = lark.Lark("""start: formula
formula: operand (operator operand)*
operand: value | category "(" formula ")"
value: NUMBER?
@@ -390,8 +389,7 @@ class CostValueUnserialiser:
NEWLINE: (CR? LF)+
%ignore WS // Disregard spaces in text
"""
)
""")
start = l.parse(formula)
return self.get_formula(start.children[0])