diff options
author | Li Jin <dragon-fly@qq.com> | 2024-09-26 22:11:13 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2024-09-26 22:11:13 +0800 |
commit | 7575fe00aad91e0ba943e877ddcd838f76e095c0 (patch) | |
tree | cc1da50dddf61e77f33c026e38afe4ac2ad7d904 /spec/outputs/syntax.lua | |
parent | 461bf7c32408553125d71b23e04e21fed690c4f5 (diff) | |
download | yuescript-0.25.2.tar.gz yuescript-0.25.2.tar.bz2 yuescript-0.25.2.zip |
Fixed a few issues.v0.25.2
* Fixed a `with` block with return statement issue.
* Fixed a switch-when indentation issue.
* Added error reporting for `return` statement not appearing in last block line.
Diffstat (limited to 'spec/outputs/syntax.lua')
-rw-r--r-- | spec/outputs/syntax.lua | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/spec/outputs/syntax.lua b/spec/outputs/syntax.lua index cfe63eb..5fd1821 100644 --- a/spec/outputs/syntax.lua +++ b/spec/outputs/syntax.lua | |||
@@ -40,12 +40,16 @@ end | |||
40 | _ = function() | 40 | _ = function() |
41 | return 1, 2, 34 | 41 | return 1, 2, 34 |
42 | end | 42 | end |
43 | return 5 + function() | 43 | do |
44 | return 4 + 2 | 44 | return 5 + function() |
45 | return 4 + 2 | ||
46 | end | ||
47 | end | ||
48 | do | ||
49 | return 5 + (function() | ||
50 | return 4 | ||
51 | end) + 2 | ||
45 | end | 52 | end |
46 | return 5 + (function() | ||
47 | return 4 | ||
48 | end) + 2 | ||
49 | print(5 + function() | 53 | print(5 + function() |
50 | _ = 34 | 54 | _ = 34 |
51 | return good(nads) | 55 | return good(nads) |