上传代码

This commit is contained in:
chentianrui
2025-09-08 17:58:02 +08:00
parent be848c3e78
commit f5f26c5cf8
76 changed files with 839039 additions and 2695 deletions
@@ -14,7 +14,7 @@ class ExpressionCalculator:
"""将表达式字符串分解为标记列表"""
token_spec = [
("NUMBER", r"\d+(\.\d*)?"), # 整数或小数
("VARIABLE", r"@?[a-zA-Z_\u4e00-\u9fa5][\w.@\u4e00-\u9fa5]+"), # 支持带点的复合变量
("VARIABLE", r"@?[a-zA-Z_\u4e00-\u9fa5][\w.@\u4e00-\u9fa5]*"), # 支持带点的复合变量,允许单字符变量
("OPERATOR", r"[+\-*/()]"), # 运算符
("SKIP", r"\s+"), # 跳过空格
("MISMATCH", r"."), # 其他字符