diff options
| author | Li Jin <dragon-fly@qq.com> | 2022-04-25 13:19:26 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2022-04-25 13:19:45 +0800 |
| commit | 10afeaf30bfe03774c12908235520eebf0c192ee (patch) | |
| tree | ca266b04aaea63ea0710a51708d6ef806008b34e /spec/outputs/return.lua | |
| parent | 249e1de1d32dda2b60b9116c5a4e538475de0192 (diff) | |
| download | yuescript-10afeaf30bfe03774c12908235520eebf0c192ee.tar.gz yuescript-10afeaf30bfe03774c12908235520eebf0c192ee.tar.bz2 yuescript-10afeaf30bfe03774c12908235520eebf0c192ee.zip | |
add spread syntax support for table block. fix a gcc compiler issue. update doc.
Diffstat (limited to 'spec/outputs/return.lua')
| -rw-r--r-- | spec/outputs/return.lua | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/outputs/return.lua b/spec/outputs/return.lua index 0735b23..775ae11 100644 --- a/spec/outputs/return.lua +++ b/spec/outputs/return.lua | |||
| @@ -86,6 +86,30 @@ do | |||
| 86 | end | 86 | end |
| 87 | end | 87 | end |
| 88 | end | 88 | end |
| 89 | do | ||
| 90 | return { | ||
| 91 | value = value, | ||
| 92 | itemA = 123, | ||
| 93 | itemB = "abc" | ||
| 94 | } | ||
| 95 | end | ||
| 96 | do | ||
| 97 | local _tab_0 = { | ||
| 98 | 1, | ||
| 99 | 2 | ||
| 100 | } | ||
| 101 | local _idx_0 = 1 | ||
| 102 | for _key_0, _value_0 in pairs(three) do | ||
| 103 | if _idx_0 == _key_0 then | ||
| 104 | _tab_0[#_tab_0 + 1] = _value_0 | ||
| 105 | _idx_0 = _idx_0 + 1 | ||
| 106 | else | ||
| 107 | _tab_0[_key_0] = _value_0 | ||
| 108 | end | ||
| 109 | end | ||
| 110 | _tab_0[#_tab_0 + 1] = 4 | ||
| 111 | return _tab_0 | ||
| 112 | end | ||
| 89 | _ = function() | 113 | _ = function() |
| 90 | local _base_0 = a | 114 | local _base_0 = a |
| 91 | local _fn_0 = _base_0.b | 115 | local _fn_0 = _base_0.b |
