aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2023-05-12 11:49:11 +0800
committerLi Jin <dragon-fly@qq.com>2023-05-12 11:49:11 +0800
commit5cb9a124093805edc520d6db59e606c7668b68d5 (patch)
treebca4ef5558ee75b9f8b1296ccfb0a06a4a617f2b /doc
parent45c66c4b8ad0d34742ec7e7ea038cda8ddc0235e (diff)
downloadyuescript-5cb9a124093805edc520d6db59e606c7668b68d5.tar.gz
yuescript-5cb9a124093805edc520d6db59e606c7668b68d5.tar.bz2
yuescript-5cb9a124093805edc520d6db59e606c7668b68d5.zip
update docs.
Diffstat (limited to 'doc')
-rwxr-xr-xdoc/docs/doc/README.md17
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---
2sidebar: auto 2sidebar: auto
3title: 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
1267Syntax 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. 1269Syntax 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
1270const a = 123 1272const a = 123
@@ -1277,6 +1279,19 @@ close _ = &lt;close&gt;: -> print "Out of scope."
1277</pre> 1279</pre>
1278</YueDisplay> 1280</YueDisplay>
1279 1281
1282You can do desctructuring with variables attributed as constant.
1283
1284```moonscript
1285const {:a, :b, c, d} = tb
1286-- a = 1
1287```
1288<YueDisplay>
1289<pre>
1290const {:a, :b, c, d} = tb
1291-- a = 1
1292</pre>
1293</YueDisplay>
1294
1280## Literals 1295## Literals
1281 1296
1282All of the primitive literals in Lua can be used. This applies to numbers, strings, booleans, and **nil**. 1297All of the primitive literals in Lua can be used. This applies to numbers, strings, booleans, and **nil**.