diff options
| author | Li Jin <dragon-fly@qq.com> | 2025-04-16 08:41:16 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2025-04-16 08:41:16 +0800 |
| commit | 1c47083a8e2fe8a08a9dcf7d4520b4de98134c5d (patch) | |
| tree | 7463f5c66bc4215e087aef0587cb1ef648d7440a | |
| parent | 0574ec200693ad81b379582e61c3162163e133c4 (diff) | |
| download | yuescript-1c47083a8e2fe8a08a9dcf7d4520b4de98134c5d.tar.gz yuescript-1c47083a8e2fe8a08a9dcf7d4520b4de98134c5d.tar.bz2 yuescript-1c47083a8e2fe8a08a9dcf7d4520b4de98134c5d.zip | |
Cleanup.
| -rwxr-xr-x | doc/docs/zh/doc/README.md | 6 | ||||
| -rw-r--r-- | spec/outputs/codes_from_doc.lua | 6 | ||||
| -rw-r--r-- | spec/outputs/codes_from_doc_zh.lua | 6 |
3 files changed, 6 insertions, 12 deletions
diff --git a/doc/docs/zh/doc/README.md b/doc/docs/zh/doc/README.md index 1a2da96..754566c 100755 --- a/doc/docs/zh/doc/README.md +++ b/doc/docs/zh/doc/README.md | |||
| @@ -2057,13 +2057,11 @@ doubled = [item * 2 for i, item in ipairs items] | |||
| 2057 | 可以使用when子句筛选新表中包含的项目: | 2057 | 可以使用when子句筛选新表中包含的项目: |
| 2058 | 2058 | ||
| 2059 | ```moonscript | 2059 | ```moonscript |
| 2060 | iter = ipairs items | 2060 | slice = [item for i, item in ipairs items when i > 1 and i < 3] |
| 2061 | slice = [item for i, item in iter when i > 1 and i < 3] | ||
| 2062 | ``` | 2061 | ``` |
| 2063 | <YueDisplay> | 2062 | <YueDisplay> |
| 2064 | <pre> | 2063 | <pre> |
| 2065 | iter = ipairs items | 2064 | slice = [item for i, item in ipairs items when i > 1 and i < 3] |
| 2066 | slice = [item for i, item in iter when i > 1 and i < 3] | ||
| 2067 | </pre> | 2065 | </pre> |
| 2068 | </YueDisplay> | 2066 | </YueDisplay> |
| 2069 | 2067 | ||
diff --git a/spec/outputs/codes_from_doc.lua b/spec/outputs/codes_from_doc.lua index 27f8de5..f6d5d61 100644 --- a/spec/outputs/codes_from_doc.lua +++ b/spec/outputs/codes_from_doc.lua | |||
| @@ -860,11 +860,10 @@ for i, item in ipairs(items) do | |||
| 860 | _len_0 = _len_0 + 1 | 860 | _len_0 = _len_0 + 1 |
| 861 | end | 861 | end |
| 862 | doubled = _accum_0 | 862 | doubled = _accum_0 |
| 863 | local iter = ipairs(items) | ||
| 864 | local slice | 863 | local slice |
| 865 | local _accum_0 = { } | 864 | local _accum_0 = { } |
| 866 | local _len_0 = 1 | 865 | local _len_0 = 1 |
| 867 | for i, item in iter do | 866 | for i, item in ipairs(items) do |
| 868 | if i > 1 and i < 3 then | 867 | if i > 1 and i < 3 then |
| 869 | _accum_0[_len_0] = item | 868 | _accum_0[_len_0] = item |
| 870 | _len_0 = _len_0 + 1 | 869 | _len_0 = _len_0 + 1 |
| @@ -2867,11 +2866,10 @@ for i, item in ipairs(items) do | |||
| 2867 | _len_0 = _len_0 + 1 | 2866 | _len_0 = _len_0 + 1 |
| 2868 | end | 2867 | end |
| 2869 | doubled = _accum_0 | 2868 | doubled = _accum_0 |
| 2870 | local iter = ipairs(items) | ||
| 2871 | local slice | 2869 | local slice |
| 2872 | local _accum_0 = { } | 2870 | local _accum_0 = { } |
| 2873 | local _len_0 = 1 | 2871 | local _len_0 = 1 |
| 2874 | for i, item in iter do | 2872 | for i, item in ipairs(items) do |
| 2875 | if i > 1 and i < 3 then | 2873 | if i > 1 and i < 3 then |
| 2876 | _accum_0[_len_0] = item | 2874 | _accum_0[_len_0] = item |
| 2877 | _len_0 = _len_0 + 1 | 2875 | _len_0 = _len_0 + 1 |
diff --git a/spec/outputs/codes_from_doc_zh.lua b/spec/outputs/codes_from_doc_zh.lua index ffa0483..acd41a0 100644 --- a/spec/outputs/codes_from_doc_zh.lua +++ b/spec/outputs/codes_from_doc_zh.lua | |||
| @@ -854,11 +854,10 @@ for i, item in ipairs(items) do | |||
| 854 | _len_0 = _len_0 + 1 | 854 | _len_0 = _len_0 + 1 |
| 855 | end | 855 | end |
| 856 | doubled = _accum_0 | 856 | doubled = _accum_0 |
| 857 | local iter = ipairs(items) | ||
| 858 | local slice | 857 | local slice |
| 859 | local _accum_0 = { } | 858 | local _accum_0 = { } |
| 860 | local _len_0 = 1 | 859 | local _len_0 = 1 |
| 861 | for i, item in iter do | 860 | for i, item in ipairs(items) do |
| 862 | if i > 1 and i < 3 then | 861 | if i > 1 and i < 3 then |
| 863 | _accum_0[_len_0] = item | 862 | _accum_0[_len_0] = item |
| 864 | _len_0 = _len_0 + 1 | 863 | _len_0 = _len_0 + 1 |
| @@ -2855,11 +2854,10 @@ for i, item in ipairs(items) do | |||
| 2855 | _len_0 = _len_0 + 1 | 2854 | _len_0 = _len_0 + 1 |
| 2856 | end | 2855 | end |
| 2857 | doubled = _accum_0 | 2856 | doubled = _accum_0 |
| 2858 | local iter = ipairs(items) | ||
| 2859 | local slice | 2857 | local slice |
| 2860 | local _accum_0 = { } | 2858 | local _accum_0 = { } |
| 2861 | local _len_0 = 1 | 2859 | local _len_0 = 1 |
| 2862 | for i, item in iter do | 2860 | for i, item in ipairs(items) do |
| 2863 | if i > 1 and i < 3 then | 2861 | if i > 1 and i < 3 then |
| 2864 | _accum_0[_len_0] = item | 2862 | _accum_0[_len_0] = item |
| 2865 | _len_0 = _len_0 + 1 | 2863 | _len_0 = _len_0 + 1 |
