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/with.lua | |
| parent | a19b242cbaf53721b20a3163dd06f43e9ef2b487 (diff) | |
| download | yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.tar.gz yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.tar.bz2 yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.zip | |
fix test.
Diffstat (limited to 'spec/outputs/with.lua')
| -rw-r--r-- | spec/outputs/with.lua | 164 |
1 files changed, 164 insertions, 0 deletions
diff --git a/spec/outputs/with.lua b/spec/outputs/with.lua new file mode 100644 index 0000000..e1497c6 --- /dev/null +++ b/spec/outputs/with.lua | |||
| @@ -0,0 +1,164 @@ | |||
| 1 | do | ||
| 2 | local a | ||
| 3 | a = function() | ||
| 4 | local _with_0 = something | ||
| 5 | print(_with_0.hello) | ||
| 6 | print(hi) | ||
| 7 | print("world") | ||
| 8 | return _with_0 | ||
| 9 | end | ||
| 10 | end | ||
| 11 | do | ||
| 12 | do | ||
| 13 | local _with_0 = leaf | ||
| 14 | _with_0.world() | ||
| 15 | _with_0.world(1, 2, 3) | ||
| 16 | local g = _with_0.what.is.this | ||
| 17 | _with_0.hi(1, 2, 3) | ||
| 18 | _with_0:hi(1, 2).world(2323) | ||
| 19 | _with_0:hi("yeah", "man") | ||
| 20 | _with_0.world = 200 | ||
| 21 | end | ||
| 22 | end | ||
| 23 | do | ||
| 24 | local zyzyzy | ||
| 25 | do | ||
| 26 | local _with_0 = something | ||
| 27 | _with_0.set_state("hello world") | ||
| 28 | zyzyzy = _with_0 | ||
| 29 | end | ||
| 30 | end | ||
| 31 | do | ||
| 32 | local x = 5 + (function() | ||
| 33 | local _with_0 = Something() | ||
| 34 | _with_0:write("hello world") | ||
| 35 | return _with_0 | ||
| 36 | end)() | ||
| 37 | end | ||
| 38 | do | ||
| 39 | local x = { | ||
| 40 | hello = (function() | ||
| 41 | local _with_0 = yeah | ||
| 42 | _with_0:okay() | ||
| 43 | return _with_0 | ||
| 44 | end)() | ||
| 45 | } | ||
| 46 | end | ||
| 47 | do | ||
| 48 | do | ||
| 49 | local _with_0 = foo | ||
| 50 | local _ = _with_0:prop("something").hello | ||
| 51 | _with_0.prop:send(one) | ||
| 52 | _with_0.prop:send(one) | ||
| 53 | end | ||
| 54 | end | ||
| 55 | do | ||
| 56 | do | ||
| 57 | local _with_0 = a, b | ||
| 58 | print(_with_0.world) | ||
| 59 | end | ||
| 60 | local mod | ||
| 61 | do | ||
| 62 | local _M = { } | ||
| 63 | _M.Thing = "hi" | ||
| 64 | mod = _M | ||
| 65 | end | ||
| 66 | do | ||
| 67 | local a, b = something, pooh | ||
| 68 | print(a.world) | ||
| 69 | end | ||
| 70 | local x | ||
| 71 | do | ||
| 72 | local a, b = 1, 2 | ||
| 73 | print(a + b) | ||
| 74 | x = a | ||
| 75 | end | ||
| 76 | print((function() | ||
| 77 | local a, b = 1, 2 | ||
| 78 | print(a + b) | ||
| 79 | return a | ||
| 80 | end)()) | ||
| 81 | local p | ||
| 82 | do | ||
| 83 | local _with_0 = 1 | ||
| 84 | hello().x, world().y = _with_0, 2 | ||
| 85 | print(a + b) | ||
| 86 | p = _with_0 | ||
| 87 | end | ||
| 88 | end | ||
| 89 | do | ||
| 90 | local x = "hello" | ||
| 91 | x:upper() | ||
| 92 | end | ||
| 93 | do | ||
| 94 | do | ||
| 95 | local k = "jo" | ||
| 96 | print(k:upper()) | ||
| 97 | end | ||
| 98 | end | ||
| 99 | do | ||
| 100 | do | ||
| 101 | local a, b, c = "", "", "" | ||
| 102 | print(a:upper()) | ||
| 103 | end | ||
| 104 | end | ||
| 105 | do | ||
| 106 | local a = "bunk" | ||
| 107 | do | ||
| 108 | local b, c | ||
| 109 | a, b, c = "", "", "" | ||
| 110 | print(a:upper()) | ||
| 111 | end | ||
| 112 | end | ||
| 113 | do | ||
| 114 | do | ||
| 115 | local _with_0 = j | ||
| 116 | print(_with_0:upper()) | ||
| 117 | end | ||
| 118 | end | ||
| 119 | do | ||
| 120 | do | ||
| 121 | local _with_0 = "jo" | ||
| 122 | k.j = _with_0 | ||
| 123 | print(_with_0:upper()) | ||
| 124 | end | ||
| 125 | end | ||
| 126 | do | ||
| 127 | do | ||
| 128 | local _with_0 = a | ||
| 129 | print(_with_0.b) | ||
| 130 | do | ||
| 131 | local _with_1 = _with_0.c | ||
| 132 | print(_with_1.d) | ||
| 133 | end | ||
| 134 | end | ||
| 135 | end | ||
| 136 | do | ||
| 137 | do | ||
| 138 | local _with_0 = a | ||
| 139 | do | ||
| 140 | local _with_1 = 2 | ||
| 141 | _with_0.b = _with_1 | ||
| 142 | print(_with_1.c) | ||
| 143 | end | ||
| 144 | end | ||
| 145 | end | ||
| 146 | do | ||
| 147 | local _ | ||
| 148 | _ = function() | ||
| 149 | local _with_0 = hi | ||
| 150 | return _with_0.a, _with_0.b | ||
| 151 | end | ||
| 152 | end | ||
| 153 | do | ||
| 154 | do | ||
| 155 | local _with_0 = tb | ||
| 156 | _with_0.x = item.field:func(123) | ||
| 157 | end | ||
| 158 | end | ||
| 159 | do | ||
| 160 | local _with_0 = dad | ||
| 161 | _with_0["if"]("yes") | ||
| 162 | local y = _with_0["end"].of["function"] | ||
| 163 | return _with_0 | ||
| 164 | end | ||
