aboutsummaryrefslogtreecommitdiff
path: root/doc/docs
diff options
context:
space:
mode:
Diffstat (limited to 'doc/docs')
-rwxr-xr-xdoc/docs/doc/README.md11
-rwxr-xr-xdoc/docs/zh/doc/README.md11
2 files changed, 22 insertions, 0 deletions
diff --git a/doc/docs/doc/README.md b/doc/docs/doc/README.md
index dac96ee..1142fc3 100755
--- a/doc/docs/doc/README.md
+++ b/doc/docs/doc/README.md
@@ -1513,6 +1513,17 @@ const {:a, :b, c, d} = tb
1513</pre> 1513</pre>
1514</YueDisplay> 1514</YueDisplay>
1515 1515
1516You can also declare a global variable to be `const`.
1517
1518```moonscript
1519global const Constant = 123
1520```
1521<YueDisplay>
1522<pre>
1523global const Constant = 123
1524</pre>
1525</YueDisplay>
1526
1516## Literals 1527## Literals
1517 1528
1518All of the primitive literals in Lua can be used. This applies to numbers, strings, booleans, and **nil**. 1529All of the primitive literals in Lua can be used. This applies to numbers, strings, booleans, and **nil**.
diff --git a/doc/docs/zh/doc/README.md b/doc/docs/zh/doc/README.md
index 850afed..a4e76bb 100755
--- a/doc/docs/zh/doc/README.md
+++ b/doc/docs/zh/doc/README.md
@@ -1512,6 +1512,17 @@ const {:a, :b, c, d} = tb
1512</pre> 1512</pre>
1513</YueDisplay> 1513</YueDisplay>
1514 1514
1515你也可以声明全局变量为常量。
1516
1517```moonscript
1518global const Constant = 123
1519```
1520<YueDisplay>
1521<pre>
1522global const Constant = 123
1523</pre>
1524</YueDisplay>
1525
1515## 字面量 1526## 字面量
1516 1527
1517Lua中的所有基本字面量都可以在月之脚本中使用。包括数字、字符串、布尔值和**nil**。 1528Lua中的所有基本字面量都可以在月之脚本中使用。包括数字、字符串、布尔值和**nil**。