diff options
| author | Li Jin <dragon-fly@qq.com> | 2024-09-04 12:16:10 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2024-09-04 12:16:25 +0800 |
| commit | 461bf7c32408553125d71b23e04e21fed690c4f5 (patch) | |
| tree | 4442efd0fc2524e82be63e12e3e046a0532b26dd /spec/inputs | |
| parent | 2f8215df7288e0aac690c8e8b1ff79865f114302 (diff) | |
| download | yuescript-461bf7c32408553125d71b23e04e21fed690c4f5.tar.gz yuescript-461bf7c32408553125d71b23e04e21fed690c4f5.tar.bz2 yuescript-461bf7c32408553125d71b23e04e21fed690c4f5.zip | |
fix more cases for evaluation order of multi-value assignments.v0.25.1
Diffstat (limited to 'spec/inputs')
| -rw-r--r-- | spec/inputs/assign.yue | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/inputs/assign.yue b/spec/inputs/assign.yue index 2c89a99..514aeed 100644 --- a/spec/inputs/assign.yue +++ b/spec/inputs/assign.yue | |||
| @@ -63,6 +63,20 @@ do | |||
| 63 | 123, tb | 63 | 123, tb |
| 64 | 64 | ||
| 65 | do | 65 | do |
| 66 | a, b[] = if x | ||
| 67 | switch y | ||
| 68 | when 1 | ||
| 69 | f! | ||
| 70 | print a, b | ||
| 71 | |||
| 72 | do | ||
| 73 | a, {b} = if x | ||
| 74 | f! | ||
| 75 | else | ||
| 76 | 123, tb | ||
| 77 | print a, b | ||
| 78 | |||
| 79 | do | ||
| 66 | a, b[], c, d.<add> = if x | 80 | a, b[], c, d.<add> = if x |
| 67 | switch y | 81 | switch y |
| 68 | when 1 | 82 | when 1 |
| @@ -75,6 +89,12 @@ do | |||
| 75 | do | 89 | do |
| 76 | print 123 | 90 | print 123 |
| 77 | 1, f2! | 91 | 1, f2! |
| 92 | print a, b, c, d | ||
| 93 | |||
| 94 | do | ||
| 95 | x, [a, b], tb.<>, c[] = 1, if cond | ||
| 96 | f! | ||
| 97 | print x, a, b | ||
| 78 | 98 | ||
| 79 | do | 99 | do |
| 80 | a = b = c = d = 0 | 100 | a = b = c = d = 0 |
