aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2026-02-12 10:45:06 +0800
committerLi Jin <dragon-fly@qq.com>2026-02-12 10:45:06 +0800
commit319f49796439e50640cadff1220681a217be98a3 (patch)
treed65021d61b64373d5fb3763ba6375faaebaa1e53 /spec/outputs
parentd63779ec0a6f00854f53b48b0f6a67707879b6d1 (diff)
downloadyuescript-319f49796439e50640cadff1220681a217be98a3.tar.gz
yuescript-319f49796439e50640cadff1220681a217be98a3.tar.bz2
yuescript-319f49796439e50640cadff1220681a217be98a3.zip
Added the all-in-one doc.
Diffstat (limited to 'spec/outputs')
-rw-r--r--spec/outputs/codes_from_doc_de.lua24
-rw-r--r--spec/outputs/codes_from_doc_en.lua24
-rw-r--r--spec/outputs/codes_from_doc_id-id.lua24
-rw-r--r--spec/outputs/codes_from_doc_pt-br.lua24
-rw-r--r--spec/outputs/codes_from_doc_zh.lua24
-rw-r--r--spec/outputs/compile_doc.lua26
6 files changed, 141 insertions, 5 deletions
diff --git a/spec/outputs/codes_from_doc_de.lua b/spec/outputs/codes_from_doc_de.lua
index 428f788..4c9ba1d 100644
--- a/spec/outputs/codes_from_doc_de.lua
+++ b/spec/outputs/codes_from_doc_de.lua
@@ -2163,6 +2163,18 @@ repeat
2163 result = _with_0.value 2163 result = _with_0.value
2164 break 2164 break
2165until true 2165until true
2166local a
2167do
2168 local _with_0 = obj
2169 _with_0.x = 1
2170 a = _with_0
2171end
2172local b
2173local _with_0 = obj
2174repeat
2175 b = _with_0.x
2176 break
2177until true
2166local create_person 2178local create_person
2167create_person = function(name, relatives) 2179create_person = function(name, relatives)
2168 local _with_0 = Person() 2180 local _with_0 = Person()
@@ -2209,6 +2221,18 @@ repeat
2209 result = _with_0.value 2221 result = _with_0.value
2210 break 2222 break
2211until true 2223until true
2224local a
2225do
2226 local _with_0 = obj
2227 _with_0.x = 1
2228 a = _with_0
2229end
2230local b
2231local _with_0 = obj
2232repeat
2233 b = _with_0.x
2234 break
2235until true
2212local create_person 2236local create_person
2213create_person = function(name, relatives) 2237create_person = function(name, relatives)
2214 local _with_0 = Person() 2238 local _with_0 = Person()
diff --git a/spec/outputs/codes_from_doc_en.lua b/spec/outputs/codes_from_doc_en.lua
index 4006605..6d822e1 100644
--- a/spec/outputs/codes_from_doc_en.lua
+++ b/spec/outputs/codes_from_doc_en.lua
@@ -2163,6 +2163,18 @@ repeat
2163 result = _with_0.value 2163 result = _with_0.value
2164 break 2164 break
2165until true 2165until true
2166local a
2167do
2168 local _with_0 = obj
2169 _with_0.x = 1
2170 a = _with_0
2171end
2172local b
2173local _with_0 = obj
2174repeat
2175 b = _with_0.x
2176 break
2177until true
2166local create_person 2178local create_person
2167create_person = function(name, relatives) 2179create_person = function(name, relatives)
2168 local _with_0 = Person() 2180 local _with_0 = Person()
@@ -2209,6 +2221,18 @@ repeat
2209 result = _with_0.value 2221 result = _with_0.value
2210 break 2222 break
2211until true 2223until true
2224local a
2225do
2226 local _with_0 = obj
2227 _with_0.x = 1
2228 a = _with_0
2229end
2230local b
2231local _with_0 = obj
2232repeat
2233 b = _with_0.x
2234 break
2235until true
2212local create_person 2236local create_person
2213create_person = function(name, relatives) 2237create_person = function(name, relatives)
2214 local _with_0 = Person() 2238 local _with_0 = Person()
diff --git a/spec/outputs/codes_from_doc_id-id.lua b/spec/outputs/codes_from_doc_id-id.lua
index 7d95eaa..4026240 100644
--- a/spec/outputs/codes_from_doc_id-id.lua
+++ b/spec/outputs/codes_from_doc_id-id.lua
@@ -2163,6 +2163,18 @@ repeat
2163 result = _with_0.value 2163 result = _with_0.value
2164 break 2164 break
2165until true 2165until true
2166local a
2167do
2168 local _with_0 = obj
2169 _with_0.x = 1
2170 a = _with_0
2171end
2172local b
2173local _with_0 = obj
2174repeat
2175 b = _with_0.x
2176 break
2177until true
2166local create_person 2178local create_person
2167create_person = function(name, relatives) 2179create_person = function(name, relatives)
2168 local _with_0 = Person() 2180 local _with_0 = Person()
@@ -2209,6 +2221,18 @@ repeat
2209 result = _with_0.value 2221 result = _with_0.value
2210 break 2222 break
2211until true 2223until true
2224local a
2225do
2226 local _with_0 = obj
2227 _with_0.x = 1
2228 a = _with_0
2229end
2230local b
2231local _with_0 = obj
2232repeat
2233 b = _with_0.x
2234 break
2235until true
2212local create_person 2236local create_person
2213create_person = function(name, relatives) 2237create_person = function(name, relatives)
2214 local _with_0 = Person() 2238 local _with_0 = Person()
diff --git a/spec/outputs/codes_from_doc_pt-br.lua b/spec/outputs/codes_from_doc_pt-br.lua
index caa15d6..0d0c76f 100644
--- a/spec/outputs/codes_from_doc_pt-br.lua
+++ b/spec/outputs/codes_from_doc_pt-br.lua
@@ -2163,6 +2163,18 @@ repeat
2163 result = _with_0.value 2163 result = _with_0.value
2164 break 2164 break
2165until true 2165until true
2166local a
2167do
2168 local _with_0 = obj
2169 _with_0.x = 1
2170 a = _with_0
2171end
2172local b
2173local _with_0 = obj
2174repeat
2175 b = _with_0.x
2176 break
2177until true
2166local create_person 2178local create_person
2167create_person = function(name, relatives) 2179create_person = function(name, relatives)
2168 local _with_0 = Person() 2180 local _with_0 = Person()
@@ -2209,6 +2221,18 @@ repeat
2209 result = _with_0.value 2221 result = _with_0.value
2210 break 2222 break
2211until true 2223until true
2224local a
2225do
2226 local _with_0 = obj
2227 _with_0.x = 1
2228 a = _with_0
2229end
2230local b
2231local _with_0 = obj
2232repeat
2233 b = _with_0.x
2234 break
2235until true
2212local create_person 2236local create_person
2213create_person = function(name, relatives) 2237create_person = function(name, relatives)
2214 local _with_0 = Person() 2238 local _with_0 = Person()
diff --git a/spec/outputs/codes_from_doc_zh.lua b/spec/outputs/codes_from_doc_zh.lua
index 4ff3866..c847841 100644
--- a/spec/outputs/codes_from_doc_zh.lua
+++ b/spec/outputs/codes_from_doc_zh.lua
@@ -2163,6 +2163,18 @@ repeat
2163 result = _with_0.value 2163 result = _with_0.value
2164 break 2164 break
2165until true 2165until true
2166local a
2167do
2168 local _with_0 = obj
2169 _with_0.x = 1
2170 a = _with_0
2171end
2172local b
2173local _with_0 = obj
2174repeat
2175 b = _with_0.x
2176 break
2177until true
2166local create_person 2178local create_person
2167create_person = function(name, relatives) 2179create_person = function(name, relatives)
2168 local _with_0 = Person() 2180 local _with_0 = Person()
@@ -2209,6 +2221,18 @@ repeat
2209 result = _with_0.value 2221 result = _with_0.value
2210 break 2222 break
2211until true 2223until true
2224local a
2225do
2226 local _with_0 = obj
2227 _with_0.x = 1
2228 a = _with_0
2229end
2230local b
2231local _with_0 = obj
2232repeat
2233 b = _with_0.x
2234 break
2235until true
2212local create_person 2236local create_person
2213create_person = function(name, relatives) 2237create_person = function(name, relatives)
2214 local _with_0 = Person() 2238 local _with_0 = Person()
diff --git a/spec/outputs/compile_doc.lua b/spec/outputs/compile_doc.lua
index 8d5c11a..f661bbd 100644
--- a/spec/outputs/compile_doc.lua
+++ b/spec/outputs/compile_doc.lua
@@ -1,4 +1,10 @@
1local outputFolder = ... 1local outputFolder, docFolder
2do
3 local _obj_0 = {
4 ...
5 }
6 outputFolder, docFolder = _obj_0[1], _obj_0[2]
7end
2local getFiles 8local getFiles
3getFiles = function(locale) 9getFiles = function(locale)
4 if locale == "en" then 10 if locale == "en" then
@@ -57,6 +63,7 @@ do
57 local locale = _list_0[_index_0] 63 local locale = _list_0[_index_0]
58 _accum_0[_len_0] = { 64 _accum_0[_len_0] = {
59 "codes_from_doc_" .. tostring(locale) .. ".lua", 65 "codes_from_doc_" .. tostring(locale) .. ".lua",
66 "yue-" .. tostring(locale) .. ".md",
60 getFiles(locale) 67 getFiles(locale)
61 } 68 }
62 _len_0 = _len_0 + 1 69 _len_0 = _len_0 + 1
@@ -65,8 +72,9 @@ do
65end 72end
66for _index_0 = 1, #docs do 73for _index_0 = 1, #docs do
67 local _des_0 = docs[_index_0] 74 local _des_0 = docs[_index_0]
68 local compiledFile, docFiles = _des_0[1], _des_0[2] 75 local compiledFile, docFile, docFiles = _des_0[1], _des_0[2], _des_0[3]
69 local codes = { } 76 local codes = { }
77 local docTexts = { }
70 for _index_1 = 1, #docFiles do 78 for _index_1 = 1, #docFiles do
71 local docFile = docFiles[_index_1] 79 local docFile = docFiles[_index_1]
72 local input 80 local input
@@ -74,6 +82,7 @@ for _index_0 = 1, #docs do
74 if _with_0 ~= nil then 82 if _with_0 ~= nil then
75 local to_lua = require("yue").to_lua 83 local to_lua = require("yue").to_lua
76 local text = _with_0:read("*a") 84 local text = _with_0:read("*a")
85 docTexts[#docTexts + 1] = text
77 for code in text:gmatch("```yuescript[\r\n]+(.-)```[^%w]") do 86 for code in text:gmatch("```yuescript[\r\n]+(.-)```[^%w]") do
78 local result, err = to_lua(code, { 87 local result, err = to_lua(code, {
79 implicit_return_root = false, 88 implicit_return_root = false,
@@ -103,8 +112,15 @@ for _index_0 = 1, #docs do
103 local _close_0 <close> = input 112 local _close_0 <close> = input
104 end 113 end
105 local output 114 local output
106 local _with_0 = io.open(tostring(outputFolder) .. "/" .. tostring(compiledFile), "w+") 115 do
107 _with_0:write(table.concat(codes)) 116 local _with_0 = io.open(tostring(outputFolder) .. "/" .. tostring(compiledFile), "w+")
108 output = _with_0 117 _with_0:write(table.concat(codes))
118 output = _with_0
119 end
109 local _close_0 <close> = output 120 local _close_0 <close> = output
121 local output2
122 local _with_0 = io.open(tostring(docFolder) .. "/" .. tostring(docFile), "w+")
123 _with_0:write(table.concat(docTexts, "\n"))
124 output2 = _with_0
125 local _close_1 <close> = output2
110end 126end