diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-02-03 22:42:37 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-02-03 22:42:37 +0800 |
| commit | e4f8d1b3b075323968bb6dc334226dff33c0a2b0 (patch) | |
| tree | 657e1ac82e54b91014dc12d15e90329bf66f9d0f /doc/docs/zh | |
| parent | ca1ec12725c32b0173692e01259570966da8a9a6 (diff) | |
| download | yuescript-e4f8d1b3b075323968bb6dc334226dff33c0a2b0.tar.gz yuescript-e4f8d1b3b075323968bb6dc334226dff33c0a2b0.tar.bz2 yuescript-e4f8d1b3b075323968bb6dc334226dff33c0a2b0.zip | |
Updated doc.
Diffstat (limited to 'doc/docs/zh')
| -rwxr-xr-x | doc/docs/zh/doc/index.md | 18 | ||||
| -rw-r--r-- | doc/docs/zh/index.md | 4 |
2 files changed, 11 insertions, 11 deletions
diff --git a/doc/docs/zh/doc/index.md b/doc/docs/zh/doc/index.md index dff51a9..5250325 100755 --- a/doc/docs/zh/doc/index.md +++ b/doc/docs/zh/doc/index.md | |||
| @@ -2858,7 +2858,7 @@ thing = { | |||
| 2858 | width: 123 | 2858 | width: 123 |
| 2859 | } | 2859 | } |
| 2860 | 2860 | ||
| 2861 | thing_copy = \{k, v for k, v in pairs thing} | 2861 | thing_copy = {k, v for k, v in pairs thing} |
| 2862 | ``` | 2862 | ``` |
| 2863 | 2863 | ||
| 2864 | </YueDisplay> | 2864 | </YueDisplay> |
| @@ -2869,7 +2869,7 @@ no_color = {k, v for k, v in pairs thing when k != "color"} | |||
| 2869 | <YueDisplay> | 2869 | <YueDisplay> |
| 2870 | 2870 | ||
| 2871 | ```yue | 2871 | ```yue |
| 2872 | no_color = \{k, v for k, v in pairs thing when k != "color"} | 2872 | no_color = {k, v for k, v in pairs thing when k != "color"} |
| 2873 | ``` | 2873 | ``` |
| 2874 | 2874 | ||
| 2875 | </YueDisplay> | 2875 | </YueDisplay> |
| @@ -2884,7 +2884,7 @@ sqrts = {i, math.sqrt i for i in *numbers} | |||
| 2884 | 2884 | ||
| 2885 | ```yue | 2885 | ```yue |
| 2886 | numbers = [1, 2, 3, 4] | 2886 | numbers = [1, 2, 3, 4] |
| 2887 | sqrts = \{i, math.sqrt i for i in *numbers} | 2887 | sqrts = {i, math.sqrt i for i in *numbers} |
| 2888 | ``` | 2888 | ``` |
| 2889 | 2889 | ||
| 2890 | </YueDisplay> | 2890 | </YueDisplay> |
| @@ -2901,7 +2901,7 @@ tbl = {unpack tuple for tuple in *tuples} | |||
| 2901 | 2901 | ||
| 2902 | ```yue | 2902 | ```yue |
| 2903 | tuples = [ ["hello", "world"], ["foo", "bar"]] | 2903 | tuples = [ ["hello", "world"], ["foo", "bar"]] |
| 2904 | tbl = \{unpack tuple for tuple in *tuples} | 2904 | tbl = {unpack tuple for tuple in *tuples} |
| 2905 | ``` | 2905 | ``` |
| 2906 | 2906 | ||
| 2907 | </YueDisplay> | 2907 | </YueDisplay> |
| @@ -3588,7 +3588,7 @@ switch item | |||
| 3588 | <YueDisplay> | 3588 | <YueDisplay> |
| 3589 | 3589 | ||
| 3590 | ```yue | 3590 | ```yue |
| 3591 | item = \{} | 3591 | item = {} |
| 3592 | 3592 | ||
| 3593 | {pos: {:x = 50, :y = 200}} = item -- 获取错误:尝试索引nil值(字段'pos') | 3593 | {pos: {:x = 50, :y = 200}} = item -- 获取错误:尝试索引nil值(字段'pos') |
| 3594 | 3594 | ||
| @@ -3748,7 +3748,7 @@ class Inventory | |||
| 3748 | ```yue | 3748 | ```yue |
| 3749 | class Inventory | 3749 | class Inventory |
| 3750 | new: => | 3750 | new: => |
| 3751 | @items = \{} | 3751 | @items = {} |
| 3752 | 3752 | ||
| 3753 | add_item: (name) => | 3753 | add_item: (name) => |
| 3754 | if @items[name] | 3754 | if @items[name] |
| @@ -4463,7 +4463,7 @@ tbl = { | |||
| 4463 | <YueDisplay> | 4463 | <YueDisplay> |
| 4464 | 4464 | ||
| 4465 | ```yue | 4465 | ```yue |
| 4466 | tbl = \{ | 4466 | tbl = { |
| 4467 | key: do | 4467 | key: do |
| 4468 | print "分配键值!" | 4468 | print "分配键值!" |
| 4469 | 1234 | 4469 | 1234 |
| @@ -4501,7 +4501,7 @@ run_callback my_object\write | |||
| 4501 | <YueDisplay> | 4501 | <YueDisplay> |
| 4502 | 4502 | ||
| 4503 | ```yue | 4503 | ```yue |
| 4504 | my_object = \{ | 4504 | my_object = { |
| 4505 | value: 1000 | 4505 | value: 1000 |
| 4506 | write: => print "值为:", @value | 4506 | write: => print "值为:", @value |
| 4507 | } | 4507 | } |
| @@ -4698,7 +4698,7 @@ to_lua: function(code: string, config?: Config): | |||
| 4698 | | --- | --- | | 4698 | | --- | --- | |
| 4699 | | string \| nil | 编译后的 Lua 代码,如果编译失败则为 nil。 | | 4699 | | string \| nil | 编译后的 Lua 代码,如果编译失败则为 nil。 | |
| 4700 | | string \| nil | 错误消息,如果编译成功则为 nil。 | | 4700 | | string \| nil | 错误消息,如果编译成功则为 nil。 | |
| 4701 | | \{\{string, integer, integer}} \| nil | 代码中出现的全局变量(带有名称、行和列),如果编译器选项 `lint_global` 为 false 则为 nil。 | | 4701 | | {{string, integer, integer}} \| nil | 代码中出现的全局变量(带有名称、行和列),如果编译器选项 `lint_global` 为 false 则为 nil。 | |
| 4702 | 4702 | ||
| 4703 | #### file_exist | 4703 | #### file_exist |
| 4704 | 4704 | ||
diff --git a/doc/docs/zh/index.md b/doc/docs/zh/index.md index 6d677e9..9068956 100644 --- a/doc/docs/zh/index.md +++ b/doc/docs/zh/index.md | |||
| @@ -15,8 +15,8 @@ features: | |||
| 15 | details: 更精简的语法,编译为可读 Lua,输出可预测、易集成。 | 15 | details: 更精简的语法,编译为可读 Lua,输出可预测、易集成。 |
| 16 | - title: 现代语言特性 | 16 | - title: 现代语言特性 |
| 17 | details: 管道、模式匹配、切片与解构,同时保留 Lua 互操作性。 | 17 | details: 管道、模式匹配、切片与解构,同时保留 Lua 互操作性。 |
| 18 | - title: 置工具 | 18 | - title: 迭代 |
| 19 | details: Playground、语高亮新的文档 | 19 | details: 虚用反馈,帮助和加速语言的发和演进! |
| 20 | footer: MIT Licensed | Copyright © 2017-2026 Li Jin | 20 | footer: MIT Licensed | Copyright © 2017-2026 Li Jin |
| 21 | --- | 21 | --- |
| 22 | 22 | ||
