Add diagnostics spans, CLI/view input feeding, and len/str/int builtins.
Unify bytecode errors with path:line:col, support --stdin-file and live view preset stdin, and ship the S0 standard library with gold coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
31a4b69bbd
commit
30cd39fd8f
25 files changed
+964
-111
No files matched your search
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: 内置 input
|
||||
description: 从 stdin 读一行;可选 prompt。可用 --stdin-file 或 live view 预置输入。
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
CLI 可用管道或 --stdin-file 喂入一行;live marqdo view 在 Execution 区可填预置输入后重跑。静态站点默认无 stdin,会看到 capture 提示。
|
||||
|
||||
*`name` = > input prompt=Name: *
|
||||
|
||||
> print text=Hello `name`!
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: 内置 len / str / int
|
||||
description: 长度与类型转换(S0 最小标准库)
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
len 接受文本(按 Unicode 标量计)或表/列表:
|
||||
|
||||
*`s` = hello*
|
||||
|
||||
*`n` = > len `s`*
|
||||
|
||||
> print text=`n`
|
||||
|
||||
str 把值转成显示文本;int 解析整数(或把 True / False 当成 1 / 0):
|
||||
|
||||
*`t` = > str 7*
|
||||
|
||||
*`i` = > int `t`*
|
||||
|
||||
> print text=`i`
|
||||
Reference in new issue
Block a user