aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2023-07-28 15:54:12 +0800
committerLi Jin <dragon-fly@qq.com>2023-07-28 15:54:12 +0800
commita89680fe48dd1520843d7629e2006f732e313200 (patch)
tree8be73ac13bf9389e11d0835ed9bff90cc0be4b74 /doc
parent11e855b8124e21beb737ecb4b4e6228e610f572d (diff)
downloadyuescript-a89680fe48dd1520843d7629e2006f732e313200.tar.gz
yuescript-a89680fe48dd1520843d7629e2006f732e313200.tar.bz2
yuescript-a89680fe48dd1520843d7629e2006f732e313200.zip
made a little optimization for try-catch syntax.
Diffstat (limited to 'doc')
-rwxr-xr-xdoc/docs/doc/README.md9
1 files changed, 8 insertions, 1 deletions
diff --git a/doc/docs/doc/README.md b/doc/docs/doc/README.md
index 92fe435..c237791 100755
--- a/doc/docs/doc/README.md
+++ b/doc/docs/doc/README.md
@@ -971,6 +971,7 @@ thing = {1, 2}
971print a, b 971print a, b
972``` 972```
973<YueDisplay> 973<YueDisplay>
974
974<pre> 975<pre>
975thing = {1, 2} 976thing = {1, 2}
976 977
@@ -1295,7 +1296,7 @@ catch err
1295 1296
1296## Attributes 1297## Attributes
1297 1298
1298Syntax support for Lua 5.4 attributes. But you can use still use `const` declaration and get constant check working when targeting Lua versions below 5.4. 1299Syntax support for Lua 5.4 attributes. But you can still use `const` declaration and get constant check working when targeting Lua versions below 5.4.
1299 1300
1300```moonscript 1301```moonscript
1301const a = 123 1302const a = 123
@@ -2374,6 +2375,9 @@ if a in (0, 11)
2374 2375
2375if a in {1, 3, 5, 7} 2376if a in {1, 3, 5, 7}
2376 print "checking equality with discrete values" 2377 print "checking equality with discrete values"
2378
2379if a in list
2380 print "checking if `a` is in a list"
2377``` 2381```
2378<YueDisplay> 2382<YueDisplay>
2379<pre> 2383<pre>
@@ -2390,6 +2394,9 @@ if a in (0, 11)
2390 2394
2391if a in {1, 3, 5, 7} 2395if a in {1, 3, 5, 7}
2392 print "checking equality with discrete values" 2396 print "checking equality with discrete values"
2397
2398if a in list
2399 print "checking if `a` is in a list"
2393</pre> 2400</pre>
2394</YueDisplay> 2401</YueDisplay>
2395 2402