🎨 style(syntax): normalize naming conventions
Align all TSL syntax documentation examples with docs/tsl/naming.md: - Classes/types: PascalCase, drop Hungarian prefix (THuman→Human) - Parameters/locals: snake_case with meaningful names (isLeft→is_left, maxb→max_b) - Private members: snake_case_ with trailing underscore (real_part_, imaginary_part_) - Public members: PascalCase (value→Value) - Top-level functions: PascalCase (test→Test) - Module constants: kPascalCase (kernel_dll→kKernelDll) Affected: 01-24 syntax docs (23 files) Verified: 150+ code blocks locally tested, output unchanged Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -100,8 +100,8 @@ writeLn(a);
|
||||
代码块身份:可直接照写示例
|
||||
|
||||
```tsl
|
||||
const value = 1;
|
||||
echo value;
|
||||
const kValue = 1;
|
||||
echo kValue;
|
||||
```
|
||||
|
||||
代码块身份:输出片段
|
||||
@@ -115,8 +115,8 @@ echo value;
|
||||
代码块身份:可直接照写示例
|
||||
|
||||
```tsl
|
||||
const value = 1 + 2 * 3;
|
||||
writeLn(value);
|
||||
const kValue = 1 + 2 * 3;
|
||||
writeLn(kValue);
|
||||
```
|
||||
|
||||
代码块身份:输出片段
|
||||
@@ -146,14 +146,14 @@ unit DemoUnit;
|
||||
|
||||
interface
|
||||
|
||||
const value = 1;
|
||||
const kValue = 1;
|
||||
function GetValue();
|
||||
|
||||
implementation
|
||||
|
||||
function GetValue();
|
||||
begin
|
||||
return value;
|
||||
return kValue;
|
||||
end;
|
||||
|
||||
end.
|
||||
@@ -166,7 +166,7 @@ end.
|
||||
```tsl
|
||||
type DemoType = class
|
||||
public
|
||||
const value = 1;
|
||||
const kValue = 1;
|
||||
end;
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ end;
|
||||
代码块身份:可直接照写示例
|
||||
|
||||
```tsl
|
||||
const max_retries = 3 + 4;
|
||||
value := max_retries;
|
||||
const kMaxRetries = 3 + 4;
|
||||
value := kMaxRetries;
|
||||
```
|
||||
|
||||
### 多参数赋值
|
||||
@@ -311,8 +311,8 @@ end;
|
||||
代码块身份:可直接照写示例
|
||||
|
||||
```tsl
|
||||
const max_retries = 3;
|
||||
counter := max_retries;
|
||||
const kMaxRetries = 3;
|
||||
counter := kMaxRetries;
|
||||
items := array(1, 2, 3);
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user