diff options
author | Li Jin <dragon-fly@qq.com> | 2023-07-28 15:54:12 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-07-28 15:54:12 +0800 |
commit | a89680fe48dd1520843d7629e2006f732e313200 (patch) | |
tree | 8be73ac13bf9389e11d0835ed9bff90cc0be4b74 /doc | |
parent | 11e855b8124e21beb737ecb4b4e6228e610f572d (diff) | |
download | yuescript-a89680fe48dd1520843d7629e2006f732e313200.tar.gz yuescript-a89680fe48dd1520843d7629e2006f732e313200.tar.bz2 yuescript-a89680fe48dd1520843d7629e2006f732e313200.zip |
made a little optimization for try-catch syntax.
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/docs/doc/README.md | 9 |
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} | |||
971 | print a, b | 971 | print a, b |
972 | ``` | 972 | ``` |
973 | <YueDisplay> | 973 | <YueDisplay> |
974 | |||
974 | <pre> | 975 | <pre> |
975 | thing = {1, 2} | 976 | thing = {1, 2} |
976 | 977 | ||
@@ -1295,7 +1296,7 @@ catch err | |||
1295 | 1296 | ||
1296 | ## Attributes | 1297 | ## Attributes |
1297 | 1298 | ||
1298 | Syntax 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. | 1299 | Syntax 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 |
1301 | const a = 123 | 1302 | const a = 123 |
@@ -2374,6 +2375,9 @@ if a in (0, 11) | |||
2374 | 2375 | ||
2375 | if a in {1, 3, 5, 7} | 2376 | if a in {1, 3, 5, 7} |
2376 | print "checking equality with discrete values" | 2377 | print "checking equality with discrete values" |
2378 | |||
2379 | if 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 | ||
2391 | if a in {1, 3, 5, 7} | 2395 | if a in {1, 3, 5, 7} |
2392 | print "checking equality with discrete values" | 2396 | print "checking equality with discrete values" |
2397 | |||
2398 | if a in list | ||
2399 | print "checking if `a` is in a list" | ||
2393 | </pre> | 2400 | </pre> |
2394 | </YueDisplay> | 2401 | </YueDisplay> |
2395 | 2402 | ||