🐛 fix(tsl-syntax-reference): route derived rules and bound section size
This commit is contained in:
@@ -121,7 +121,7 @@
|
||||
- 字符串字面量、拼接与文本边界见 [03_values_and_literals.md](03_values_and_literals.md);数组扩展和矩阵样数据见 [11_matrix_and_collections.md](11_matrix_and_collections.md)。
|
||||
- `{$ifdef ...}` 能力探测见 [15_lexical_structure_and_compile_options.md](15_lexical_structure_and_compile_options.md),不要写成普通业务逻辑。
|
||||
|
||||
### 基础赋值和条件求值
|
||||
## 基础赋值和条件求值
|
||||
|
||||
<!-- section-id: syntax-06-006 -->
|
||||
|
||||
@@ -195,6 +195,12 @@ writeLn(a);
|
||||
3
|
||||
```
|
||||
|
||||
## 基础算术与比较
|
||||
|
||||
<!-- section-id: syntax-06-017 -->
|
||||
|
||||
<!-- tags: 基础算术, 基础比较, 点前缀比较, 一元倒数, 加减乘除 -->
|
||||
|
||||
基础算术:
|
||||
|
||||
代码块身份:可直接照写示例
|
||||
@@ -308,6 +314,12 @@ writeLn(dataType(rb));
|
||||
- 整型 `a` 和实型 `b` 都可以用 `!` 求倒数。
|
||||
- 上面两个 `dataType(...)` 都输出 `1`,表示结果是实型。
|
||||
|
||||
## 逻辑与位运算
|
||||
|
||||
<!-- section-id: syntax-06-018 -->
|
||||
|
||||
<!-- tags: and or not, 逻辑门, 按位运算, 移位运算 -->
|
||||
|
||||
逻辑运算:
|
||||
|
||||
代码块身份:可直接照写示例
|
||||
@@ -364,6 +376,12 @@ writeLn(2 ror 1);
|
||||
1
|
||||
```
|
||||
|
||||
## 复合赋值与字符串运算
|
||||
|
||||
<!-- section-id: syntax-06-019 -->
|
||||
|
||||
<!-- tags: 复合赋值, 字符串运算, 字符串连接, like 正则, 原地更新 -->
|
||||
|
||||
基础算术复合赋值:
|
||||
|
||||
代码块身份:可直接照写示例
|
||||
@@ -513,6 +531,12 @@ writeLn("abc" like "a%");
|
||||
|
||||
因此 `like` 更接近“正则匹配”,不是 SQL 那套 `%` / `_` 通配语义。
|
||||
|
||||
## 自增、自减与 if 表达式
|
||||
|
||||
<!-- section-id: syntax-06-020 -->
|
||||
|
||||
<!-- tags: 自增, 自减, 前置自增, 前置自减, if 表达式 -->
|
||||
|
||||
自增与自减:
|
||||
|
||||
代码块身份:可直接照写示例
|
||||
@@ -567,7 +591,7 @@ writeLn(if 2 > 1 then 2 else 1);
|
||||
|
||||
`if condition then true_value else false_value` 必须带 `else`,否则不是本页可照写的表达式形态。
|
||||
|
||||
### 运算符优先级
|
||||
## 运算符优先级
|
||||
|
||||
<!-- section-id: syntax-06-015 -->
|
||||
|
||||
@@ -614,7 +638,7 @@ writeLn(flag);
|
||||
|
||||
稀有矩阵运算符的详细优先级以其专题页为准;不要用本表外推尚未写入正式文档的符号。
|
||||
|
||||
### 静态计算表达式 `static`
|
||||
## 静态计算表达式 `static`
|
||||
|
||||
<!-- section-id: syntax-06-016 -->
|
||||
|
||||
@@ -674,7 +698,7 @@ end;
|
||||
|
||||
这不是类成员的 `static` 字段;类静态成员见 [08_objects_and_classes.md](08_objects_and_classes.md)。缓存结果具有运行时状态,不要用它保存每次调用都必须重新计算的值。
|
||||
|
||||
### 表达式对象
|
||||
## 表达式对象
|
||||
|
||||
<!-- section-id: syntax-06-007 -->
|
||||
|
||||
@@ -756,7 +780,7 @@ writeLn(result_value);
|
||||
|
||||
逗号表达式本身可以作为一个普通子表达式继续参与后续运算。
|
||||
|
||||
### 空安全访问
|
||||
## 空安全访问
|
||||
|
||||
<!-- section-id: syntax-06-008 -->
|
||||
|
||||
@@ -803,7 +827,7 @@ writeLn(c?.a?.[1] = nil);
|
||||
|
||||
不要从这一段外推成所有深度、所有成员/下标组合都可写。
|
||||
|
||||
### 否定形式运算
|
||||
## 否定形式运算
|
||||
|
||||
<!-- section-id: syntax-06-009 -->
|
||||
|
||||
@@ -833,7 +857,7 @@ end;
|
||||
1
|
||||
```
|
||||
|
||||
### 标量链式比较
|
||||
## 标量链式比较
|
||||
|
||||
<!-- section-id: syntax-06-010 -->
|
||||
|
||||
@@ -861,7 +885,7 @@ writeLn(1 :<> 2 :<> 3);
|
||||
1
|
||||
```
|
||||
|
||||
### 矩阵链式比较
|
||||
## 矩阵链式比较
|
||||
|
||||
<!-- section-id: syntax-06-011 -->
|
||||
|
||||
@@ -893,7 +917,7 @@ writeLn(s[2]);
|
||||
|
||||
矩阵链式比较会按元素位置分别得到结果数组,并且可以和标量混用。
|
||||
|
||||
### 条件编译探测
|
||||
## 条件编译探测
|
||||
|
||||
<!-- section-id: syntax-06-012 -->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user