From d4b7efe3f48b40d108754d2e8359fee1cd9dded8 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Wed, 21 May 2025 15:42:03 +0800 Subject: Added global const declaration. --- doc/docs/doc/README.md | 11 +++++++++++ doc/docs/zh/doc/README.md | 11 +++++++++++ 2 files changed, 22 insertions(+) (limited to 'doc/docs') 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 +You can also declare a global variable to be `const`. + +```moonscript +global const Constant = 123 +``` + +
+global const Constant = 123
+
+
+ ## Literals All 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 +你也可以声明全局变量为常量。 + +```moonscript +global const Constant = 123 +``` + +
+global const Constant = 123
+
+
+ ## 字面量 Lua中的所有基本字面量都可以在月之脚本中使用。包括数字、字符串、布尔值和**nil**。 -- cgit v1.2.3-55-g6feb