From b933fbfce34e9afc798e6882a96586b496ac432f Mon Sep 17 00:00:00 2001 From: Li Jin Date: Wed, 19 Jan 2022 09:38:01 +0800 Subject: update doc. --- doc/docs/doc/README.md | 70 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/doc/docs/doc/README.md b/doc/docs/doc/README.md index 9dd98fb..c7a3af5 100755 --- a/doc/docs/doc/README.md +++ b/doc/docs/doc/README.md @@ -499,11 +499,79 @@ a ??= false local a, b, c, d a = b ?? c ?? d func a ?? {} - a ??= false +### Implicit Object + +You can write a list of implicit structures that starts with the symbol **\*** inside a table block. If you are creating implicit object, the fields of the object must be with the same indent. +```moonscript +list = + * 1 + * 2 + * 3 + +func + * 1 + * 2 + * 3 + +tb = + name: "abc" + + values: + * "a" + * "b" + * "c" + + objects: + * name: "a" + value: 1 + func: => @value + 1 + tb: + fieldA: 1 + + * name: "b" + value: 2 + func: => @value + 2 + tb: { } + +``` + +
+list =
+  * 1
+  * 2
+  * 3
+
+func
+  * 1
+  * 2
+  * 3
+
+tb =
+  name: "abc"
+
+  values:
+    * "a"
+    * "b"
+    * "c"
+
+  objects:
+    * name: "a"
+      value: 1
+      func: => @value + 1
+      tb:
+        fieldA: 1
+
+    * name: "b"
+      value: 2
+      func: => @value + 2
+      tb: { }
+
+
+ ## Module -- cgit v1.2.3-55-g6feb