diff options
| author | Li Jin <dragon-fly@qq.com> | 2021-11-02 11:17:58 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2021-11-02 11:17:58 +0800 |
| commit | 827c3736f357e09168fc108e8e740c6425d37d9b (patch) | |
| tree | 259f977bf7f4ebe0e397fe5e1b74e7fbb1b75e8e /spec | |
| parent | aed806476fe50899c0f01750175531ac41267b9d (diff) | |
| download | yuescript-827c3736f357e09168fc108e8e740c6425d37d9b.tar.gz yuescript-827c3736f357e09168fc108e8e740c6425d37d9b.tar.bz2 yuescript-827c3736f357e09168fc108e8e740c6425d37d9b.zip | |
fix a wrong code generating issue, update builtin Lua.
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/inputs/nil_coalesing.yue | 3 | ||||
| -rw-r--r-- | spec/outputs/nil_coalesing.lua | 18 |
2 files changed, 21 insertions, 0 deletions
diff --git a/spec/inputs/nil_coalesing.yue b/spec/inputs/nil_coalesing.yue index 45b34f4..facd64c 100644 --- a/spec/inputs/nil_coalesing.yue +++ b/spec/inputs/nil_coalesing.yue | |||
| @@ -36,5 +36,8 @@ do | |||
| 36 | a or= 1 | 36 | a or= 1 |
| 37 | b ??= c ?? 2 | 37 | b ??= c ?? 2 |
| 38 | 38 | ||
| 39 | do | ||
| 40 | a = 1 ?? 2 ?? 3 | ||
| 41 | |||
| 39 | nil | 42 | nil |
| 40 | 43 | ||
diff --git a/spec/outputs/nil_coalesing.lua b/spec/outputs/nil_coalesing.lua index 36a6644..b434671 100644 --- a/spec/outputs/nil_coalesing.lua +++ b/spec/outputs/nil_coalesing.lua | |||
| @@ -135,4 +135,22 @@ do | |||
| 135 | end | 135 | end |
| 136 | end | 136 | end |
| 137 | end | 137 | end |
| 138 | do | ||
| 139 | local a | ||
| 140 | do | ||
| 141 | local _exp_0 = 1 | ||
| 142 | if _exp_0 ~= nil then | ||
| 143 | a = _exp_0 | ||
| 144 | else | ||
| 145 | do | ||
| 146 | local _exp_1 = 2 | ||
| 147 | if _exp_1 ~= nil then | ||
| 148 | a = _exp_1 | ||
| 149 | else | ||
| 150 | a = 3 | ||
| 151 | end | ||
| 152 | end | ||
| 153 | end | ||
| 154 | end | ||
| 155 | end | ||
| 138 | return nil | 156 | return nil |
