Skip to content

Commit c26aae8

Browse files
committed
Updated spec and docs.
1 parent 8a77132 commit c26aae8

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

doc/docs/doc/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ require("yue")("your_yuescript_entry")
137137
Require YueScript module and rewite message by hand.
138138
```lua
139139
local yue = require("yue")
140+
yue.insert_loader()
140141
local success, result = xpcall(function()
141-
yue.require("yuescript_module_name")
142+
require("yuescript_module_name")
142143
end, function(err)
143144
return yue.traceback(err)
144145
end)

doc/docs/zh/doc/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ require("yue")("你的脚本入口文件")
137137
手动引入月之脚本模块并重写错误消息来帮助调试。
138138
```lua
139139
local yue = require("yue")
140+
yue.insert_loaders()
140141
local success, result = xpcall(function()
141-
yue.require("yuescript_module_name")
142+
require("yuescript_module_name")
142143
end, function(err)
143144
return yue.traceback(err)
144145
end)

spec/inputs/in_expression.yue

+14
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,19 @@ do
7575
print a in []
7676
a = 1
7777
print a in {}
78+
79+
do
80+
a = 1
81+
print a in [1, 2, 1]
82+
83+
do
84+
a = -1
85+
print a in [-1, 11, 2, -1, 0, -1]
86+
87+
do
88+
a = 1
89+
b = 1
90+
print a in [b, 10, b]
91+
7892
nil
7993

spec/outputs/in_expression.lua

+13
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,17 @@ do
213213
local a = 1
214214
print((false))
215215
end
216+
do
217+
local a = 1
218+
print((1 == a or 2 == a or 1 == a))
219+
end
220+
do
221+
local a = -1
222+
print((-1 == a or 11 == a or 2 == a or -1 == a or 0 == a or -1 == a))
223+
end
224+
do
225+
local a = 1
226+
local b = 1
227+
print((b == a or 10 == a or b == a))
228+
end
216229
return nil

0 commit comments

Comments
 (0)