feat: add AST checker engine framework with 9 Phase 1 engines

This commit is contained in:
2026-05-25 20:39:31 -06:00
parent c36e6623bd
commit 811b065e05
7 changed files with 169 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
from .base import BaseEngine
class MustUseOperatorEngine(BaseEngine):
def check(self, tree, rule, language, mapping):
target = rule["target"]
mapped_op = mapping.get(target, target)
if not self.has_node(tree.root_node, mapped_op):
return [rule.get("message", f"必须使用 {target} 运算符")]
return []