diff options
author | Li Jin <dragon-fly@qq.com> | 2023-05-12 11:49:11 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-05-12 11:49:11 +0800 |
commit | 5cb9a124093805edc520d6db59e606c7668b68d5 (patch) | |
tree | bca4ef5558ee75b9f8b1296ccfb0a06a4a617f2b /doc | |
parent | 45c66c4b8ad0d34742ec7e7ea038cda8ddc0235e (diff) | |
download | yuescript-5cb9a124093805edc520d6db59e606c7668b68d5.tar.gz yuescript-5cb9a124093805edc520d6db59e606c7668b68d5.tar.bz2 yuescript-5cb9a124093805edc520d6db59e606c7668b68d5.zip |
update docs.
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/docs/doc/README.md | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/doc/docs/doc/README.md b/doc/docs/doc/README.md index 7f5aab1..3c910fd 100755 --- a/doc/docs/doc/README.md +++ b/doc/docs/doc/README.md | |||
@@ -1,8 +1,10 @@ | |||
1 | --- | 1 | --- |
2 | sidebar: auto | 2 | sidebar: auto |
3 | title: Reference | ||
3 | --- | 4 | --- |
4 | 5 | ||
5 | # Yuescript | 6 | # Yuescript |
7 | |||
6 | <img src="/image/yuescript.svg" width="300px" height="300px" alt="logo"/> | 8 | <img src="/image/yuescript.svg" width="300px" height="300px" alt="logo"/> |
7 | 9 | ||
8 | ## Introduction | 10 | ## Introduction |
@@ -1264,7 +1266,7 @@ catch err | |||
1264 | 1266 | ||
1265 | ## Attributes | 1267 | ## Attributes |
1266 | 1268 | ||
1267 | Syntax support for Lua 5.4 attributes. But you can use still use `const` declaration and get constant check functioning when targeting Lua versions below 5.4. | 1269 | 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. |
1268 | 1270 | ||
1269 | ```moonscript | 1271 | ```moonscript |
1270 | const a = 123 | 1272 | const a = 123 |
@@ -1277,6 +1279,19 @@ close _ = <close>: -> print "Out of scope." | |||
1277 | </pre> | 1279 | </pre> |
1278 | </YueDisplay> | 1280 | </YueDisplay> |
1279 | 1281 | ||
1282 | You can do desctructuring with variables attributed as constant. | ||
1283 | |||
1284 | ```moonscript | ||
1285 | const {:a, :b, c, d} = tb | ||
1286 | -- a = 1 | ||
1287 | ``` | ||
1288 | <YueDisplay> | ||
1289 | <pre> | ||
1290 | const {:a, :b, c, d} = tb | ||
1291 | -- a = 1 | ||
1292 | </pre> | ||
1293 | </YueDisplay> | ||
1294 | |||
1280 | ## Literals | 1295 | ## Literals |
1281 | 1296 | ||
1282 | All of the primitive literals in Lua can be used. This applies to numbers, strings, booleans, and **nil**. | 1297 | All of the primitive literals in Lua can be used. This applies to numbers, strings, booleans, and **nil**. |