📝 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:
@@ -0,0 +1,72 @@
|
||||
# 系统相关函数 - 表达式相关函数
|
||||
|
||||
文档类型:函数事实页
|
||||
是否可直接用于生成代码:是;本页函数条目均包含参数表
|
||||
遇到不确定时:回到 [../system.md](../system.md)、[../../index.md](../../index.md)
|
||||
|
||||
## 表达式相关函数
|
||||
|
||||
### `eval(expr)`
|
||||
|
||||
用途:计算表达式或表达式字符串并返回结果。
|
||||
|
||||
参数个数:1
|
||||
返回值:表达式计算结果
|
||||
|
||||
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
|
||||
| -------- | ------ | ---- | -------- | ------------------------------ |
|
||||
| 1 | `expr` | 是 | 字符串 | 表达式(@)或表达式字符串(&) |
|
||||
|
||||
### `call(func, args)`
|
||||
|
||||
用途:按函数名字符串或函数指针调用函数。
|
||||
|
||||
参数个数:2
|
||||
返回值:函数返回值
|
||||
|
||||
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
|
||||
| -------- | ------ | ---- | -------- | ---------------------- |
|
||||
| 1 | `func` | 是 | 字符串 | 函数名字符串或函数指针 |
|
||||
| 2 | `args` | 是 | 整数 | 调用参数列表 |
|
||||
|
||||
### `callInArray(func, args)`
|
||||
|
||||
用途:以参数数组调用指定函数(含函数名或函数变量)。
|
||||
|
||||
参数个数:2
|
||||
返回值:函数调用结果
|
||||
|
||||
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
|
||||
| -------- | ------ | ---- | -------- | ---------------------- |
|
||||
| 1 | `func` | 是 | 字符串 | 函数名字符串或函数指针 |
|
||||
| 2 | `args` | 是 | 数组 | 参数数组 |
|
||||
|
||||
### `invoke(obj, name, mode, args[, arg5][, arg6])`
|
||||
|
||||
用途:调用对象成员方法或设置成员属性。
|
||||
|
||||
参数个数:4 到 6
|
||||
返回值:调用结果或设置结果
|
||||
|
||||
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
|
||||
| -------- | ------ | ---- | ----------- | ---------------------- |
|
||||
| 1 | `obj` | 是 | 任意值 | 目标对象 |
|
||||
| 2 | `name` | 是 | 字符串 | 成员名 |
|
||||
| 3 | `mode` | 是 | 整数 | 0 调用方法;1 设置成员 |
|
||||
| 4 | `args` | 是 | 字符串/整数 | 方法参数或设置值 |
|
||||
| 5 | `arg5` | 否 | 字符串 | 按源文档示例顺序传入 |
|
||||
| 6 | `arg6` | 否 | 字符串 | 按源文档示例顺序传入 |
|
||||
|
||||
### `invokeinarray(obj, name, mode, args)`
|
||||
|
||||
用途:以参数数组调用对象成员方法或设置成员属性。
|
||||
|
||||
参数个数:4
|
||||
返回值:调用结果或设置结果
|
||||
|
||||
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
|
||||
| -------- | ------ | ---- | -------- | ---------------------- |
|
||||
| 1 | `obj` | 是 | 任意值 | 目标对象 |
|
||||
| 2 | `name` | 是 | 字符串 | 成员名 |
|
||||
| 3 | `mode` | 是 | 整数 | 0 调用方法;1 设置成员 |
|
||||
| 4 | `args` | 是 | 数组 | 参数数组 |
|
||||
Reference in New Issue
Block a user