aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2023-08-29 09:45:30 +0800
committerLi Jin <dragon-fly@qq.com>2023-08-29 09:45:30 +0800
commited718b7b6754379b9471830b1cc5241a2fd0f941 (patch)
tree019599a94dab2718019d0b150a72e516b96a4f24 /doc
parent28a63ec1bc97cc81848e268ba65d7aea6aac04c3 (diff)
downloadyuescript-ed718b7b6754379b9471830b1cc5241a2fd0f941.tar.gz
yuescript-ed718b7b6754379b9471830b1cc5241a2fd0f941.tar.bz2
yuescript-ed718b7b6754379b9471830b1cc5241a2fd0f941.zip
update doc.
Diffstat (limited to 'doc')
-rwxr-xr-xdoc/docs/zh/doc/README.md43
1 files changed, 22 insertions, 21 deletions
diff --git a/doc/docs/zh/doc/README.md b/doc/docs/zh/doc/README.md
index 905a883..3ae6af7 100755
--- a/doc/docs/zh/doc/README.md
+++ b/doc/docs/zh/doc/README.md
@@ -128,7 +128,7 @@ require("yue")("你的脚本入口文件")
128当你在同一路径下把 "你的脚本入口文件.yue" 编译成了 "你的脚本入口文件.lua" 时,仍然可以使用这个代码加载 .lua 代码文件。在其余的月之脚本文件中,只需正常使用 **require** 或 **import**进行脚本引用即可。错误消息中的代码行号也会被正确处理。 128当你在同一路径下把 "你的脚本入口文件.yue" 编译成了 "你的脚本入口文件.lua" 时,仍然可以使用这个代码加载 .lua 代码文件。在其余的月之脚本文件中,只需正常使用 **require** 或 **import**进行脚本引用即可。错误消息中的代码行号也会被正确处理。
129 129
130* **用法 2** 130* **用法 2**
131手动引入月之脚本模块并重写消息。 131手动引入月之脚本模块并重写错误消息来帮助调试
132```lua 132```lua
133local yue = require("yue") 133local yue = require("yue")
134local success, result = xpcall(function() 134local success, result = xpcall(function()
@@ -165,28 +165,28 @@ f!
165使用命令: yue [选项|文件|目录] ... 165使用命令: yue [选项|文件|目录] ...
166 166
167 -h 打印此消息 167 -h 打印此消息
168 -e str 执行文件或原始代码 168 -e str 执行一个文件或一段原始代码
169 -m 生成压缩代码 169 -m 生成压缩后的代码
170 -r 重写输出以匹配原始行号 170 -r 重写输出的Lua匹配原始代码中的行号
171 -t path 指定放置编译文件的位置 171 -t path 指定放置编译件的位置
172 -o file 将输出写文件 172 -o file 将输出写定的
173 -s 在生成的代码中使用空格代替制表符 173 -s 在生成的代码中使用空格代替制表符
174 -p 将输出写入标准输出 174 -p 将输出写入标准输出
175 -b 编译时间(不写输出) 175 -b 编译时间(不写输出)
176 -g NAME LINE COLUMN中使用的全局变量 176 -g 以“名称 号 列号”的使用的全局变量
177 -l 代码写行号 177 -l 在输的每的末代码的行号
178 -c 代码保留语句前的注释 178 -c 在输代码留语句前的注释
179 -w path 更改并编译目录下的 179 -w path 监测目下的改并重新编译录下的文件
180 -v 打印版本 180 -v 打印版本
181 -- 从标准输入读取,打印到标准输出 181 -- 从标准输入读取原始代码,打印到编译结准输出
182 (必须是第一个且唯一的参数) 182 (必须是第一个且唯一的参数)
183 183
184 --target=version 指定编译器将生成的Lua版本代码 184 --target=version 指定编译器将生成的Lua代码版本号
185 (版本只能是 5.1, 5.2, 5.3 或 5.4) 185 (版本能是 5.1, 5.2, 5.3 或 5.4)
186 --path=path_str 将额外的Lua搜索路径字符串追加到package.path 186 --path=path_str 将额外的Lua搜索路径字符串追加到package.path
187 187
188选项执行以进入REPL '$' 后 188任何选项执行进入REPL
189 开始或是停止多行输入模式 189 单行输入符号 '$' 并换行后可以始或是停止多行输入模式
190``` 190```
191&emsp;&emsp;使用案例: 191&emsp;&emsp;使用案例:
192&emsp;&emsp;递归编译当前路径下扩展名为 **.yue** 的每个月之脚本文件: **yue .** 192&emsp;&emsp;递归编译当前路径下扩展名为 **.yue** 的每个月之脚本文件: **yue .**
@@ -225,7 +225,7 @@ $asserts item ~= nil
225$config false 225$config false
226value = $assert item 226value = $assert item
227 227
228-- 传递的表达式被为字符串 228-- 宏函数参数传递的表达式为字符串
229macro and = (...)-> "#{ table.concat {...}, ' and ' }" 229macro and = (...)-> "#{ table.concat {...}, ' and ' }"
230if $and f1!, f2!, f3! 230if $and f1!, f2!, f3!
231 print "OK" 231 print "OK"
@@ -254,7 +254,7 @@ $asserts item ~= nil
254$config false 254$config false
255value = $assert item 255value = $assert item
256 256
257-- 传递的表达式被为字符串 257-- 宏函数参数传递的表达式为字符串
258macro and = (...)-> "#{ table.concat {...}, ' and ' }" 258macro and = (...)-> "#{ table.concat {...}, ' and ' }"
259if $and f1!, f2!, f3! 259if $and f1!, f2!, f3!
260 print "OK" 260 print "OK"
@@ -2044,6 +2044,7 @@ slice = [item for item in *items[2,]]
2044slice = [item for item in *items[,,2]] 2044slice = [item for item in *items[,,2]]
2045``` 2045```
2046<YueDisplay> 2046<YueDisplay>
2047
2047<pre> 2048<pre>
2048slice = [item for item in *items[,,2]] 2049slice = [item for item in *items[,,2]]
2049</pre> 2050</pre>