diff options
| author | Li Jin <dragon-fly@qq.com> | 2025-11-21 12:21:04 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2025-11-21 12:21:04 +0800 |
| commit | 43dde2fff316051d03968e8efd313f19b53112fc (patch) | |
| tree | ae3f99ce6edcd397b75002003048518ee33bae5b /spec/inputs/destructure.yue | |
| parent | b462de9d09d4708490161c7c16858bce2c9cb9b6 (diff) | |
| download | yuescript-0.29.9.tar.gz yuescript-0.29.9.tar.bz2 yuescript-0.29.9.zip | |
Updated syntax.v0.29.9
* Added error check for mixed use of tabs and spaces.
* Supported SimpleTable destructuring for ForEach syntax.
Diffstat (limited to '')
| -rw-r--r-- | spec/inputs/destructure.yue | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/inputs/destructure.yue b/spec/inputs/destructure.yue index b6250d0..179056c 100644 --- a/spec/inputs/destructure.yue +++ b/spec/inputs/destructure.yue | |||
| @@ -278,5 +278,15 @@ do | |||
| 278 | do | 278 | do |
| 279 | {a, :abc, b, :def, ...sub, d, e} = tb | 279 | {a, :abc, b, :def, ...sub, d, e} = tb |
| 280 | 280 | ||
| 281 | do | ||
| 282 | for {:a, :b} in *items | ||
| 283 | print a, b | ||
| 284 | |||
| 285 | for :a, :b in *items | ||
| 286 | print a, b | ||
| 287 | |||
| 288 | for :body in pairs data | ||
| 289 | print body if body | ||
| 290 | |||
| 281 | nil | 291 | nil |
| 282 | 292 | ||
