aboutsummaryrefslogtreecommitdiff
path: root/doc/yue-en.md
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2026-02-24 16:02:05 +0800
committerLi Jin <dragon-fly@qq.com>2026-02-24 16:02:05 +0800
commitafc2eba9d73a43d2f3080cf12be4ffe977a79414 (patch)
tree7d07be9dd9150d1eaa08caddcf3e7f88acb5396a /doc/yue-en.md
parent0ccf4408271c8a0d147e3cf25689810862e8c1db (diff)
downloadyuescript-afc2eba9d73a43d2f3080cf12be4ffe977a79414.tar.gz
yuescript-afc2eba9d73a43d2f3080cf12be4ffe977a79414.tar.bz2
yuescript-afc2eba9d73a43d2f3080cf12be4ffe977a79414.zip
Updated docs. [skip CI]
Diffstat (limited to 'doc/yue-en.md')
-rw-r--r--doc/yue-en.md26
1 files changed, 13 insertions, 13 deletions
diff --git a/doc/yue-en.md b/doc/yue-en.md
index 764bc1a..a82ae9a 100644
--- a/doc/yue-en.md
+++ b/doc/yue-en.md
@@ -15,18 +15,6 @@ do
15print var -- nil here 15print var -- nil here
16``` 16```
17 17
18YueScript's **do** can also be used an expression . Allowing you to combine multiple lines into one. The result of the do expression is the last statement in its body.
19
20`do` expressions also support using `break` to interrupt control flow and return multiple values early:
21
22```yuescript
23status, value = do
24 n = 12
25 if n > 10
26 break "large", n
27 break "small", n
28```
29
30```yuescript 18```yuescript
31counter = do 19counter = do
32 i = 0 20 i = 0
@@ -46,6 +34,18 @@ tbl = {
46} 34}
47``` 35```
48 36
37YueScript's **do** can also be used an expression . Allowing you to combine multiple lines into one. The result of the do expression is the last statement in its body.
38
39`do` expressions also support using `break` to interrupt control flow and return multiple values early:
40
41```yuescript
42status, value = do
43 n = 12
44 if n > 10
45 break "large", n
46 break "small", n
47```
48
49# Line Decorators 49# Line Decorators
50 50
51For convenience, the for loop and if statement can be applied to single statements at the end of the line: 51For convenience, the for loop and if statement can be applied to single statements at the end of the line:
@@ -870,7 +870,7 @@ with tb
870 870
871```yuescript 871```yuescript
872with? obj 872with? obj
873 print obj.name 873 print .name
874``` 874```
875 875
876# Assignment 876# Assignment