aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2022-01-19 09:38:01 +0800
committerLi Jin <dragon-fly@qq.com>2022-01-19 09:38:01 +0800
commitb933fbfce34e9afc798e6882a96586b496ac432f (patch)
tree9c826e7f59de3ad40adb479610cd2622d6d1a432
parent5ed4725dc826c5e72c0d39543b3d688e236dd54d (diff)
downloadyuescript-b933fbfce34e9afc798e6882a96586b496ac432f.tar.gz
yuescript-b933fbfce34e9afc798e6882a96586b496ac432f.tar.bz2
yuescript-b933fbfce34e9afc798e6882a96586b496ac432f.zip
update doc.
-rwxr-xr-xdoc/docs/doc/README.md70
1 files changed, 69 insertions, 1 deletions
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
499local a, b, c, d 499local a, b, c, d
500a = b ?? c ?? d 500a = b ?? c ?? d
501func a ?? {} 501func a ?? {}
502
503a ??= false 502a ??= false
504</pre> 503</pre>
505</YueDisplay> 504</YueDisplay>
506 505
506### Implicit Object
507
508You 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.
509```moonscript
510list =
511 * 1
512 * 2
513 * 3
514
515func
516 * 1
517 * 2
518 * 3
519
520tb =
521 name: "abc"
522
523 values:
524 * "a"
525 * "b"
526 * "c"
527
528 objects:
529 * name: "a"
530 value: 1
531 func: => @value + 1
532 tb:
533 fieldA: 1
534
535 * name: "b"
536 value: 2
537 func: => @value + 2
538 tb: { }
539
540```
541<YueDisplay>
542<pre>
543list =
544 * 1
545 * 2
546 * 3
547
548func
549 * 1
550 * 2
551 * 3
552
553tb =
554 name: "abc"
555
556 values:
557 * "a"
558 * "b"
559 * "c"
560
561 objects:
562 * name: "a"
563 value: 1
564 func: => @value + 1
565 tb:
566 fieldA: 1
567
568 * name: "b"
569 value: 2
570 func: => @value + 2
571 tb: { }
572</pre>
573</YueDisplay>
574
507 575
508## Module 576## Module
509 577