diff options
| author | Li Jin <dragon-fly@qq.com> | 2022-07-24 22:13:08 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2022-07-24 22:13:08 +0800 |
| commit | 303834e1b1e6cd9cae64b66c2ae44dcd7185238f (patch) | |
| tree | 519f6a1debcc5791d35e06dc5cbb1ce22f9cfd31 /spec/outputs/destructure.lua | |
| parent | eb367126bf3a4f5b0e51ccef93b7c7136bea170e (diff) | |
| download | yuescript-303834e1b1e6cd9cae64b66c2ae44dcd7185238f.tar.gz yuescript-303834e1b1e6cd9cae64b66c2ae44dcd7185238f.tar.bz2 yuescript-303834e1b1e6cd9cae64b66c2ae44dcd7185238f.zip | |
add option --target=5.1 to generate Lua 5.1 compatible codes. add const destructure. make import item const by default.
Diffstat (limited to 'spec/outputs/destructure.lua')
| -rw-r--r-- | spec/outputs/destructure.lua | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/spec/outputs/destructure.lua b/spec/outputs/destructure.lua index 2fe4ba9..59ee358 100644 --- a/spec/outputs/destructure.lua +++ b/spec/outputs/destructure.lua | |||
| @@ -26,7 +26,7 @@ do | |||
| 26 | local _obj_0 = yeah | 26 | local _obj_0 = yeah |
| 27 | a, b, c, d = _obj_0.a, _obj_0.b, _obj_0.c, _obj_0.d | 27 | a, b, c, d = _obj_0.a, _obj_0.b, _obj_0.c, _obj_0.d |
| 28 | end | 28 | end |
| 29 | local _ = two | 29 | b = two |
| 30 | a = one[1] | 30 | a = one[1] |
| 31 | c = nil | 31 | c = nil |
| 32 | b = one[1] | 32 | b = one[1] |
| @@ -56,7 +56,10 @@ do | |||
| 56 | end | 56 | end |
| 57 | do | 57 | do |
| 58 | a = tbl | 58 | a = tbl |
| 59 | b, c = _.b, _.c | 59 | do |
| 60 | local _obj_0 = _ | ||
| 61 | b, c = _obj_0.b, _obj_0.c | ||
| 62 | end | ||
| 60 | end | 63 | end |
| 61 | do | 64 | do |
| 62 | b = _ | 65 | b = _ |
| @@ -386,3 +389,21 @@ do | |||
| 386 | a.c = _tmp_1 | 389 | a.c = _tmp_1 |
| 387 | end | 390 | end |
| 388 | end | 391 | end |
| 392 | do | ||
| 393 | local width, height | ||
| 394 | do | ||
| 395 | local _obj_0 = View.size | ||
| 396 | width, height = _obj_0.width, _obj_0.height | ||
| 397 | end | ||
| 398 | local x, y | ||
| 399 | do | ||
| 400 | local _obj_0 = point | ||
| 401 | x, y = _obj_0.x, _obj_0.y | ||
| 402 | if x == nil then | ||
| 403 | x = 0.0 | ||
| 404 | end | ||
| 405 | if y == nil then | ||
| 406 | y = 0.0 | ||
| 407 | end | ||
| 408 | end | ||
| 409 | end | ||
