Skip to content

Commit 527ed1a

Browse files
committed
fix const wording
1 parent 6a78b62 commit 527ed1a

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

docs/lv4-const-n-var/const.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ int main() {
5353

5454
!> SysY 中 “常量” 的定义和 C 语言中的定义有所区别: SysY 中, 所有的常量必须能在编译时被计算出来; 而 C 语言中的常量仅代表这个量不能被修改.
5555
<br><br>
56-
SysY 中的常量有些类似于 C++ 中的 `consteval`, 或 Rust 中的 `const`.
56+
SysY 中的常量在概念上更接近于 C++ 中的 `constexpr` 或 Rust 中使用 `const` 定义的编译期常量。
5757

5858
## IR 生成
5959

docs/misc-app-ref/sysy-spec.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ const int e[4][2] = {{1, 2}, {3, 4}, {5, 6}, {7, 8}};
180180
181181
!> SysY 中 “常量” 的定义和 C 语言中的定义有所区别: SysY 中, 所有的常量必须能在编译时被计算出来; 而 C 语言中的常量仅代表这个量不能被修改.
182182
<br><br>
183-
SysY 中的常量有些类似于 C++ 中的 `consteval`, 或 Rust 中的 `const`.
183+
SysY 中的常量在概念上更接近于 C++ 中的 `constexpr` 或 Rust 中使用 `const` 定义的编译期常量。
184+
184185
185186
### 变量定义
186187

0 commit comments

Comments
 (0)