diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-01-19 17:11:31 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-01-19 17:11:31 +0800 |
| commit | ccfe66f87663e10603e453f02894bb82dd23c93b (patch) | |
| tree | 78f90066a182978bd74218440d13bd3a4dd1d269 /doc/docs | |
| parent | 8a01e9c4ec201ad7079f6863c9236851d162b864 (diff) | |
| download | yuescript-ccfe66f87663e10603e453f02894bb82dd23c93b.tar.gz yuescript-ccfe66f87663e10603e453f02894bb82dd23c93b.tar.bz2 yuescript-ccfe66f87663e10603e453f02894bb82dd23c93b.zip | |
Made `;` work as statements separator.
Diffstat (limited to 'doc/docs')
| -rwxr-xr-x | doc/docs/doc/README.md | 13 | ||||
| -rwxr-xr-x | doc/docs/zh/doc/README.md | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/doc/docs/doc/README.md b/doc/docs/doc/README.md index d862777..b5051d4 100755 --- a/doc/docs/doc/README.md +++ b/doc/docs/doc/README.md | |||
| @@ -1588,6 +1588,19 @@ print ok, count, first | |||
| 1588 | 1588 | ||
| 1589 | YueScript is a whitespace significant language. You have to write some code block in the same indent with space **' '** or tab **'\t'** like function body, value list and some control blocks. And expressions containing different whitespaces might mean different things. Tab is treated like 4 space, but it's better not mix the use of spaces and tabs. | 1589 | YueScript is a whitespace significant language. You have to write some code block in the same indent with space **' '** or tab **'\t'** like function body, value list and some control blocks. And expressions containing different whitespaces might mean different things. Tab is treated like 4 space, but it's better not mix the use of spaces and tabs. |
| 1590 | 1590 | ||
| 1591 | ### Statement Separator | ||
| 1592 | |||
| 1593 | A statement normally ends at a line break. You can also use a semicolon `;` to explicitly terminate a statement, which allows writing multiple statements on the same line: | ||
| 1594 | |||
| 1595 | ```moonscript | ||
| 1596 | a = 1; b = 2; print a + b | ||
| 1597 | ``` | ||
| 1598 | <YueDisplay> | ||
| 1599 | <pre> | ||
| 1600 | a = 1; b = 2; print a + b | ||
| 1601 | </pre> | ||
| 1602 | </YueDisplay> | ||
| 1603 | |||
| 1591 | ### Multiline Chaining | 1604 | ### Multiline Chaining |
| 1592 | 1605 | ||
| 1593 | You can write multi-line chaining function calls with a same indent. | 1606 | You can write multi-line chaining function calls with a same indent. |
diff --git a/doc/docs/zh/doc/README.md b/doc/docs/zh/doc/README.md index 786892d..43713fe 100755 --- a/doc/docs/zh/doc/README.md +++ b/doc/docs/zh/doc/README.md | |||
| @@ -1586,6 +1586,19 @@ print ok, count, first | |||
| 1586 | 1586 | ||
| 1587 | 月之脚本是一个对空白敏感的语言。你必须在相同的缩进中使用空格 **' '** 或制表符 **'\t'** 来编写一些代码块,如函数体、值列表和一些控制块。包含不同空白的表达式可能意味着不同的事情。制表符被视为4个空格,但最好不要混合使用空格和制表符。 | 1587 | 月之脚本是一个对空白敏感的语言。你必须在相同的缩进中使用空格 **' '** 或制表符 **'\t'** 来编写一些代码块,如函数体、值列表和一些控制块。包含不同空白的表达式可能意味着不同的事情。制表符被视为4个空格,但最好不要混合使用空格和制表符。 |
| 1588 | 1588 | ||
| 1589 | ### 语句分隔符 | ||
| 1590 | |||
| 1591 | 一条语句通常以换行结束。你也可以使用分号 `;` 显式结束一条语句,从而在同一行中编写多条语句: | ||
| 1592 | |||
| 1593 | ```moonscript | ||
| 1594 | a = 1; b = 2; print a + b | ||
| 1595 | ``` | ||
| 1596 | <YueDisplay> | ||
| 1597 | <pre> | ||
| 1598 | a = 1; b = 2; print a + b | ||
| 1599 | </pre> | ||
| 1600 | </YueDisplay> | ||
| 1601 | |||
| 1589 | ### 多行链式调用 | 1602 | ### 多行链式调用 |
| 1590 | 1603 | ||
| 1591 | 你可以使用相同的缩进来编写多行链式函数调用。 | 1604 | 你可以使用相同的缩进来编写多行链式函数调用。 |
