📝 docs(tsl): clarify syntax constraints and enhance test infrastructure
- Add TSF file naming constraint to syntax/02_core_model.md - Clarify semicolon rules: syntax facts vs style preferences - Separate control flow end semicolon rules (syntax allows both) - Add function body semicolon requirements to syntax/05_functions_and_calls.md - Move style preferences to code_style.md (control flow end semicolons) - Remove cross-references from syntax docs to maintain independence - Enhance Gitea workflow emoji for better CI output readability - Fix CI test path from tests/ to test/ - Organize agent test results under test/agent/result/ directory - Add complete Chinese translation of test cases (test_cases_zh.md) - Clean up .gitignore to use unified test/agent/result/ directory - Remove obsolete agent test artifacts (REPORTS_LOCATION.md, old results) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -35,6 +35,9 @@
|
||||
- `unit` 默认先按完整形态理解;它也可以省略 `interface` / `implementation` 写成简写形态,见 [09_units_and_scope.md](09_units_and_scope.md)。
|
||||
- 不要把 `.tsl` 写成只有顶层函数的模块;如果用户要通用可复用函数,优先写 `.tsf`。
|
||||
- 不要把 `.tsf` 写成会直接执行脚本语句的入口;如果用户要顺序执行入口,优先写 `.tsl`。
|
||||
- `.tsf` 文件名(不含扩展名)必须与第一个顶层声明同名:
|
||||
- `UserAccount.tsf` 中的顶层声明必须是 `function UserAccount` 或 `type UserAccount = class` 或 `unit UserAccount`。
|
||||
- TSL 语言大小写无关,因此 `userAccount.tsf` 和 `UserAccount.tsf` 在语法层面都合法。
|
||||
|
||||
## 文件模型示例
|
||||
|
||||
@@ -188,3 +191,4 @@ invalid statement
|
||||
- 把 `.tsf` 顶层类声明写成裸 `class Name ... end;`;类声明必须使用 `type Name = class ... end;`。
|
||||
- 把 `uses` 当成主体声明,而不是辅助组织语句。
|
||||
- 在 `.tsl` 声明区之后继续追加脚本语句。
|
||||
- `.tsf` 文件名与顶层声明不一致:`UserAccount.tsf` 中写 `function GetUser` 或 `type Customer = class` 或 `unit CustomerModule` 会导致加载失败或检索混乱。
|
||||
|
||||
Reference in New Issue
Block a user