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/inputs | |
| 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/inputs')
| -rw-r--r-- | spec/inputs/in_expression.yue | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/inputs/in_expression.yue b/spec/inputs/in_expression.yue index 6faff4e..7ee0816 100644 --- a/spec/inputs/in_expression.yue +++ b/spec/inputs/in_expression.yue | |||
| @@ -35,5 +35,44 @@ do | |||
| 35 | check -> return x in tb | 35 | check -> return x in tb |
| 36 | check -> x not in tb | 36 | check -> x not in tb |
| 37 | 37 | ||
| 38 | do | ||
| 39 | f1 = -> | ||
| 40 | a = 2 | ||
| 41 | a in [ | ||
| 42 | 1 | ||
| 43 | 2 | ||
| 44 | 3 | ||
| 45 | 4 | ||
| 46 | ] | ||
| 47 | f2 = -> | ||
| 48 | a not in [ | ||
| 49 | 1 | ||
| 50 | 2 | ||
| 51 | 3 | ||
| 52 | 4 | ||
| 53 | ] | ||
| 54 | f3 = -> | ||
| 55 | a = 2 | ||
| 56 | a in { b, c, d | ||
| 57 | e, f | ||
| 58 | g | ||
| 59 | } | ||
| 60 | f4 = -> | ||
| 61 | a = 2 | ||
| 62 | b = a in [ 1, 2 | ||
| 63 | 3, 4 | ||
| 64 | ] | ||
| 65 | f5 = -> | ||
| 66 | a = 2 | ||
| 67 | return a in [ 1, 2 | ||
| 68 | 3, 4 | ||
| 69 | ] | ||
| 70 | f6 = -> | ||
| 71 | b = a not in { | ||
| 72 | 1 | ||
| 73 | 2 | ||
| 74 | x: 3 | ||
| 75 | } | ||
| 76 | |||
| 38 | nil | 77 | nil |
| 39 | 78 | ||
