fix: make View fixtures run from the standalone beta archive

This commit is contained in:
cflmy committed 2026-11-22 21:28:55 +08:00
1 parent ce0efe5fc2
commit 34de5a34d9
10 files changed
+640 -21484

No files matched your search

+13 -3
View File
@@ -1,6 +1,6 @@
# @knowledge 控制流演示
下面的函数没有任何必需参数,因此可以在 `pure` 模式下显式运行并产生真实 Trace。
下面的函数可以在 `pure` 模式显式运行并产生真实 Trace。示例把 ASCII 数字和换行写入标准输出资源。
# @exec 演示
@@ -8,20 +8,30 @@
`x = 0`
`buffer = memory.new(1, 1)`
`buffer[1] = 10`
`stdout = resource.open("stdio", "stdout", ["write"])`
**while x < 3**
**if x > 1**
**print(x)**
`buffer[0] = 48 + x`
**else**
**print(0)**
`buffer[0] = 48`
**end**
`resource.write(stdout, buffer, 0, 2)`
**x = x + 1**
**end**
`resource.close(stdout)`
`return 3`