diff options
author | Li Jin <dragon-fly@qq.com> | 2024-02-05 10:27:47 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2024-02-05 10:27:47 +0800 |
commit | ef0ff9c4c523980d71e49d65e8db57d670daf85c (patch) | |
tree | bfe36110dbb6a11b15464168bc8f872c1678eac3 /spec/outputs | |
parent | 5dcfab2ee3bd686ec78de360a09987d916c02b36 (diff) | |
download | yuescript-ef0ff9c4c523980d71e49d65e8db57d670daf85c.tar.gz yuescript-ef0ff9c4c523980d71e49d65e8db57d670daf85c.tar.bz2 yuescript-ef0ff9c4c523980d71e49d65e8db57d670daf85c.zip |
fix more invalid in-expression use cases.
Diffstat (limited to 'spec/outputs')
-rw-r--r-- | spec/outputs/in_expression.lua | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/spec/outputs/in_expression.lua b/spec/outputs/in_expression.lua index 04c08e7..afcc030 100644 --- a/spec/outputs/in_expression.lua +++ b/spec/outputs/in_expression.lua | |||
@@ -162,4 +162,53 @@ do | |||
162 | return true | 162 | return true |
163 | end) | 163 | end) |
164 | end | 164 | end |
165 | do | ||
166 | local f1 | ||
167 | f1 = function() | ||
168 | local a = 2 | ||
169 | return (1 == a or 2 == a or 3 == a or 4 == a) | ||
170 | end | ||
171 | local f2 | ||
172 | f2 = function() | ||
173 | local _val_0 = a | ||
174 | return not (1 == _val_0 or 2 == _val_0 or 3 == _val_0 or 4 == _val_0) | ||
175 | end | ||
176 | local f3 | ||
177 | f3 = function() | ||
178 | local a = 2 | ||
179 | return (b == a or c == a or d == a or e == a or f == a or g == a) | ||
180 | end | ||
181 | local f4 | ||
182 | f4 = function() | ||
183 | local a = 2 | ||
184 | local b | ||
185 | b = (1 == a or 2 == a or 3 == a or 4 == a) | ||
186 | end | ||
187 | local f5 | ||
188 | f5 = function() | ||
189 | local a = 2 | ||
190 | return (1 == a or 2 == a or 3 == a or 4 == a) | ||
191 | end | ||
192 | local f6 | ||
193 | f6 = function() | ||
194 | local b | ||
195 | do | ||
196 | local _check_0 = { | ||
197 | 1, | ||
198 | 2, | ||
199 | x = 3 | ||
200 | } | ||
201 | local _val_0 = a | ||
202 | local _find_0 = false | ||
203 | for _index_0 = 1, #_check_0 do | ||
204 | local _item_0 = _check_0[_index_0] | ||
205 | if _item_0 == _val_0 then | ||
206 | _find_0 = true | ||
207 | break | ||
208 | end | ||
209 | end | ||
210 | b = not _find_0 | ||
211 | end | ||
212 | end | ||
213 | end | ||
165 | return nil | 214 | return nil |