fix(语法要求): 「自定义函数」不再把 main 算进去,运算符不再把取地址、指针、模板尖括号当成用了
Deploy / deploy (push) Successful in 55s

- C / C++ 的函数定义排掉 main,下拉改叫「自定义函数」。原来「必须使用」永远通过、「不能使用」永远失败,
  出题页挑战候选里 C 的「用自定义函数再写一遍」也因此一直挖不出来
- 运算符只认二元运算 / 复合赋值 / 自增自减里的 token,一元只认取反。scanf 的 &、int *p、vector<int>、
  *args、import *、**kw、not in、is not、case 1 | 2 不再算「用了」
- Python 的 math.sqrt(4) 算调用了 sqrt()(只认 import 进来的模块)
- Python 的「赋值语句」连 s += 1 一起算,和 C 一个口径
- 保存时拦下负数次数、至少比至多还多的次数规则

现有 19 道题的规则都不受影响:1265 条真实提交重判,结论和改之前一致。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-11-03 13:29:57 +08:00
1 parent 1b730da401
commit 55bdf317f1
3 files changed
+118 -18

No files matched your search

+2 -1
View File
@@ -145,7 +145,8 @@ const C_NODE_TARGETS = {
break: { label: 'break 语句', node: 'break_statement' },
continue: { label: 'continue 语句', node: 'continue_statement' },
return: { label: 'return 语句', node: 'return_statement' },
function_definition: { label: '函数定义', node: 'function_definition' },
// 不算 main(判题机 judge/ast.ts 的 nodeMatch 里排掉的),所以不叫「函数定义」
function_definition: { label: '自定义函数', node: 'function_definition' },
assignment: { label: '赋值语句', node: 'assignment_expression' },
struct: { label: '结构体', node: 'struct_specifier' },
include: { label: '#include 指令', node: 'preproc_include' },