diff options
| author | Li Jin <dragon-fly@qq.com> | 2023-12-07 23:49:48 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2023-12-07 23:55:16 +0800 |
| commit | 514b9f97febe8920a78d6078b092fe84b859a963 (patch) | |
| tree | 8c76ba7579f69db7e2c899e4713009b910e0fa89 /spec/inputs/destructure.yue | |
| parent | a1d719e3bbfe8cd39c05d2a8f49143b9e814f876 (diff) | |
| download | yuescript-514b9f97febe8920a78d6078b092fe84b859a963.tar.gz yuescript-514b9f97febe8920a78d6078b092fe84b859a963.tar.bz2 yuescript-514b9f97febe8920a78d6078b092fe84b859a963.zip | |
changed the if-assignment syntax to prevent some errors.v0.21.0
Diffstat (limited to 'spec/inputs/destructure.yue')
| -rw-r--r-- | spec/inputs/destructure.yue | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/inputs/destructure.yue b/spec/inputs/destructure.yue index 73e4d33..5017ee1 100644 --- a/spec/inputs/destructure.yue +++ b/spec/inputs/destructure.yue | |||
| @@ -94,18 +94,18 @@ do | |||
| 94 | 94 | ||
| 95 | do | 95 | do |
| 96 | thing = nil | 96 | thing = nil |
| 97 | if {a} = thing | 97 | if {a} := thing |
| 98 | print a | 98 | print a |
| 99 | else | 99 | else |
| 100 | print "nothing" | 100 | print "nothing" |
| 101 | 101 | ||
| 102 | thang = {1,2} | 102 | thang = {1,2} |
| 103 | if {a,b} = thang | 103 | if {a,b} := thang |
| 104 | print a,b | 104 | print a,b |
| 105 | 105 | ||
| 106 | if {a,b} = thing | 106 | if {a,b} := thing |
| 107 | print a,b | 107 | print a,b |
| 108 | elseif {c,d} = thang | 108 | elseif {c,d} := thang |
| 109 | print c,d | 109 | print c,d |
| 110 | else | 110 | else |
| 111 | print "NO" | 111 | print "NO" |
