diff options
author | Li Jin <dragon-fly@qq.com> | 2021-10-12 10:04:44 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2021-10-12 10:04:44 +0800 |
commit | 60a979e224f26117f5be82bfca757a2483cef0fd (patch) | |
tree | 7c6af44f6dcada1f23979b820ba830251997b161 /spec/outputs/plus.lua | |
parent | a19b242cbaf53721b20a3163dd06f43e9ef2b487 (diff) | |
download | yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.tar.gz yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.tar.bz2 yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.zip |
fix test.
Diffstat (limited to 'spec/outputs/plus.lua')
-rw-r--r-- | spec/outputs/plus.lua | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/spec/outputs/plus.lua b/spec/outputs/plus.lua new file mode 100644 index 0000000..749e830 --- /dev/null +++ b/spec/outputs/plus.lua | |||
@@ -0,0 +1,69 @@ | |||
1 | x["do"](x, "work") | ||
2 | func((function() | ||
3 | local _call_0 = a["do"](a) | ||
4 | local _call_1 = _call_0["end"](_call_0, "OK") | ||
5 | return _call_1["if"](_call_1, "abc", 123) | ||
6 | end)()) | ||
7 | local _call_0 = b["function"] | ||
8 | local _call_1 = _call_0["do"](_call_0) | ||
9 | local _call_2 = _call_1["while"](_call_1, "OK") | ||
10 | local res = _call_2["if"](_call_2, "def", 998) | ||
11 | local _call_3 = c["repeat"]["if"] | ||
12 | local _call_4 = _call_3["then"](_call_3, "xyz") | ||
13 | _call_4["else"](_call_4, res) | ||
14 | print(self["for"], self.__class["function"](self.__class, 123)) | ||
15 | do | ||
16 | local fcolor = message:match("<%w*>") | ||
17 | if fcolor then | ||
18 | local message = message:gsub("<%->", fcolor) | ||
19 | end | ||
20 | end | ||
21 | local message | ||
22 | do | ||
23 | local fcolor = message:match("<%w*>") | ||
24 | if fcolor then | ||
25 | message = message:gsub("<%->", fcolor) | ||
26 | end | ||
27 | end | ||
28 | local valA | ||
29 | do | ||
30 | local func = getfunc() | ||
31 | if func then | ||
32 | valA = func() | ||
33 | end | ||
34 | end | ||
35 | local valA | ||
36 | do | ||
37 | local func = getfunc() | ||
38 | if func then | ||
39 | valA = func() | ||
40 | end | ||
41 | end | ||
42 | local valB | ||
43 | do | ||
44 | local func = getfunc() | ||
45 | if func ~= nil then | ||
46 | valB = func() | ||
47 | end | ||
48 | end | ||
49 | backpack = { | ||
50 | something = { | ||
51 | yeah = 200, | ||
52 | they = function() | ||
53 | print("hello") | ||
54 | return yor_feet("small") | ||
55 | end, | ||
56 | pretty = hair, | ||
57 | gold = hmm | ||
58 | }, | ||
59 | yow = 1000, | ||
60 | eat = goo, | ||
61 | yeah = dudd | ||
62 | } | ||
63 | local start = { | ||
64 | something = "cold" | ||
65 | } | ||
66 | local bathe | ||
67 | bathe = { | ||
68 | on = "fire" | ||
69 | } | ||