feat: 新增 i32 / u64 / char 类型 + 字符字面量 "'a'"

This commit is contained in:
2026-06-05 20:47:44 +08:00
parent 6fc599e6c2
commit 18172ca724
12 changed files with 146 additions and 16 deletions
+4 -1
View File
@@ -81,9 +81,12 @@ graph TB
| 类型 | 语法 | 示例 |
|------|------|------|
| 32 位有符号整数 | `i32` | `100` |
| 64 位有符号整数 | `i64` | `42`, `-7` |
| 64 位无符号整数 | `u64` | `999` |
| 64 位浮点数 | `f64` | `3.14` |
| 布尔值 | `bool` | `true`, `false` |
| 字符 | `char` | `'A'` |
| 字符串 | `str` | `"hello"` |
| 结构体 | `struct` | `Point { x: i64, y: i64 }` |
| 枚举 | `enum` | `Color { Red, Green, Blue }` |
@@ -92,7 +95,7 @@ graph TB
| 类型别名 | `type` | `type Meters = i64;` |
- `let` 不可变 + `var` 可变,类型推断
- `i64``f64` 自动提升
- `i32``i64``f64` 自动加宽,`char` 可隐式转为整数
### 控制流