diff options
Diffstat (limited to '')
| -rwxr-xr-x | doc/docs/doc/README.md | 70 |
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 | |||
| 499 | local a, b, c, d | 499 | local a, b, c, d |
| 500 | a = b ?? c ?? d | 500 | a = b ?? c ?? d |
| 501 | func a ?? {} | 501 | func a ?? {} |
| 502 | |||
| 503 | a ??= false | 502 | a ??= false |
| 504 | </pre> | 503 | </pre> |
| 505 | </YueDisplay> | 504 | </YueDisplay> |
| 506 | 505 | ||
| 506 | ### Implicit Object | ||
| 507 | |||
| 508 | 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. | ||
| 509 | ```moonscript | ||
| 510 | list = | ||
| 511 | * 1 | ||
| 512 | * 2 | ||
| 513 | * 3 | ||
| 514 | |||
| 515 | func | ||
| 516 | * 1 | ||
| 517 | * 2 | ||
| 518 | * 3 | ||
| 519 | |||
| 520 | tb = | ||
| 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> | ||
| 543 | list = | ||
| 544 | * 1 | ||
| 545 | * 2 | ||
| 546 | * 3 | ||
| 547 | |||
| 548 | func | ||
| 549 | * 1 | ||
| 550 | * 2 | ||
| 551 | * 3 | ||
| 552 | |||
| 553 | tb = | ||
| 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 | ||
