playbook/codex/skills/tsl-guide/references/functions_index.md

68 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# TSL 函数库分类索引
> **说明**:本文档是 `$tsl-guide` 的子文档,仅提供分类索引与检索策略。
> **权威入口**`docs/tsl/syntax_book/function/tsl/index.md`
> **注意**:函数库已拆分为 `docs/tsl/syntax_book/function/` 多文件,禁止整目录加载。
## 使用方法
1. 先在 `function/tsl/index.md` 找到所属类别
2. 进入对应子文件(如 `base.md` / `math.md` / `resource.md`
3.`rg` 精确定位函数定义片段≤100 行)
### 推荐搜索方式
```bash
# 先读索引
sed -n '1,120p' docs/tsl/syntax_book/function/tsl/index.md
# 精确定位某个函数
rg -n "^#######\s+Trim" docs/tsl/syntax_book/function/tsl/base.md
# 模糊搜索关键词
rg -n "date|time" docs/tsl/syntax_book/function/tsl/base.md
```
---
## 常用分类(来自 `function/tsl/index.md`
### 数学与计算math.md
- 常见函数示例Abs, Sqrt, Sin, Cos, Log, Exp, Round...
### 字符串处理base.md
- 常见函数示例Len, Mid, Left, Right, Trim, Replace...
### 日期时间base.md
- 常见函数示例Now, Date, Time, DateAdd, DateDiff...
### 文件操作resource.md
- 常见函数示例FileExists, ReadFile, WriteFile...
### 数组操作base.md
- 常见函数示例Array, UBound, LBound, Sort...
### 类型转换base.md
- 常见函数示例CStr, CInt, CFloat, CBool...
---
## 进一步建议
- 优先用索引确定范围,再定位到具体函数定义
- 只读取相关片段,避免加载大段内容
- 若函数名不确定,用关键词在对应分类文件中搜索
---
## 金融函数(独立分类)
- 权威入口:`docs/tsl/syntax_book/function/financial/index.md`
- 适用范围:行情、财务、技术分析等金融领域函数(与通用字符串/数学函数分开检索)