修改费用计算代码

This commit is contained in:
chentianrui
2025-08-22 18:13:09 +08:00
parent 8d595b339c
commit be848c3e78
20 changed files with 2569 additions and 360 deletions
@@ -125,7 +125,7 @@ class ExpressionCalculator:
# 处理一元运算符
if token_type == "OPERATOR" and value in ("+", "-"):
self.current_token += 1
node = self.parse_factor()
node = self._parse_factor()
return ("UNARYOP", value, node)
# 处理变量